<commit_before><%= render partial: 'layouts/research_sessions_menu' %>
<%= search_form_for @s do |f| %>
    <%= f.label "Tags" %>
    <%= f.text_field :ransack_tagged_with,
                              class: 'tokenfield input-large',
                              data: { search_url: '/taggings/search?type=ResearchSession&q=%QUERY',
                                      submit_id: 'search-tag-hidden-input',
                                      pre_populate: @s.ransack_tagged_with&.split(',')
                                    }
                            %>

  <%= f.label "Title" %>
  <%= f.search_field :title_or_description_cont %>
  <%= f.label "Notes" %>
  <%= f.search_field :comments_cont %>
  <%= f.label "Person's Name" %>
  <%= f.search_field :people_full_name_cont %>
  <%= f.label "User" %>
  <%= f.select :user_name_cont, User.where(approved: true).map(&:name), {include_blank: true} %>
  <%= f.submit 'Search', class: 'btn btn-small' %>
  <%= link_to "Clear", research_sessions_path, class: 'btn btn-small' %>
<% end %>
<div class="row">
  <div class="span12" style="text-align:center">
    <%= will_paginate @research_sessions, :renderer => BootstrapPagination::Rails %>
  </div>
</div>
<div class="row">
  <div class="span12">
    <h4>List of Sessions</h4>
    <table class="table table-striped">
      <thead>
        <tr>
          <th><%= sort_link(@q, :title) %></th>
          <th><%= sort_link(@q, :description) %></th>
          <th><%= sort_link(@q, :location) %></th>
          <th>Starts at</th>
          <th><%= sort_link(@q, :duration) %></th>
          <th><%= sort_link(@q, :created_by) %></th>
          <th>Number Invited:</th>
          <th>Attended</th>
        </tr>
      </thead>

      <tbody>
        <% @research_sessions.each do |sesh| %>
          <tr>
            <td><%= link_to sesh.title, sesh %></td>
            <td><%= sesh.description %></td>
            <td><%= sesh.location %></td>
            <td><%= sesh.start_datetime_human %></td>
            <td><%= sesh.duration %></td>
            <td><%= sesh.user.name %></td>
            <td><%= sesh.people.count %></td>
            <td><%= sesh.invitations.where(aasm_state:'attended').size %></td>
            <!-- probably link to the reservations for this event -->
          </tr>
        <% end %>
      </tbody>
    </table>

  </div>
</div>

<div class="row">
  <div class="span12" style="text-align:center">
    <%= will_paginate @research_sessions, :renderer => BootstrapPagination::Rails %>
  </div>
</div>

<div class="row">
  <div class="span12">
    <p><%= link_to 'New Session', new_research_session_path %></p>
  </div>
</div>
<commit_msg>preselecting the current user as session filter<commit_after><%= render partial: 'layouts/research_sessions_menu' %>
<%= search_form_for @s do |f| %>
    <%= f.label "Tags" %>
    <%= f.text_field :ransack_tagged_with,
                              class: 'tokenfield input-large',
                              data: { search_url: '/taggings/search?type=ResearchSession&q=%QUERY',
                                      submit_id: 'search-tag-hidden-input',
                                      pre_populate: @s.ransack_tagged_with&.split(',')
                                    }
                            %>

  <%= f.label "Title" %>
  <%= f.search_field :title_or_description_cont %>
  <%= f.label "Notes" %>
  <%= f.search_field :comments_cont %>
  <%= f.label "Person's Name" %>
  <%= f.search_field :people_full_name_cont %>
  <%= f.label "User" %>
  <%= f.select :user_name_cont, User.where(approved: true).map(&:name), selected: @current_user.name, {include_blank: true} %>
  <%= f.submit 'Search', class: 'btn btn-small' %>
  <%= link_to "Clear", research_sessions_path, class: 'btn btn-small' %>
<% end %>
<div class="row">
  <div class="span12" style="text-align:center">
    <%= will_paginate @research_sessions, :renderer => BootstrapPagination::Rails %>
  </div>
</div>
<div class="row">
  <div class="span12">
    <h4>List of Sessions</h4>
    <table class="table table-striped">
      <thead>
        <tr>
          <th><%= sort_link(@q, :title) %></th>
          <th><%= sort_link(@q, :description) %></th>
          <th><%= sort_link(@q, :location) %></th>
          <th>Starts at</th>
          <th><%= sort_link(@q, :duration) %></th>
          <th><%= sort_link(@q, :created_by) %></th>
          <th>Number Invited:</th>
          <th>Attended</th>
        </tr>
      </thead>

      <tbody>
        <% @research_sessions.each do |sesh| %>
          <tr>
            <td><%= link_to sesh.title, sesh %></td>
            <td><%= sesh.description %></td>
            <td><%= sesh.location %></td>
            <td><%= sesh.start_datetime_human %></td>
            <td><%= sesh.duration %></td>
            <td><%= sesh.user.name %></td>
            <td><%= sesh.people.count %></td>
            <td><%= sesh.invitations.where(aasm_state:'attended').size %></td>
            <!-- probably link to the reservations for this event -->
          </tr>
        <% end %>
      </tbody>
    </table>

  </div>
</div>

<div class="row">
  <div class="span12" style="text-align:center">
    <%= will_paginate @research_sessions, :renderer => BootstrapPagination::Rails %>
  </div>
</div>

<div class="row">
  <div class="span12">
    <p><%= link_to 'New Session', new_research_session_path %></p>
  </div>
</div>

{'fraction_non_alphanumeric': 0.19725621060437523, 'fraction_numerical': 0.0037078235076010383, 'mean_word_length': 2.2382953181272507, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 0, '>': 199, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '401135', 'n_tokens_mistral': 1970, 'n_tokens_neox': 1817, 'n_words': 354}