Sha256: baef733eb1cd7014ab16df75607d0cb4641fd5194e5cafd36521901fec8529d4

Contents?: true

Size: 704 Bytes

Versions: 10

Compression:

Stored size: 704 Bytes

Contents

module Chaltron::UsersHelper
  def display_username(user)
    if user == current_user
      link_to(user.username, user) + '&nbsp'.html_safe +
        content_tag(:span, I18n.t('chaltron.users.it_s_you'), class: 'badge badge-success')
    else
      link_to user.username, user
    end
  end

  def display_side_filter_link(url, active, text, count)

    klass = 'list-group-item list-group-item-action'
    klass += ' active' if active

    badge_klass = 'badge badge-pill float-right'
    if active
      badge_klass += ' badge-light'
    else
      badge_klass += ' badge-primary'
    end

    link_to url, class: klass do
      content_tag(:span, count, class: badge_klass) + text
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chaltron-1.0.9 app/helpers/chaltron/users_helper.rb
chaltron-1.0.8 app/helpers/chaltron/users_helper.rb
chaltron-1.0.7 app/helpers/chaltron/users_helper.rb
chaltron-1.0.6 app/helpers/chaltron/users_helper.rb
chaltron-1.0.5 app/helpers/chaltron/users_helper.rb
chaltron-1.0.4 app/helpers/chaltron/users_helper.rb
chaltron-1.0.3 app/helpers/chaltron/users_helper.rb
chaltron-1.0.2 app/helpers/chaltron/users_helper.rb
chaltron-1.0.1 app/helpers/chaltron/users_helper.rb
chaltron-1.0.0 app/helpers/chaltron/users_helper.rb