users_helper.rb 460 B

12345678910111213
  1. module UsersHelper
  2. def user_account_state(user)
  3. if !user.active?
  4. content_tag :span, 'inactive', class: 'label label-danger'
  5. elsif user.access_locked?
  6. content_tag :span, 'locked', class: 'label label-danger'
  7. elsif ENV['REQUIRE_CONFIRMED_EMAIL'] == 'true' && !user.confirmed?
  8. content_tag :span, 'unconfirmed', class: 'label label-warning'
  9. else
  10. content_tag :span, 'active', class: 'label label-success'
  11. end
  12. end
  13. end