summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorEvelyn <evy_mcr@outlook.com>2015-09-20 13:53:53 -0500
committerEvelyn <evy_mcr@outlook.com>2015-09-20 13:53:53 -0500
commit9c350b60e87a58e4fcf748fe3c9bc1baa5c04655 (patch)
treec4fd007e20381daa16ce57ee4f4fcdc8fb8dca2e /app/views
parent3e8771097ab7392560fdf07a85c011c23098fd1e (diff)
adding ability to disable/enable users by admin
Diffstat (limited to 'app/views')
-rw-r--r--app/views/users/index.html.haml46
1 files changed, 45 insertions, 1 deletions
diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml
index 3ed8835..268c7d3 100644
--- a/app/views/users/index.html.haml
+++ b/app/views/users/index.html.haml
@@ -1,4 +1,48 @@
- @show_navigation = false
= search :users
-= table @users, %w(username, created, updated)
+%table.table.table-striped.table-bordered
+ %thead
+ %tr
+ %th
+ = t(:username)
+ %th
+ = t(:created)
+ %th
+ = t(:updated)
+ %th
+ = t("actions.toggle_user")
+ %tbody
+ - @users.each do |user|
+ %tr
+ %td
+ = link_to user.username, user
+ %td
+ = user.created_at.strftime("%d %b, %Y, %H:%M")
+ %td
+ = user.updated_at.strftime("%d %b, %Y, %H:%M")
+ %td
+ - if user.enabled
+ %button.btn.btn-default{:"data-toggle" => "modal", :"data-target" => "#user-form-#{user.id}", :type => "button"}
+ = t("actions.disable_user")
+ .modal.fade.hide{:id => "user-form-#{user.id}"}
+ .modal-dialog
+ .modal-content
+ .modal-header
+ %button.close{:"data-dismiss" => "modal"} ×
+ = t("actions.confirm_user_deactivation", username: user.username)
+ .modal-footer
+ = form_tag deactivate_user_path(user) do
+ %input.btn.btn-default.btn-danger{:type => "submit", :value => "#{t("actions.disable_user")}"}
+ - else
+ %button.btn.btn-default{:"data-toggle" => "modal", :"data-target" => "#user-form-#{user.id}", :type => "button"}
+ = t("actions.enable_user")
+ .modal.fade.hide{:id => "user-form-#{user.id}"}
+ .modal-dialog
+ .modal-content
+ .modal-header
+ %button.close{:"data-dismiss" => "modal"} ×
+ = t("actions.confirm_user_activation", username: user.username)
+ .modal-footer
+ = form_tag enable_user_path(user) do
+ %input.btn.btn-default.btn-danger{:type => "submit", :value => "#{t("actions.enable_user")}"}