Skip to content

Commit

Permalink
Uses I18n.localize instead of strftime for posts#archives title and n…
Browse files Browse the repository at this point in the history
…o_articles message
  • Loading branch information
jerefrer committed May 11, 2013
1 parent 8a41b59 commit fdfb316
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions app/controllers/refinery/blog/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ def comment
def archive
if params[:month].present?
date = "#{params[:month]}/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%B %Y')
@posts = Post.live.by_month(@archive_date).page(params[:page])
archive_date = Time.parse(date)
@date_title = ::I18n.l(archive_date, :format => '%B %Y')
@posts = Post.live.by_month(archive_date).page(params[:page])
else
date = "01/#{params[:year]}"
@archive_date = Time.parse(date)
@date_title = @archive_date.strftime('%Y')
@posts = Post.live.by_year(@archive_date).page(params[:page])
archive_date = Time.parse(date)
@date_title = ::I18n.l(archive_date, :format => '%Y')
@posts = Post.live.by_year(archive_date).page(params[:page])
end
respond_with (@posts)
end
Expand Down
6 changes: 3 additions & 3 deletions app/views/refinery/blog/posts/archive.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% content_for :title, "#{t('.blog_archive_for', :date => @archive_date.strftime('%B %Y'))}" %>
<% content_for :title, "#{t('.blog_archive_for', :date => @date_title)}" %>
<% content_for :body do %>
<h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1>
<h1><%= t('.blog_archive_for', :date => @date_title) %></h1>
<% if @posts.any? %>
<section id="blog_posts">
<%= render :partial => "/refinery/blog/shared/post", :collection => @posts %>
</section>
<% else %>
<p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p>
<p><%= t('.no_blog_articles_posted', :date => @date_title) %></p>
<% end %>
<% end %>
Expand Down

0 comments on commit fdfb316

Please sign in to comment.