journalduhacker/app/views/tags/index.html.erb
joshua stein 09fd14dd93 add a tag cloud thingy
closes #236
2015-11-09 09:52:32 -06:00

14 lines
434 B
Plaintext

<div class="box wide">
<div class="legend">
Tags
</div>
<% max_size = @tags.map{|t| t.stories_count }.max %>
<% @tags.each do |tag| %>
<% mod = (max_size.to_f / 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>