Sha256: 89e11b1924f580203a5c09783f6c23ff7da0d2a15286a7c0a2198aec9aded381

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
formol-0.0.4 app/helpers/formol/posts_helper.rb