This commit is contained in:
Matt Rogers 2013-03-01 16:49:53 -06:00
commit 8b0f3e986a
9 changed files with 159 additions and 77 deletions

View file

@ -1,34 +1,19 @@
<div class="stats_module">
<h3><%= t('stats.tag_cloud_title') %></h3>
<p><%= t('stats.tag_cloud_description') %></p>
<p>
<% if @tags_for_cloud.size < 1
<h3><%= t("stats.tag_cloud#{key}_title") %></h3>
<p><%= t("stats.tag_cloud#{key}_description") %></p>
<p>
<%
if tag_cloud.empty?
t('stats.no_tags_available')
else
@tags_for_cloud.each do |t| %>
<%= link_to t.name, tag_path(t.name), {
:style => "font-size: " + (9 + 2*(t.count.to_i-@tags_min)/@tags_divisor).to_s + "pt",
:title => t.count.to_s+" #{t('common.actions_midsentence', :count => t.count)}"}
-%> <%
else
tag_cloud.tags.each do |t|
%><%=
link_to t.name, tag_path(t.name), {
:style => "font-size: " + "#{tag_cloud.font_size(t)}pt",
:title => "#{t.count} #{t('common.actions_midsentence', :count => t.count)}"}
-%><%
end
end
end-%>
-%>
</p>
</div>
<div class="stats_module">
<h3><%= t('stats.tag_cloud_90days_title') %></h3>
<p><%= t('stats.tag_cloud_90days_description') %></p>
<p>
<% if @tags_for_cloud_90days.size < 1
t('stats.no_tags_available')
else
@tags_for_cloud_90days.each do |t| %>
<%= link_to t.name, tag_path(t.name), {
:style => "font-size: " + (9 + 2*(t.count.to_i-@tags_min_90days)/@tags_divisor_90days).to_s + "pt",
:title => t.count.to_s+" #{t('common.actions_midsentence', :count => t.count)}"}
-%> <%
end
end-%>
</p>
</div>

View file

@ -15,7 +15,8 @@
<%= render :partial => 'projects' -%>
<h2><%= t('stats.tags') %></h2>
<%= render :partial => 'tags' -%>
<%= render :partial => 'tags', :locals => {:tag_cloud => @tag_cloud, :key => ''} -%>
<%= render :partial => 'tags', :locals => {:tag_cloud => @tag_cloud_90days, :key => '_90days'} -%>
<% else -%>
@ -23,4 +24,4 @@
<% end -%>
</div>
</div>