osem-fcy/app/views/admin/users/index.html.haml

78 lines
2.6 KiB
Text
Raw Normal View History

.row
.col-md-12
%h2
Users
- if @users
= "(#{@users.length})"
2014-06-23 19:07:50 +03:00
2014-07-18 07:08:06 +03:00
= link_to "New User", new_admin_user_path, class: 'btn btn-success pull-right'
.well
%table.table.table-striped.table-bordered.table-hover#users
%thead
%th
%b ID
%th
%b State
%th
%b Email
%th
2014-06-23 19:07:50 +03:00
%b Name
%th
2014-06-23 19:07:50 +03:00
%b # of Conference Registrations
%th
%b Roles
%th
%th
%th
- @users.each do |user|
%tr
%td
= user.id
%td
- if user.confirmed?
confirmed
- else
unconfirmed
%td
= user.email
%td
2014-06-23 19:07:50 +03:00
= user.name
%td
2014-06-23 19:07:50 +03:00
= user.registrations.count
%td
2014-05-15 17:47:34 +05:30
.modal.fade{:id => "user-role-selection-#{user.id}", "role" => "dialog", "aria-hidden" => "true"}
.modal-dialog
.modal-content
.modal-header
%button{"type"=>"button", :class=>"close", "data-dismiss"=>"modal", "aria-hidden"=>"true"}
×
%h3{:id => "role-selector-header-#{user.id}"}
Modifying Roles
.modal-body
2014-07-18 14:43:49 +03:00
= render partial: 'roles', locals: { user: user }
2014-07-18 07:08:06 +03:00
- if can? :update, Role
=link_to "#{user.roles.map { |role| role.name }.join ', '}", "#", "data-toggle" => "modal", "data-target" => "#user-role-selection-#{user.id}",id: "user-modify-role-#{user.id}"
2014-06-23 19:07:50 +03:00
- else
2014-07-18 07:08:06 +03:00
= user.roles.map { |role| role.name }.join ', '
- if can? :update, user
%td
= link_to "Edit", edit_admin_user_path(user)
- if can? :show, user
%td
= link_to "View", admin_user_path(user)
- if can? :destroy, user
%td
- if current_user.id == user.id or user.role_ids.include? 3
=link_to 'Delete',admin_user_path(user), :method => :delete , :data => {:confirm => 'Are you sure ?'}, :disabled => true,:class => "btn btn-primary disabled btn-danger",:role => "button"
- else
=link_to 'Delete',admin_user_path(user), :method=> :delete , :data=> {:confirm => 'Are you sure ?'},:class => "btn btn-primary btn-danger"
2013-01-07 09:04:09 +01:00
:javascript
$(document).ready(function() {
$('#users').dataTable( {
"bPaginate": false,
"bLengthChange": false
} );
} );