<div id="forum">
  <h2>Your forum subscriptions</h2>

  <%= render 'forums/menu' %>

  <% if current_user and current_user.email_unverified? %>
    <p>You won't receive notifications, until you <%= link_to 'verify your email', account_personal_details_path %>.</p>
  <% end -%>

  <% unless @user_topics.empty? %>
  <table  cellspacing="0">
    <thead>
      <tr>
        <th>Thread</th>
        <th class="posts">Posts</th>
        <th>Subscribed since</th>
        <th>&nbsp;</th>
      </tr>
    </thead>
    <tbody>
      <% for user_topic in @user_topics %>
      <tr>
	<td class="topic">
	  <%= link_to h(user_topic.topic.title), forum_topic_path(user_topic.topic) %>
	</td>
	<td class="posts"><%= user_topic.topic.posts.size %></td>
	<td>
	  <%= user_topic.topic.last_updated_at.strftime("%d %b, %Y %I:%M%p") %>
	</td>

	<td>
	  <%= link_to 'Unsubscribe', forum_subscription_path(user_topic.topic.id), :method => :delete %>
	</td>
      </tr>
      <% end %>
      <tr><td colspan="8"><%= will_paginate @user_topics %></td></tr>
    </tbody>
  </table>
  <%- end -%>

  <%- if @user_topics.empty? -%>
  <p>You are currently subscribed to no threads.</p>
  <%- end -%>
</div>
