Guest User

Untitled

a guest
Feb 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. Index: app/models/article.rb
  2. ===================================================================
  3. --- app/models/article.rb (revision 1241)
  4. +++ app/models/article.rb (working copy)
  5. @@ -104,6 +104,7 @@
  6. 'title' => title,
  7. 'permalink' => permalink,
  8. 'url' => full_permalink,
  9. + 'has_excerpt' => !excerpt.blank?,
  10. 'body' => body_for_mode(mode),
  11. 'published_at' => published_at,
  12. 'comments_count' => comments_count,
  13. Index: lib/mephisto/liquid/filters.rb
  14. ===================================================================
  15. --- lib/mephisto/liquid/filters.rb (revision 1241)
  16. +++ lib/mephisto/liquid/filters.rb (working copy)
  17. @@ -12,7 +12,12 @@
  18. end
  19.  
  20. def link_to_comments(article)
  21. - content_tag :a, pluralize(article['comments_count'], 'comment'), :href => article['url']
  22. + comment_text = pluralize(article['comments_count'], 'comment')
  23. + link_text = article['has_excerpt'] ?
  24. + "Read more... (#{comment_text})" :
  25. + comment_text
  26. +
  27. + content_tag :a, link_text, :href => article['url']
  28. end
  29.  
  30. def escape_html(html)
Add Comment
Please, Sign In to add comment