<div id="c-advertisements">
  <div id="c-index">
    <h1>Advertisements</h1>

    <table width="100%" class="highlightable">
      <thead>
        <tr>
          <th width="5%"></th>
          <th width="5%" style="text-align: right;">Hits</th>
          <th width="90%"></th>
        </tr>
      </thead>
      <tbody>
        <% @advertisements.each do |advertisement| %>
          <tr>
            <td><%= image_tag(advertisement.image_url, :width => advertisement.preview_width, :height => advertisement.preview_height) %></td>
            <td style="text-align: right;"><%= advertisement.hits.between(@start_date, @end_date).count %></td>
            <td><%= link_to "Edit", edit_advertisement_path(advertisement) %></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>

<%= render "secondary_links" %>

<% content_for(:page_title) do %>
  Advertisements - <%= Danbooru.config.app_name %>
<% end %>
