<div>
  <h2>Statistics</h2>
  <table width="100%" class="user-statistics">
    <tbody>
      <tr>
        <th>Join Date</th>
        <td><%= presenter.join_date %></td>
      </tr>

      <tr>
        <th>Inviter</th>
        <td><%= presenter.inviter(self) %></td>
      </tr>

      <tr>
        <th>Level</th>
        <td><%= presenter.level %></td>
      </tr>

      <% if user.is_banned? %>
        <tr>
          <th>Ban reason</th>
          <td><%= format_text presenter.ban_reason %></td>
        </tr>
      <% end %>

      <tr>
        <th>Upload Limit</th>
        <td><%= presenter.upload_limit %></td>
      </tr>

      <tr>
        <th>Uploads</th>
        <td><%= presenter.upload_count(self) %></td>
      </tr>

      <tr>
        <th>Deleted Uploads</th>
        <td><%= presenter.deleted_upload_count(self) %></td>
      </tr>

      <tr>
        <th>Favorites</th>
        <td><%= presenter.favorite_count(self) %></td>
      </tr>

      <tr>
        <th>Post Changes</th>
        <td><%= presenter.post_version_count(self) %></td>
      </tr>

      <tr>
        <th>Note Changes</th>
        <td><%= presenter.note_version_count(self) %>
        <% if CurrentUser.user.id == user.id %>
          in <%= presenter.noted_posts_count(self) %> posts
        <% end %>
        </td>
      </tr>

      <tr>
        <th>Wiki Page Changes</th>
        <td><%= presenter.wiki_page_version_count(self) %></td>
      </tr>

      <tr>
        <th>Artist Changes</th>
        <td><%= presenter.artist_version_count(self) %></td>
      </tr>

      <tr>
        <th>Pool Changes</th>
        <td><%= presenter.pool_version_count(self) %></td>
      </tr>

      <tr>
        <th>Forum Posts</th>
        <td><%= presenter.forum_post_count(self) %></td>
      </tr>

      <tr>
        <th>Approvals</th>
        <td><%= presenter.approval_count(self) %></td>
      </tr>

      <tr>
        <th>Comments</th>
        <td><%= presenter.comment_count(self) %>
        <% if CurrentUser.user.id == user.id %>
          in <%= presenter.commented_posts_count(self) %> posts
        <% end %>
        </td>
      </tr>

      <tr>
        <th>Feedback</th>
        <td><%= presenter.feedbacks(self) %></td>    </tbody>
      </tr>

      <tr>
        <th>Subscriptions</th>
        <td>
          <% presenter.subscriptions.each do |subscription| %>
            <p>
              <strong><%= link_to subscription.pretty_name, posts_path(:tags => "sub:#{user.name}:#{subscription.name}") %></strong>
              &ndash;
              <%= presenter.tag_links_for_subscription(self, subscription) %>
            </p>
          <% end %>
        </td>
      </tr>
      
      <% if CurrentUser.user.is_janitor? && presenter.previous_names.present? %>
        <tr>
          <th>Previous Names</th>
          <td><%= presenter.previous_names %></td>
        </tr>
      <% end %>
      
      <% if CurrentUser.user.id == user.id %>
        <tr>
          <th>API Key</th>
          <td><%= CurrentUser.user.bcrypt_cookie_password_hash %></td>
        </tr>
      <% end %>
  </table>
</div>
