added user privileges modal

This commit is contained in:
Georg G 2015-02-03 17:13:50 +01:00
parent a509b34524
commit 17f1c8f091
4 changed files with 43 additions and 1 deletions

View File

@ -28,3 +28,11 @@
%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

View File

@ -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

View File

@ -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

View File

@ -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'