<div id="forum">
  <div style="margin-bottom: 1em;">
    <%= form_tag({:action => "search"}, :method => :get) do %>
      <%= text_field_tag "query", params[:query], :size => 40 %>
      <%= submit_tag t('.submit')%>
    <% end %>
  </div>

  <table class="highlightable" style="width: 50em">
    <thead>
      <tr>
        <th width="10%"><%= t('.post') %></th>
        <th width="60%"><%= t('.message') %></th>
        <th width="15%"><%= t('.author') %></th>
        <th width="15%"><%= t('.time') %></th>
      </tr>
    </thead>
    <tbody>
      <% @comments.each do |comment| %>
        <%= content_tag :tr, :class => cycle('even', 'odd') do %>
          <td><%= link_to("##{comment.post_id}", :controller => "post", :action => "show", :id => comment.post_id) %></td>
          <td><%= link_to(h(comment.body[0, 70]) + "...", :controller => "post", :action => "show", :id => comment.post_id, :anchor => "c#{comment.id}") %></td>
          <td>
            <% if comment.user_id %>
              <a href="/user/show/<%= comment.user_id %>"><%= h comment.pretty_author %></a>
            <% else %>
              <%= h comment.pretty_author %>
            <% end %>
          </td>

          <td><%= t('time.x_ago', :t => time_ago_in_words(comment.created_at)) %></td>
        <% end %>
      <% end %>
    </tbody>
  </table>

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

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