journalduhacker/app/views/hats/index.html.erb
2017-05-19 13:32:21 +02:00

43 lines
1.1 KiB
Plaintext

<div class="box wide">
<% if @user %>
<div class="legend right">
<a href="<%= request_hat_url %>"><%= t('.request') %></a>
</div>
<% end %>
<div class="legend">
<%= t('.title') %>
</div>
<p>
<%= t('.description') %>
</p>
<table class="data" width="100%" cellspacing=0>
<tr>
<th style="width: 130px;"><%= t('.user') %></th>
<th><%= t('.hat') %></th>
<th><%= t('.link') %></th>
</tr>
<% bit = 0 %>
<% @hat_groups.keys.sort_by{|a| a.downcase }.each do |hg| %>
<% @hat_groups[hg].sort_by{|hh| hh.user.username.downcase }.each do |hh| %>
<tr class="row<%= bit %>">
<td><a href="/u/<%= hh.user.username %>"><%= hh.user.username
%></a></td>
<td><%= hh.to_html_label %></td>
<td>
<% if hh.link.to_s.match(/^http/) %>
<a href="<%= hh.link %>" rel="nofollow"><%= hh.link %></a>
<% elsif hh.link.blank? %>
<span class="na">None</span>
<% else %>
<%= hh.link %>
<% end %>
</td>
</tr>
<% bit = (bit == 1 ? 0 : 1) %>
<% end %>
<% end %>
</table>
</div>