<commit_before><% title "#{admin_title} #{t('team_insights', site_name: AppSettings['settings.site_name'])}" %>

<div class="team-header row">

  <div class="col-md-12 clearfix">
    <h2>
      <%= t('team_insights', site_name: AppSettings['settings.site_name']) %>
      <div class="dropdown pull-right">
        <button class="btn btn-default dropdown-toggle less-important" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
          <%= @interval.sentence_case %>
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
          <li><%= link_to t("today", default: "Today"), admin_stats_path(start_date: Time.zone.today.midnight, label: 'today') %></li>
          <li><%= link_to t("yesterday", default: "Yesterday"), admin_stats_path(start_date: Time.zone.yesterday.midnight, end_date: Time.zone.yesterday.at_end_of_day, label: 'yesterday') %></li>
          <li><%= link_to t("this_week", default: "This Week"), admin_stats_path(start_date: Time.zone.today.midnight.at_beginning_of_week, end_date: Time.zone.today.midnight.at_end_of_week, label: 'this_week') %></li>
          <li><%= link_to t("last_week", default: "Last Week"), admin_stats_path(start_date: Time.zone.today.last_week.midnight.at_beginning_of_week, end_date: Time.zone.today.last_week.midnight.at_end_of_week, label: 'last_week') %></li>
          <li><%= link_to t("this_month", default: "This Month"), admin_stats_path(start_date: Time.zone.today.midnight.at_beginning_of_month, end_date: Time.zone.today.midnight.at_end_of_month, label: 'this_month') %></li>
          <li><%= link_to t("last_month", default: "Last Month"), admin_stats_path(start_date: Time.zone.today.last_month.midnight.at_beginning_of_month, end_date: Time.zone.today.last_month.midnight.at_end_of_month, label: 'last_month') %></li>
        </ul>
      </div>
    </h2>
  </div>
  <div class="col-md-12" style="margin-top: 0;">
    <h2 style="margin-top: 0;">
    <small>
      <% if @topic_count > 0 %>
        <%= t('insights_blurb_one', count: @topic_count, period: @interval.sentence_case).html_safe %>
        <%= t('insights_blurb_two', number_replied: @responded_topics.count, percentage_replied: number_to_percentage(@responded_topics.count.to_f / @topic_count.to_f * 100.00, precision: 1)).html_safe %>
        <%= t('insights_blurb_three', response_time: distance_of_time_in_words(@median_first_response_time)).html_safe if @responded_topics.count > 0 %>
      <% else %>
        <%= t('no_discussions', period: @interval).html_safe %>
      <% end %>
    </small>
    </h2>
  </div>

</div>
<commit_msg>add a start and end daterange picker to the insights daterange selector. fix #390<commit_after><% title "#{admin_title} #{t('team_insights', site_name: AppSettings['settings.site_name'])}" %>

<div class="team-header row">

  <div class="col-md-12 clearfix">
    <h2>
      <%= t('team_insights', site_name: AppSettings['settings.site_name']) %>
      <div class="dropdown pull-right">
        <button class="btn btn-default dropdown-toggle less-important" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
          <%= @interval.sentence_case %>
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
          <li><%= link_to t("today", default: "Today"), admin_stats_path(start_date: Time.zone.today.midnight, label: 'today') %></li>
          <li><%= link_to t("yesterday", default: "Yesterday"), admin_stats_path(start_date: Time.zone.yesterday.midnight, end_date: Time.zone.yesterday.at_end_of_day, label: 'yesterday') %></li>
          <li><%= link_to t("this_week", default: "This Week"), admin_stats_path(start_date: Time.zone.today.midnight.at_beginning_of_week, end_date: Time.zone.today.midnight.at_end_of_week, label: 'this_week') %></li>
          <li><%= link_to t("last_week", default: "Last Week"), admin_stats_path(start_date: Time.zone.today.last_week.midnight.at_beginning_of_week, end_date: Time.zone.today.last_week.midnight.at_end_of_week, label: 'last_week') %></li>
          <li><%= link_to t("this_month", default: "This Month"), admin_stats_path(start_date: Time.zone.today.midnight.at_beginning_of_month, end_date: Time.zone.today.midnight.at_end_of_month, label: 'this_month') %></li>
          <li><%= link_to t("last_month", default: "Last Month"), admin_stats_path(start_date: Time.zone.today.last_month.midnight.at_beginning_of_month, end_date: Time.zone.today.last_month.midnight.at_end_of_month, label: 'last_month') %></li>
          <hr>
          <%= simple_form_for :stats, url: admin_stats_path, wrapper: :horizontal_form, method: :get, html: { class: 'form-horizontal' } do |f| %>
            <div class="form-inputs">
              <%= f.input :start_date, label: t('start', default: 'Start'), input_html: { name: 'start_date', type: 'date' } %>
              <%= f.input :end_dat, label: t('end', default: 'End'), input_html: { name: 'end_date', type: 'date' } %>
            </div>

            <div class="form-actions col-sm-offset-3">
              <%= f.button :submit, t('filter', default: 'Filter') %>
            </div>
        <% end %>
        </ul>
      </div>
    </h2>
  </div>
  <div class="col-md-12" style="margin-top: 0;">
    <h2 style="margin-top: 0;">
    <small>
      <% if @topic_count > 0 %>
        <%= t('insights_blurb_one', count: @topic_count, period: @interval.sentence_case).html_safe %>
        <%= t('insights_blurb_two', number_replied: @responded_topics.count, percentage_replied: number_to_percentage(@responded_topics.count.to_f / @topic_count.to_f * 100.00, precision: 1)).html_safe %>
        <%= t('insights_blurb_three', response_time: distance_of_time_in_words(@median_first_response_time)).html_safe if @responded_topics.count > 0 %>
      <% else %>
        <%= t('no_discussions', period: @interval).html_safe %>
      <% end %>
    </small>
    </h2>
  </div>

</div>

{'fraction_non_alphanumeric': 0.1741786362885917, 'fraction_numerical': 0.0072643222717516925, 'mean_word_length': 4.142614601018676, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4541247', 'n_tokens_mistral': 2225, 'n_tokens_neox': 2103, 'n_words': 370}