Commit dee13924f2b376a2070925e0d9286b69b07e6040

Authored by Rodrigo Souto
1 parent ba61c659

[macro-support-review] Creating display_number_of_comments back again

Showing 1 changed file with 5 additions and 2 deletions   Show diff stats
app/helpers/content_viewer_helper.rb
@@ -3,13 +3,16 @@ module ContentViewerHelper @@ -3,13 +3,16 @@ module ContentViewerHelper
3 include BlogHelper 3 include BlogHelper
4 include ForumHelper 4 include ForumHelper
5 5
6 - def number_of_comments(article)  
7 - n = article.comments.without_spam.count 6 + def display_number_of_comments(n)
8 base_str = "<span class='comment-count hide'>#{n}</span>" 7 base_str = "<span class='comment-count hide'>#{n}</span>"
9 amount_str = n == 0 ? _('no comments yet') : (n == 1 ? _('One comment') : _('%s comments') % n) 8 amount_str = n == 0 ? _('no comments yet') : (n == 1 ? _('One comment') : _('%s comments') % n)
10 base_str + "<span class='comment-count-write-out'>#{amount_str}</span>" 9 base_str + "<span class='comment-count-write-out'>#{amount_str}</span>"
11 end 10 end
12 11
  12 + def number_of_comments(article)
  13 + display_number_of_comments(article.comments.without_spam.count)
  14 + end
  15 +
13 def article_title(article, args = {}) 16 def article_title(article, args = {})
14 title = article.display_title if article.kind_of?(UploadedFile) && article.image? 17 title = article.display_title if article.kind_of?(UploadedFile) && article.image?
15 title = article.title if title.blank? 18 title = article.title if title.blank?