Created
July 2, 2015 10:25
-
-
Save saravanak/e316346a641ed23f92d8 to your computer and use it in GitHub Desktop.
Partial for displaying the blog trend in Old Weaver site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table> | |
<% summary = year_by_month_summary %> | |
<% size = calculate_size(summary) %> | |
<tr> | |
<td> </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