added user privileges modal
This commit is contained in:
parent
a509b34524
commit
17f1c8f091
|
@ -27,4 +27,12 @@
|
||||||
%li
|
%li
|
||||||
%a{href: '#', data: { action: 'report-user', target: user.screen_name }}
|
%a{href: '#', data: { action: 'report-user', target: user.screen_name }}
|
||||||
%i.fa.fa-exclamation-triangle
|
%i.fa.fa-exclamation-triangle
|
||||||
Report
|
Report
|
||||||
|
- if current_user.mod?
|
||||||
|
%li
|
||||||
|
%a{href: '#', data: { target: "#modal-privileges", toggle: :modal }}
|
||||||
|
%i.fa.fa-paw
|
||||||
|
Check
|
||||||
|
= succeed "'s" do
|
||||||
|
= user.screen_name
|
||||||
|
privileges
|
|
@ -0,0 +1,23 @@
|
||||||
|
#modal-privileges.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-privileges-label", :role => "dialog", :tabindex => "-1"}
|
||||||
|
.modal-dialog
|
||||||
|
.modal-content
|
||||||
|
.modal-header
|
||||||
|
%button.close{"data-dismiss" => "modal", :type => "button"}
|
||||||
|
%span{"aria-hidden" => "true"} ×
|
||||||
|
%span.sr-only Close
|
||||||
|
%h4#modal-privileges-label.modal-title
|
||||||
|
Check
|
||||||
|
= succeed "'s" do
|
||||||
|
= @user.screen_name
|
||||||
|
privileges
|
||||||
|
.modal-body
|
||||||
|
%ul.list-group.groups--list
|
||||||
|
- unless @user.admin?
|
||||||
|
= render 'user/modal_privileges_item', privilege: 'banned', description: 'Hit the user with ye olde banhammer', user: @user
|
||||||
|
= render 'user/modal_privileges_item', privilege: 'blogger', description: 'The user gets that privilege if they blogged something (nice) about Retrospring.', user: @user
|
||||||
|
- if current_user.admin?
|
||||||
|
= render 'user/modal_privileges_item', privilege: 'supporter', description: 'oy vey muh shekels', user: @user
|
||||||
|
= render 'user/modal_privileges_item', privilege: 'moderator', user: @user
|
||||||
|
= render 'user/modal_privileges_item', privilege: 'admin', user: @user
|
||||||
|
.modal-footer
|
||||||
|
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }} Done
|
|
@ -0,0 +1,9 @@
|
||||||
|
- description ||= ''
|
||||||
|
%li.list-group-item{id: "privilege-#{privilege}"}
|
||||||
|
.media
|
||||||
|
.pull-left.j2-table
|
||||||
|
%input.input--center{type: :checkbox, name: 'check-your-privileges', data: { type: privilege, user: user.screen_name }, checked: user.send("#{privilege}?"), autocomplete: 'off'}
|
||||||
|
.media-body
|
||||||
|
.list-group-item-heading= privilege.capitalize
|
||||||
|
- unless description.blank?
|
||||||
|
.list-group-item-text.text-muted.j2-up= description
|
|
@ -17,3 +17,5 @@
|
||||||
.visible-xs= render 'shared/links'
|
.visible-xs= render 'shared/links'
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
= render 'user/modal_group_memberships'
|
= render 'user/modal_group_memberships'
|
||||||
|
- if current_user.mod? and @user != current_user
|
||||||
|
= render 'user/modal_privileges'
|
Loading…
Reference in New Issue