Module: Formol::PostsHelper
- Included in:
- TopicsHelper
- Defined in:
- app/helpers/formol/posts_helper.rb
Instance Method Summary collapse
- #display_avatars?(user) ⇒ Boolean
- #display_signatures?(user, post) ⇒ Boolean
- #link_to_last_fives_post_position(post, topic, index) ⇒ Object
- #link_to_post_position(post, index) ⇒ Object
Instance Method Details
#display_avatars?(user) ⇒ Boolean
15 16 17 18 19 |
# File 'app/helpers/formol/posts_helper.rb', line 15 def display_avatars?(user) return true unless user user.preference.display_avatars? end |
#display_signatures?(user, post) ⇒ Boolean
21 22 23 24 25 |
# File 'app/helpers/formol/posts_helper.rb', line 21 def display_signatures?(user, post) s = post.display_signature? && !post.user.preference.signature.blank? (s && user ? user.preference.display_signatures? : s) end |
#link_to_last_fives_post_position(post, topic, index) ⇒ Object
9 10 11 12 13 |
# File 'app/helpers/formol/posts_helper.rb', line 9 def link_to_last_fives_post_position(post, topic, index) idx = topic.posts_count - index return link_to "##{idx}", "#formol_post_#{post.id}" end |
#link_to_post_position(post, index) ⇒ Object
3 4 5 6 7 |
# File 'app/helpers/formol/posts_helper.rb', line 3 def link_to_post_position(post, index) idx = ((params[:page] || 1) - 1) * per_page + index + 1 return link_to "##{idx}", "#formol_post_#{post.id}" end |