<commit_before><%= link_to admin_poll_officer_assignments_path(@poll) do %>
  <span class="icon-angle-left"></span>
  <%= @poll.name %>
<% end %>

<h2><%= @officer.name %> - <%= @officer.email %></h2>

<% if @officer_assignments.empty? %>
  <div class="callout primary margin-top">
    <%= t("admin.poll_officer_assignments.by_officer.no_assignments") %>
  </div>
<% else %>
  <h3><%= t("admin.poll_officer_assignments.by_officer.assignments") %></h3>
  <table class="fixed">
    <thead>
      <tr>
        <th><%= t("admin.poll_officer_assignments.by_officer.date") %></th>
        <th><%= t("admin.poll_officer_assignments.by_officer.booth") %></th>
      </tr>
    </thead>
    <tbody>
      <% @officer_assignments.each do |officer_assignment| %>
        <tr id="<%= dom_id officer_assignment %>">
          <td><%= officer_assignment.final? ? t('polls.final_date') : l(officer_assignment.date.to_date) %></td>
          <td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% end %>

<% final_officer_assignments = @officer_assignments.select{|oa| oa.final == true} %>
<% if final_officer_assignments.any? %>
  <h3><%= t("admin.poll_officer_assignments.by_officer.total_recounts") %></h3>
  <table id="total_recount_list" class="fixed">
    <thead>
      <tr>
        <th><%= t("admin.poll_officer_assignments.by_officer.date") %></th>
        <th><%= t("admin.poll_officer_assignments.by_officer.booth") %></th>
        <th class="text-right"><%= t("admin.poll_officer_assignments.by_officer.total_recount") %></th>
      </tr>
    </thead>
    <tbody>
      <% final_officer_assignments.each do |officer_assignment| %>
          <tr id="total_recount_<%= officer_assignment.date.to_date.strftime('%Y%m%d') %>">
            <td><%= l(officer_assignment.date.to_date) %></td>
            <td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
            <td class="text-right">
              <% if officer_assignment.total_recounts.any? %>
                <%= officer_assignment.total_recounts.to_a.sum(&:amount) %>
              <% else %>
                <span>-</span>
              <% end %>
            </td>
          </tr>
      <% end %>
    </tbody>
  </table>
<% end %><commit_msg>Fix admin poll officers assignments by officer view<commit_after><%= link_to admin_poll_officer_assignments_path(@poll) do %>
  <span class="icon-angle-left"></span>
  <%= @poll.name %>
<% end %>

<h2><%= @officer.name %> - <%= @officer.email %></h2>

<% if @officer_assignments.empty? %>
  <div class="callout primary margin-top">
    <%= t("admin.poll_officer_assignments.by_officer.no_assignments") %>
  </div>
<% else %>
  <h3><%= t("admin.poll_officer_assignments.by_officer.assignments") %></h3>
  <table class="fixed">
    <thead>
      <tr>
        <th><%= t("admin.poll_officer_assignments.by_officer.date") %></th>
        <th><%= t("admin.poll_officer_assignments.by_officer.booth") %></th>
      </tr>
    </thead>
    <tbody>
      <% @officer_assignments.each do |officer_assignment| %>
        <tr id="<%= dom_id officer_assignment %>">
          <td><%= officer_assignment.final? ? t('polls.final_date') : l(officer_assignment.date.to_date) %></td>
          <td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <h3><%= t("admin.poll_officer_assignments.by_officer.total_recounts") %></h3>
  <table id="total_recount_list" class="fixed">
    <thead>
      <tr>
        <th><%= t("admin.poll_officer_assignments.by_officer.date") %></th>
        <th><%= t("admin.poll_officer_assignments.by_officer.booth") %></th>
        <th class="text-right"><%= t("admin.poll_officer_assignments.by_officer.total_recount") %></th>
      </tr>
    </thead>
    <tbody>
      <% @officer_assignments.each do |officer_assignment| %>
          <tr id="total_recount_<%= officer_assignment.date.to_date.strftime('%Y%m%d') %>">
            <td><%= l(officer_assignment.date.to_date) %></td>
            <td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
            <td class="text-right">
              <% if officer_assignment.total_results.any? %>
                <%= officer_assignment.total_results.to_a.sum(&:amount) %>
              <% else %>
                <span>-</span>
              <% end %>
            </td>
          </tr>
      <% end %>
    </tbody>
  </table>
<% end %>
{'fraction_non_alphanumeric': 0.19411243913235945, 'fraction_numerical': 0.0026560424966799467, 'mean_word_length': 3.056552962298025, 'pattern_counts': {'":': 0, '<': 170, '<?xml version=': 0, '>': 170, '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': '6344062', 'n_tokens_mistral': 1744, 'n_tokens_neox': 1622, 'n_words': 220}