<commit_before><% content_for :sidebar do %>
  <h2>
    <% if params[:complete] %><%= t('admin.updates.completed') %><% else %><%= t('admin.updates.pending_title') %><% end %>
    Updates
  </h2>
  <p><%= link_to t('admin.updates.show_status', :status => params[:complete] ? t('admin.updates.pending_title') : t('admin.updates.complete')), :complete => params[:complete].nil? %></p>

  <% if @logged_in.admin?(:manage_groups) %>
    <h3><%= t('admin.updates.groups_pending') %></h3>
    <% if not params[:complete] and @unapproved_groups.any? %>
      <p><%= t('groups.following_are_pending_approval', :count => @unapproved_groups.length) %> <%= raw @unapproved_groups.map { |g| link_to(h(g.name), group_path(:id => g)) }.join(', ') %></p>
    <% else %>
      <p><%= t('admin.updates.none') %></p>
    <% end %>
  <% end %>
<% end %>

<h3><%= t('admin.updates.profile_updates') %></h3>

<%= will_paginate @updates, :params => {:complete => params[:complete]} %>

<table class="spaced">
  <% @updates.each do |update| %>
    <tr>
      <td>
        <% if update.person %>
          <a href="<%= person_path(update.person) %>">
            <%= render :partial => 'people/thumbnail', :locals => {:person => update.person} %>
          </a>
        <% else %>
          <%= image_tag 'clean/manoutline.tn.png', :alt => '(' + t('admin.updates.person_deleted') + ')', :class => 'icon thumbnail' %>
        <% end %>
      </td>
      <td class="update">
        <% if update.person %>
          <%= link_to update.person.name, person_path(:id => update.person) %>
        <% else %>
          '(<%= t('admin.updates.person_deleted') %>)'
        <% end %>
        <%= t('admin.updates.updated') %>
        <%= update.created_at.to_s %>
        <% if update.complete %>
          <%= link_to t('admin.updates.mark_incomplete'), administration_update_path(update, :complete => false), :method => 'put' %>
        <% else %>
          <%= link_to t('admin.updates.mark_complete'), administration_update_path(update, :complete => true), :method => 'put' %> |
          <%= link_to t('Delete'), administration_update_path(update), :method => 'delete', :confirm => t('are_you_sure') %>
        <% end %>
        <%= form_for update, :url => administration_update_path(update), :method => 'put' do |form| %>
          <%= hidden_field_tag :complete, true %>
          <table>
            <% if update.family_name %><tr><td><%= t('families.name') %>:</td><td><%= update.family_name %></td></tr><% end %>
            <% if update.family_last_name %><tr><td><%= t('families.last_name') %>:</td><td><%= update.family_last_name %></td></tr><% end %>
            <% if update.first_name %><tr><td><%= t('accounts.first_name') %>:</td><td><%= update.first_name %></td></tr><% end %>
            <% if update.last_name %><tr><td><%= t('accounts.last_name') %>:</td><td><%= update.last_name %></td></tr><% end %>
            <% if update.home_phone %><tr><td><%= t('privacies.home_phone') %>:</td><td><%= format_phone update.home_phone %></td></tr><% end %>
            <% if update.mobile_phone %><tr><td><%= t('privacies.mobile_phone') %>:</td><td><%= format_phone update.mobile_phone, mobile=true %></td></tr><% end %>
            <% if update.work_phone %><tr><td><%= t('privacies.work_phone') %>:</td><td><%= format_phone update.work_phone %></td></tr><% end %>
            <% if update.fax %><tr><td><%= t('privacies.fax') %>:</td><td><%= format_phone update.fax %></td></tr><% end %>
            <% if update.address1 %><tr><td><%= t('privacies.address') %>:</td><td><%= update.address1 %></td></tr><% end %>
            <% if update.address2 %><tr><td><%= t('privacies.address2') %>:</td><td><%= update.address2 %></td></tr><% end %>
            <% if update.city %><tr><td><%= t('search.city') %>:</td><td><%= update.city %></td></tr><% end %>
            <% if update.state %><tr><td><%= t('search.state') %>:</td><td><%= update.state %></td></tr><% end %>
            <% if update.zip %><tr><td><%= t('search.zip') %>:</td><td><%= update.zip %></td></tr><% end %>
            <% if update.birthday %>
              <tr>
                <td><%= t('search.birthday') %>:</td>
                <td>
                  <% unless update.birthday.year == 1800 %>
                    <%= update.birthday.to_s(:date) %>
                  <% end %>
                </td>
              </tr>
            <% end %>
            <% if !update.complete? and (update.birthday.nil? or update.person.years_of_age.nil?) %>
              <tr>
                <td><%= t('people.child') %>:</td>
                <td>
                  <%= form.select :child, ['', [t('Answer_yes'), true], [t('Answer_no'), false]] %>
                </td>
              </tr>
            <% end %>
            <% if update.anniversary %>
              <tr>
                <td><%= t('privacies.anniversary') %>:</td>
                <td>
                  <% unless update.anniversary.year == 1800 %>
                    <%= update.anniversary.to_s(:date) %>
                  <% end %>
                </td>
              </tr>
            <% end %>
            <% update.custom_fields_as_hash.each do |key, val| %>
              <% if val %>
                <tr>
                  <td><%= key %>:</td>
                  <td>
                    <%= val %>
                  </td>
                </tr>
              <% end %>
            <% end %>
            <tr>
              <td></td>
              <td>
                <%= check_box_tag 'review', true, false %>
                <%= label_tag 'review', t('admin.updates.review_changes'), :class => 'inline' %><br/>
                <%= form.submit t('Update') %>
              </td>
            </tr>
          </table>
        <% end %>
      </td>
    </tr>
  <% end %>
