Sha256: ab4154b310ff262f124e96e49209093abe119031d9d722b42e116ec562998e79

Contents?: true

Size: 725 Bytes

Versions: 9

Compression:

Stored size: 725 Bytes

Contents

module MyForum
  module UsersHelper
    # Display title name dependent user posts count
    def user_title(user)
      #TODO
      t('.beginner')
    end

    # Display user avatar
    def user_avatar(user)
      return image_tag(user.avatar_url, class: 'user-avatar') unless user.avatar_url.blank?

      image_tag('blank_avatar.png', class: 'user-avatar')
    end

    def user_posts_count(user)
      user.posts_count
    end

    def is_online_user?(user_login)
      User.online.pluck(:login).include?(user_login)
    end

    def online_user_marker(user_login)
      return unless User.online.pluck(:login).include?(user_login)
      content_tag :div, ' '.html_safe, class: 'label label-success'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
my_forum-0.0.1.beta37 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta36 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta35 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta34 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta33 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta32 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta31 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta30 app/helpers/my_forum/users_helper.rb
my_forum-0.0.1.beta29 app/helpers/my_forum/users_helper.rb