<h4><%=t :report_votes %></h4>

<div>
  <p><%=t :report_votes_text %></p>

  <div style="float: left; width: 200px;">
    <table width="100%">
      <thead>
        <tr>
          <th><%=t :report_user %></th>
          <th><%=t :report_total %></th>
          <th><%=t :report_votes2 %></th>
        </tr>
      </thead>
      <tbody>
        <% @users.each do |user| %>
          <tr class="<%= cycle 'even', 'odd' %>">
            <td><%= link_to_unless user['id'].nil?, user['name'], :controller => 'user', :action => 'show', :id => user['id'] %></td>
            <td><%= link_to_unless user['id'].nil?, user['change_count'], :controller => 'post', :action => 'index', :tags => "vote:>=1:#{user['name']} order:vote" %></td>
            <td>
              <span class="stars" style="white-space: nowrap">
                <% (1..3).each do |vote| %>
                    <% count = (user['votes'] && user['votes'][vote]) || '0' %>
                    <% text = capture do %>
                      <%= count %>
                      <span class='score-on score-voted score-visible'>★</span>
                    <% end %>
                    <% if user['id'].nil? %>
                      <%= content_tag :span, text, class: 'star', data: { star: vote } %>
                    <% else %>
                      <%= link_to text,
                        { controller: 'post', action: 'index', tags: "vote:>=#{vote}:#{user['name']} order:vote" },
                        { class: 'star', data: { star: vote } }
                      %>
                    <% end %>
                <% end %>
              <span>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>