</table>

<%= will_paginate @updates, :params => {:complete => params[:complete]} %>

<% if @updates.empty? %>
  <p><em><%= t('admin.updates.no_updates') %>!</em></p>
<% end %>
<commit_msg>Better information on the Pending Updates screen.<commit_after><% content_for :sidebar do %>
  <h2>
    <% if params[:complete] %><%= t('admin.updates.completed') %><% else %><%= t('admin.updates.pending_title') %><% end %>
    Updates
  </h2>
  <p><%= link_to t('admin.updates.show_status', :status => params[:complete] ? t('admin.updates.pending_title') : t('admin.updates.complete')), :complete => params[:complete].nil? %></p>

  <% if @logged_in.admin?(:manage_groups) %>
    <h3><%= t('admin.updates.groups_pending') %></h3>
    <% if not params[:complete] and @unapproved_groups.any? %>
      <p><%= t('groups.following_are_pending_approval', :count => @unapproved_groups.length) %> <%= raw @unapproved_groups.map { |g| link_to(h(g.name), group_path(:id => g)) }.join(', ') %></p>
    <% else %>
      <p><%= t('admin.updates.none') %></p>
    <% end %>
  <% end %>
<% end %>

<h3><%= t('admin.updates.profile_updates') %></h3>

<%= will_paginate @updates, :params => {:complete => params[:complete]} %>

