2015-02-03 08:13:50 -08:00
|
|
|
- description ||= ''
|
2020-04-19 13:35:58 -07:00
|
|
|
- role_mapping = {"admin" => "administrator"}
|
|
|
|
- requires_role = %w[admin moderator].include?(privilege)
|
|
|
|
- checked = requires_role ? user.has_role?(role_mapping.fetch(privilege, privilege).to_sym) : user.public_send("#{privilege}?")
|
2015-02-03 08:13:50 -08:00
|
|
|
%li.list-group-item{id: "privilege-#{privilege}"}
|
|
|
|
.media
|
|
|
|
.pull-left.j2-table
|
2020-04-19 13:35:58 -07:00
|
|
|
%input.input--center{type: :checkbox, name: 'check-your-privileges', data: { type: privilege, user: user.screen_name }, checked: checked, autocomplete: 'off'}
|
2015-02-03 08:13:50 -08:00
|
|
|
.media-body
|
|
|
|
.list-group-item-heading= privilege.capitalize
|
|
|
|
- unless description.blank?
|
2015-04-19 13:38:10 -07:00
|
|
|
.list-group-item-text.text-muted= description
|