Commit 871c6a7dd0de67215ca03a57106f7995be0a7c47
1 parent
2adc3c35
Exists in
master
and in
28 other branches
ActionItem918: fixed another test failing on etch
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/models/blog_archives_block.rb
... | ... | @@ -4,6 +4,7 @@ class BlogArchivesBlock < Block |
4 | 4 | include ActionView::Helpers::UrlHelper |
5 | 5 | include ActionController::UrlWriter |
6 | 6 | include ActionView::Helpers::AssetTagHelper |
7 | + include DatesHelper | |
7 | 8 | |
8 | 9 | def self.description |
9 | 10 | _('List posts of your blog') |
... | ... | @@ -20,7 +21,7 @@ class BlogArchivesBlock < Block |
20 | 21 | posts.group_by{|i| i.created_at.year}.each do |year, results_by_year| |
21 | 22 | results << content_tag('li', content_tag('strong', "#{year} (#{results_by_year.size})")) |
22 | 23 | results << "<ul class='#{year}-archive'>" |
23 | - results_by_year.group_by{|i| [i.created_at.strftime("%m"), i.created_at.strftime("%B")]}.sort.each do |month, results_by_month| | |
24 | + results_by_year.group_by{|i| [ ('%02d' % i.created_at.month()), gettext(MONTHS[i.created_at.month() - 1])]}.sort.each do |month, results_by_month| | |
24 | 25 | results << content_tag('li', link_to("#{month[1]} (#{results_by_month.size})", owner.generate_url(:controller => 'content_viewer', :action => 'view_page', :page => [owner.blog.path, year, month[0]]))) |
25 | 26 | end |
26 | 27 | results << "</ul>" | ... | ... |