<commit_before><% content_for(:page_title, 'Appointments') %>
<div class="page-header">
  <ol class="breadcrumb">
    <li><%= link_to 'Employer planner', root_path %></li>
    <li class="active">Appointments</li>
  </ol>

  <h1>Appointments</h1>
</div>

<div class="t-search filters">
  <div class="panel panel-default">
    <header class="panel-heading">
      <%= form_for @search, url: appointments_path, as: :search, method: :get, html: { class: 'inline form-inline' } do |f| %>
        <ul class="nav nav-compact nav-pills filters__nav">
          <li class="filters__item">
            <%= f.label :reference, class: 'filters__label' %>
            <%= f.text_field :reference, class: 't-reference form-control filters__form-control', placeholder: 'Reference' %>
          </li>
          <li class="filters__item">
            <%= f.label :name, class: 'filters__label' %>
            <%= f.text_field :name, class: 't-name form-control filters__form-control', placeholder: 'Name' %>
          </li>
          <li class="filters__item">
            <%= f.label :status, class: 'filters__label' %>
            <%= f.select :status, friendly_options(Appointment.statuses), { include_blank: 'All Statuses' }, { class: 't-status form-control filters__form-control filters__form-control--status' } %>
          </li>
          <li class="filters__item">
            <%= f.label :employer, class: 'filters__label' %>
            <%= f.collection_select :employer, @search.employers, :id, :name, { include_blank: 'All Employers' }, { class: 'js-employers t-employer form-control filters__form-control filters__form-control--location' } %>
          </li>
          <li class="filters__item">
            <%= f.label :location, class: 'filters__label' %>
            <%= f.grouped_collection_select :location, @search.employers, :locations, :name, :id, :name, { include_blank: 'All Locations' }, { class: 'js-locations t-location form-control filters__form-control filters__form-control--location' } %>
          </li>
          <li class="filters__item">
            <%= f.label :date, 'Date', class: 'filters__label' %><%= f.text_field :date, class: 'js-date-range-picker t-date form-control filters__form-control', readonly: true, data: { module: 'date-range-picker' } %>
          </li>
          <li class="filters__item">
            <%= f.label :processed, class: 'filters__label' %><%= f.select :processed, [['No', 'false'], ['Yes', 'true']], {}, { class: 'form-control filters__form-control t-processed' } %>
          </li>
          <li class="filters__item">
           <%= f.button class: 't-submit btn btn-default filters__button' do %>
             <span aria-hidden="true" class="glyphicon glyphicon-search"></span> Search
           <% end %>
          </li>
        </ul>
      <% end %>
    </header>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <% if @appointments.empty? %>
      <p class="no-content t-notice">No appointments.</p>
    <% else %>
      <%= paginate @appointments %>

      <table class="table table-bordered centred-table table-striped">
        <caption><span class="sr-only">Appointments</span></caption>
        <thead>
          <tr class="table-header">
            <th>Requested</th>
            <th>Customer name</th>
            <th>Slot</th>
            <th>Location</th>
            <th>Reference</th>
            <th>Status</th>
            <th>Processed</th>
            <th></th>
          </tr>
        </thead>
        <tbody>
          <% @appointments.each do |appointment| %>
            <% appointment = AppointmentDecorator.new(appointment) %>
            <tr class="t-appointment">
              <td>
                <%= time_ago_in_words(appointment.created_at) %> ago
              </td>
              <td>
                <%= appointment.full_name %>
              </td>
              <td>
                <%= appointment.slot %>
              </td>
              <td>
                <%= appointment.location_name %>
              </td>
              <td>
                <%= appointment.id %><commit_msg>Show employer name separately<commit_after><% content_for(:page_title, 'Appointments') %>
<div class="page-header">
  <ol class="breadcrumb">
    <li><%= link_to 'Employer planner', root_path %></li>
    <li class="active">Appointments</li>
  </ol>

  <h1>Appointments</h1>
</div>

<div class="t-search filters">
  <div class="panel panel-default">
    <header class="panel-heading">
      <%= form_for @search, url: appointments_path, as: :search, method: :get, html: { class: 'inline form-inline' } do |f| %>
        <ul class="nav nav-compact nav-pills filters__nav">
          <li class="filters__item">
            <%= f.label :reference, class: 'filters__label' %>
            <%= f.text_field :reference, class: 't-reference form-control filters__form-control', placeholder: 'Reference' %>
          </li>
          <li class="filters__item">
            <%= f.label :name, class: 'filters__label' %>
            <%= f.text_field :name, class: 't-name form-control filters__form-control', placeholder: 'Name' %>
          </li>
          <li class="filters__item">
            <%= f.label :status, class: 'filters__label' %>
            <%= f.select :status, friendly_options(Appointment.statuses), { include_blank: 'All Statuses' }, { class: 't-status form-control filters__form-control filters__form-control--status' } %>
          </li>
          <li class="filters__item">
            <%= f.label :employer, class: 'filters__label' %>
            <%= f.collection_select :employer, @search.employers, :id, :name, { include_blank: 'All Employers' }, { class: 'js-employers t-employer form-control filters__form-control filters__form-control--location' } %>
          </li>
          <li class="filters__item">
            <%= f.label :location, class: 'filters__label' %>
            <%= f.grouped_collection_select :location, @search.employers, :locations, :name, :id, :name, { include_blank: 'All Locations' }, { class: 'js-locations t-location form-control filters__form-control filters__form-control--location' } %>
          </li>
          <li class="filters__item">
            <%= f.label :date, 'Date', class: 'filters__label' %><%= f.text_field :date, class: 'js-date-range-picker t-date form-control filters__form-control', readonly: true, data: { module: 'date-range-picker' } %>
          </li>
          <li class="filters__item">
            <%= f.label :processed, class: 'filters__label' %><%= f.select :processed, [['No', 'false'], ['Yes', 'true']], {}, { class: 'form-control filters__form-control t-processed' } %>
          </li>
          <li class="filters__item">
           <%= f.button class: 't-submit btn btn-default filters__button' do %>
             <span aria-hidden="true" class="glyphicon glyphicon-search"></span> Search
           <% end %>
          </li>
        </ul>
      <% end %>
    </header>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <% if @appointments.empty? %>
      <p class="no-content t-notice">No appointments.</p>
    <% else %>
      <%= paginate @appointments %>

      <table class="table table-bordered centred-table table-striped">
        <caption><span class="sr-only">Appointments</span></caption>
        <thead>
          <tr class="table-header">
            <th>Requested</th>
            <th>Customer name</th>
            <th>Slot</th>
            <th>Employer</th>
            <th>Location</th>
            <th>Reference</th>
            <th>Status</th>
            <th>Processed</th>
            <th></th>
          </tr>
        </thead>
        <tbody>
          <% @appointments.each do |appointment| %>
            <% appointment = AppointmentDecorator.new(appointment) %>
            <tr class="t-appointment">
              <td>
                <%= time_ago_in_words(appointment.created_at) %> ago
              </td>
              <td>
                <%= appointment.full_name %>
              </td>
              <td>
                <%= appointment.slot %>
              </td>
              <td>
                <%= appointment.employer_name %>
              </td>
              <td>
                <%= appointment.location_name %>
              </td>
              <td>
                <%= appointment.id %>
{'fraction_non_alphanumeric': 0.16730861819932596, 'fraction_numerical': 0.0009629272989889263, 'mean_word_length': 2.2118283726323926, 'pattern_counts': {'":': 0, '<': 220, '<?xml version=': 0, '>': 220, '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': '1196742', 'n_tokens_mistral': 2649, 'n_tokens_neox': 2476, 'n_words': 511}