From 9c350b60e87a58e4fcf748fe3c9bc1baa5c04655 Mon Sep 17 00:00:00 2001 From: Evelyn Date: Sun, 20 Sep 2015 13:53:53 -0500 Subject: adding ability to disable/enable users by admin --- app/views/users/index.html.haml | 46 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'app/views') 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")}"} -- cgit v1.2.3 From 0af541e20e4343d20dd89cb73ef1d2f01f5c55f6 Mon Sep 17 00:00:00 2001 From: EvyW Date: Tue, 22 Sep 2015 15:39:29 -0500 Subject: commit user haml --- app/views/users/_user.html.haml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/users/_user.html.haml b/app/views/users/_user.html.haml index 583d22f..2d2f262 100644 --- a/app/views/users/_user.html.haml +++ b/app/views/users/_user.html.haml @@ -1,4 +1,32 @@ -%tr - %td= link_to user.login, user - %td= l(user.created_at, :format => :short) - %td= l(user.updated_at, :format => :short) + %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")}"} -- cgit v1.2.3 From 75338e097c964b4287cff7de9e142244f3681a14 Mon Sep 17 00:00:00 2001 From: EvyW Date: Tue, 22 Sep 2015 15:46:48 -0500 Subject: index changes --- app/views/users/index.html.haml | 47 ++--------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) (limited to 'app/views') diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml index 268c7d3..e1136d8 100644 --- a/app/views/users/index.html.haml +++ b/app/views/users/index.html.haml @@ -1,48 +1,5 @@ - @show_navigation = false = search :users -%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")}"} += table @users, %w(username, created, updated, actions.toggle_user) + -- cgit v1.2.3 From 289424bda4cabfa682e07059bfdc1a0c7f04c1ef Mon Sep 17 00:00:00 2001 From: EvyW Date: Mon, 28 Sep 2015 16:41:04 -0500 Subject: with out identing --- app/views/users/_user.html.haml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/views/users/_user.html.haml b/app/views/users/_user.html.haml index 2d2f262..c215a91 100644 --- a/app/views/users/_user.html.haml +++ b/app/views/users/_user.html.haml @@ -1,10 +1,7 @@ %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= 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"} -- cgit v1.2.3 From df62d292f5df6dffd8a0e621181632f276c0b304 Mon Sep 17 00:00:00 2001 From: EvyW Date: Thu, 1 Oct 2015 15:12:59 -0500 Subject: Identing first line --- app/views/users/_user.html.haml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/users/_user.html.haml b/app/views/users/_user.html.haml index c215a91..9deb596 100644 --- a/app/views/users/_user.html.haml +++ b/app/views/users/_user.html.haml @@ -1,7 +1,10 @@ - %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") +%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"} -- cgit v1.2.3 From 02c1e607bf8beb1f576307a7ad87f0cdbe3381c0 Mon Sep 17 00:00:00 2001 From: EvyW Date: Thu, 1 Oct 2015 17:15:35 -0500 Subject: identing 2 --- app/views/users/_user.html.haml | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'app/views') diff --git a/app/views/users/_user.html.haml b/app/views/users/_user.html.haml index 9deb596..1cabcf5 100644 --- a/app/views/users/_user.html.haml +++ b/app/views/users/_user.html.haml @@ -1,32 +1,32 @@ %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")}"} + %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")}"} -- cgit v1.2.3