Module: Admin::UsersHelper
- Defined in:
- app/helpers/admin/users_helper.rb
Overview
Copyright © 2008-2013 Michael Dvorkin and contributors.
Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php
Instance Method Summary collapse
-
#link_to_confirm(user) ⇒ Object
—————————————————————————-.
-
#link_to_reactivate(user) ⇒ Object
—————————————————————————-.
- #link_to_suspend(user) ⇒ Object
-
#user_summary(user) ⇒ Object
User summary info for RSS/ATOM feeds.
Instance Method Details
#link_to_confirm(user) ⇒ Object
20 21 22 |
# File 'app/helpers/admin/users_helper.rb', line 20 def link_to_confirm(user) link_to(t(:delete) + "?", confirm_admin_user_path(user), method: :get, remote: true) end |
#link_to_reactivate(user) ⇒ Object
14 15 16 17 |
# File 'app/helpers/admin/users_helper.rb', line 14 def link_to_reactivate(user) name = user.awaits_approval? ? t(:approve) + "!" : t(:reactivate) + "!" link_to(name, reactivate_admin_user_path(user), method: :put, remote: true) end |
#link_to_suspend(user) ⇒ Object
9 10 11 |
# File 'app/helpers/admin/users_helper.rb', line 9 def link_to_suspend(user) link_to(t(:suspend) + "!", suspend_admin_user_path(user), method: :put, remote: true) end |
#user_summary(user) ⇒ Object
User summary info for RSS/ATOM feeds.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/helpers/admin/users_helper.rb', line 26 def user_summary(user) summary = [] title_and_company = user_summary_title_and_company(user) summary << title_and_company unless title_and_company.blank? summary << t('pluralize.login', user.sign_in_count) if user.last_sign_in_at && user.sign_in_count.positive? summary << user.email summary << "#{t :phone_small}: #{user.phone}" unless user.phone.blank? summary << "#{t :mobile_small}: #{user.mobile}" unless user.mobile.blank? summary << user_summary_created_at(user) summary << user_summary_status(user) summary.join(', ') end |