module Formol module PostsHelper 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 def link_to_last_fives_post_position(post, topic, index) idx = topic.posts_count - index return link_to "##{idx}", "#formol_post_#{post.id}" end def display_avatars?(user) return true unless user user.preference.display_avatars? end def display_signatures?(user, post) s = post.display_signature? && !post.user.preference.signature.blank? (s && user ? user.preference.display_signatures? : s) end end end