journalduhacker/app/views/tags/index.html.erb
2016-11-24 15:14:36 +01:00

14 lines
490 B
Plaintext

<div class="box wide">
<div class="legend">
<%= t '.tagstitle' %>
</div>
<% max_size = @tags.map{|t| t.stories_count }.max %>
<% @tags.each do |tag| %>
<% mod = (max_size.to_f / ((tag.stories_count.to_f == 0) ? 1 : tag.stories_count.to_f )) %>
<%= link_to tag.tag, tag_path(tag), :class => tag.css_class,
:style => "text-decoration: none; vertical-align: middle; " <<
"font-size: #{((52 / (mod + 1)) + 8).ceil}pt; line-height: 1.5em;" %>
<% end %>
</div>