<% provide :title, t('.title') %>
<table width="100%" class="row-highlight">
  <thead>
    <tr>
      <th></th>
      <th width="5%"><%= t('.table.post') %></th>
      <th width="5%"><%= t('.table.note') %></th>
      <th width="60%"><%= t('.table.body') %></th>
      <th width="10%"><%= t('.table.edited') %></th>
      <th width="10%"><%= t('.table.date') %></th>
      <th width="10%"><%= t('.table.options') %></th>
    </tr>
  </thead>
  <tbody>
    <% @notes.each do |note| %>
      <tr class="<%= cycle 'even', 'odd' %>">
        <td style="background: <%= id_to_color(note.post_id) %>;"></td>
        <td><%= link_to note.post_id, :controller => "post", :action => "show", :id => note.post_id %></td>
        <td><%= link_to "#{note.note_id}.#{note.version}", :controller => "note", :action => "history", :id => note.note_id %></td>
        <td><%= h(note.body) %> <% unless note.is_active? %>(deleted)<% end %></td>
        <td><%= link_to h(note.author), :controller => "user", :action => "show", :id => note.user_id %></td>
        <td><%= note.updated_at.strftime("%D") %></td>
        <td><%= link_to t('.revert'), {:controller => "note", :action => "revert", :id => note.note_id, :version => note.version}, :method => :post, :confirm => t('.revert_confirm') %></td>
      </tr>
    <% end %>
  </tbody>
</table>

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

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