Skip to content

Instantly share code, notes, and snippets.

@saravanak
Created July 2, 2015 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saravanak/e316346a641ed23f92d8 to your computer and use it in GitHub Desktop.
Save saravanak/e316346a641ed23f92d8 to your computer and use it in GitHub Desktop.
Partial for displaying the blog trend in Old Weaver site
<table>
<% summary = year_by_month_summary %>
<% size = calculate_size(summary) %>
<tr>
<td>&nbsp; </td>
<% (1..12).to_a.each do |month|%>
<td> <%= Date::ABBR_MONTHNAMES[month] %></td>
<%end%>
</tr>
<% summary.each do |year, year_articles|%>
<tr>
<td> <%= year %> </td>
<% (1..12).to_a.each do |month|%>
<td
style="
background-color:
<%= bg_color_for(year_articles, month, size.to_f) %> ;
width:10px; height:10px "
title=" <%= title_for(year_articles, month) %> " >
<% if(year_articles.has_key?(month)) %>
<% global_summary(year_articles[month], month, year) %>
<%= link_to "#{year_articles[month].size}",
"/summary/#{month}/#{year}.html"
%>
<% end %>
</td>
<% end %>
</tr>
<% end %>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment