<div id="c-reports">
  <div id="a-similar-users">
    <h1>Similar Users</h1>

    <% if @presenter.insufficient_data? %>
      <p>You need at least 200 favorites before Danbooru can calculate users similar to you.</p>

    <% elsif @presenter.not_ready? %>
      <p>The report is being generated. Check back in a few minutes.</p>

    <% else %>
      <% @presenter.each_user do |user, score| %>
        <div class="box">
          <h2><%= link_to user.pretty_name, user_path(user) %> <span class="accuracy">(<%= number_to_percentage score, :precision => 2 %>)</span></h2>
          <div>
            <% @presenter.each_favorite_for(user) do |post| %>
              <%= PostPresenter.preview(post, :tags => "fav:#{user.name}") %>
            <% end %>
          </div>
        </div>
      <% end %>
    <% end %>
  </div>
</div>

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

<% if @presenter.not_ready? %>
  <% content_for(:html_header) do %> 
    <meta http-equiv="refresh" content="60">
  <% end %>
<% end %>
