<div id="user-record">
  <h4><%=t :record_record %></h4>

  <table width="100%" class="highlightable" id="history">
    <thead>
      <tr>
        <th></th>
        <th><%=t :record_user %></th>
        <th><%=t :record_reporter %></th>
        <th><%=t :record_when %></th>
        <th><%=t :record_body %></th>
        <th><%=t :record_action %></th>
      </tr>
    </thead>
    <tbody>
      <% @user_records.each do |rec| %>
        <tr class="<%= cycle 'even', 'odd' %>" id="record-<%= rec.id %>">
          <td style="background: <%= rec.is_positive? ? '#3465a4' : '#cc0000' %>;"><td>
            <% if @user %>
              <%= link_to h(rec.user.pretty_name), :controller => "user", :action => "show", :id => rec.user_id %>
            <% else %>
              <%= link_to h(rec.user.pretty_name), :action => "index", :user_id => rec.user_id %>
            <% end %>
          </td>
          <td><%= h(rec.reporter.pretty_name) %></td>
          <td><%= t('time.x_ago', :t => time_ago_in_words(rec.created_at)) %></td>
          <td class="change"><%= format_text(rec.body) %></td>
          <td>
            <% if @current_user.is_mod_or_higher? || @current_user.id == rec.reported_by %>
              <%= link_to t(:record_delete), "#", :class => "js-user-record-destroy", :data => { :id => rec.id } %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <div id="paginator">
    <%= will_paginate(@user_records) %>
  </div>

  <%= render :partial => "footer" %>
</div>
