<div id="c-tag-subscriptions">
  <div id="a-index">
    <h1>Tag Subscriptions</h1>
    <table class="striped" width="100%">
      <thead>
        <tr>
          <th>Name</th>
          <th>Tag Query</th>
          <th>Count</th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        <% @tag_subscriptions.each do |tag_subscription| %>
          <tr>
            <td><%= tag_subscription.pretty_name %></td>
            <td><%= tag_subscription.tag_query %></td>
            <td><%= tag_subscription.post_id_array.size %></td>
            <td>
              <%= link_to "edit", edit_tag_subscription_path(tag_subscription) %>
              | <%= link_to "delete", tag_subscription_path(tag_subscription), :method => :delete, :confirm => "Are you sure you want to delete this subscription?" %>
              | <%= link_to "posts", posts_path(:tags => "sub:#{tag_subscription.creator.name}:#{tag_subscription.name}") %>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>

    <p class="info">You can create up to <%= Danbooru.config.max_tag_subscriptions %> subscriptions with up to 20 tags each.</p>
  </div>
</div>

<%= render "secondary_links" %>

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