<table class="spaced">
  <% @updates.each do |update| %>
    <tr>
      <td>
        <% if update.person %>
          <a href="<%= person_path(update.person) %>">
            <%= render :partial => 'people/thumbnail', :locals => {:person => update.person} %>
          </a>
        <% else %>
          <%= image_tag 'clean/manoutline.tn.png', :alt => '(' + t('admin.updates.person_deleted') + ')', :class => 'icon thumbnail' %>
        <% end %>
      </td>
      <td class="update">
        <p>
          <% if update.person %>
            <%= link_to update.person.name, person_path(:id => update.person) %>
          <% else %>
            '(<%= t('admin.updates.person_deleted') %>)'
          <% end %>
          <%= t('admin.updates.updated') %>
          <%= update.created_at.to_s %>
          <% if update.complete %>
            <%= link_to t('admin.updates.mark_incomplete'), administration_update_path(update, :complete => false), :method => 'put' %>
          <% else %>
            <%= link_to t('admin.updates.mark_complete'), administration_update_path(update, :complete => true), :method => 'put' %> |
            <%= link_to t('Delete'), administration_update_path(update), :method => 'delete', :confirm => t('are_you_sure') %>
          <% end %>
        </p>
        <%= form_for update, :url => administration_update_path(update), :method => 'put' do |form| %>
          <%= hidden_field_tag :complete, true %>
          <table>
            <% if update.family_name      %><tr><td><%= t('families.name')          %>:</td><td><%= update.family.name                               %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.family_name                        %></td></tr><% end %>
            <% if update.family_last_name %><tr><td><%= t('families.last_name')     %>:</td><td><%= update.family.last_name                          %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.family_last_name                   %></td></tr><% end %>
            <% if update.first_name       %><tr><td><%= t('accounts.first_name')    %>:</td><td><%= update.person.first_name                         %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.first_name                         %></td></tr><% end %>
            <% if update.last_name        %><tr><td><%= t('accounts.last_name')     %>:</td><td><%= update.person.last_name                          %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.last_name                          %></td></tr><% end %>
            <% if update.home_phone       %><tr><td><%= t('privacies.home_phone')   %>:</td><td><%= format_phone update.family.home_phone            %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= format_phone update.home_phone            %></td></tr><% end %>
            <% if update.mobile_phone     %><tr><td><%= t('privacies.mobile_phone') %>:</td><td><%= format_phone update.person.mobile_phone, :mobile %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= format_phone update.mobile_phone, :mobile %></td></tr><% end %>
            <% if update.work_phone       %><tr><td><%= t('privacies.work_phone')   %>:</td><td><%= format_phone update.person.work_phone            %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= format_phone update.work_phone            %></td></tr><% end %>
            <% if update.fax              %><tr><td><%= t('privacies.fax')          %>:</td><td><%= format_phone update.person.fax                   %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= format_phone update.fax                   %></td></tr><% end %>
            <% if update.address1         %><tr><td><%= t('privacies.address')      %>:</td><td><%= update.family.address1                           %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.address1                           %></td></tr><% end %>
            <% if update.address2         %><tr><td><%= t('privacies.address2')     %>:</td><td><%= update.family.address2                           %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.address2                           %></td></tr><% end %>
            <% if update.city             %><tr><td><%= t('search.city')            %>:</td><td><%= update.family.city                               %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.city                               %></td></tr><% end %>
            <% if update.state            %><tr><td><%= t('search.state')           %>:</td><td><%= update.family.state                              %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.state                              %></td></tr><% end %>
            <% if update.zip              %><tr><td><%= t('search.zip')             %>:</td><td><%= update.family.zip                                %></td><td><div class="right-icon" style="width:10px;height:16px;"></td><td><%= update.zip                                %></td></tr><% end %>
            <% if update.birthday         %>
              <tr>
                <td><%= t('search.birthday') %>:</td>
                <td><%= update.person.birthday && update.person.birthday.to_s(:date) %></td>
                <td><div class="right-icon" style="width:10px;height:16px;"></td>
                <td>
                  <% unless update.birthday.year == 1800 %>
                    <%= update.birthday.to_s(:date) %>
                  <% end %>
                </td>
              </tr>
            <% end %>
            <% if !update.complete? and (update.birthday.nil? or update.person.years_of_age.nil?) %>
              <tr>
                <td><%= t('people.child') %>:</td>
                <td></td>
                <td></td>
                <td>
                  <%= form.select :child, ['', [t('Answer_yes'), true], [t('Answer_no'), false]] %>
                </td>
              </tr>
            <% end %>
            <% if update.anniversary %>
              <tr>
                <td><%= t('privacies.anniversary') %>:</td>
                <td><%= update.person.anniversary && update.person.anniversary.to_s(:date) %></td>
                <td><div class="right-icon" style="width:10px;height:16px;"></td>
                <td>
                  <% unless update.anniversary.year == 1800 %>
                    <%= update.anniversary.to_s(:date) %>
                  <% end %>
                </td>
              </tr>
            <% end %>
            <% update.custom_fields_as_hash.each do |key, val| %>
              <% if val %>
                <tr>
                  <td><%= key %>:</td>
                  <td></td>
                  <td></td>
                  <td>
                    <%= val %>
                  </td>
                </tr>
              <% end %>
            <% end %>
            <tr>
              <td></td>
              <td colspan="3">
                <%= check_box_tag 'review', true, false %>
                <%= label_tag 'review', t('admin.updates.review_changes'), :class => 'inline' %><br/>
                <%= form.submit t('Update') %>
              </td>
            </tr>
          </table>
        <% end %>
      </td>
    </tr>
  <% end %>
</table>

<%= will_paginate @updates, :params => {:complete => params[:complete]} %>

<% if @updates.empty? %>
  <p><em><%= t('admin.updates.no_updates') %>!</em></p>
<% end %>

{'fraction_non_alphanumeric': 0.22958555601148953, 'fraction_numerical': 0.0069073998085077285, 'mean_word_length': 2.010086455331412, 'pattern_counts': {'":': 0, '<': 625, '<?xml version=': 0, '>': 671, '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': '4255992', 'n_tokens_mistral': 5091, 'n_tokens_neox': 4529, 'n_words': 780}