Module: Pageflow::Admin::UsersHelper
- Includes:
- QuotaHelper
- Defined in:
- app/helpers/pageflow/admin/users_helper.rb
Instance Method Summary collapse
- #collection_for_user_roles ⇒ Object
- #delete_own_user_section ⇒ Object
- #users_quota_state(account) ⇒ Object
Methods included from QuotaHelper
Instance Method Details
#collection_for_user_roles ⇒ Object
19 20 21 |
# File 'app/helpers/pageflow/admin/users_helper.rb', line 19 def collection_for_user_roles User.roles_accessible_by(current_ability).index_by { |role| t(role, :scope => 'pageflow.admin.users.roles') } end |
#delete_own_user_section ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/helpers/pageflow/admin/users_helper.rb', line 23 def delete_own_user_section = Pageflow.config..call(current_user) if == true render('pageflow/admin/users/may_delete') else render('pageflow/admin/users/cannot_delete', reason: ) end end |
#users_quota_state(account) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/helpers/pageflow/admin/users_helper.rb', line 6 def users_quota_state(account) quota = Pageflow.config.quotas.get(:users, account) data_attributes = { account_id: account.id, state: quota.state } render('pageflow/admin/users/quota_state', account: account, quota: quota, data_attributes: data_attributes) end |