summaryrefslogtreecommitdiff
path: root/users/app
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-07-09 10:35:14 -0700
committerjessib <jessib@leap.se>2013-07-09 10:35:14 -0700
commita40a83cb07d9aba8915cd2c4a25aa76e0cf6760e (patch)
treea45ed7076a96ddb1601cf9a2e44ae37160f90319 /users/app
parentfc3c5994df61de04b8b17b495a638efc0d760126 (diff)
Cleanup to show enable/deactivate account functionality in new UI.
Diffstat (limited to 'users/app')
-rw-r--r--users/app/views/overviews/show.html.haml3
-rw-r--r--users/app/views/users/_deactivate_account.html.haml6
-rw-r--r--users/app/views/users/_edit.html.haml19
-rw-r--r--users/app/views/users/_enable_account.html.haml6
4 files changed, 17 insertions, 17 deletions
diff --git a/users/app/views/overviews/show.html.haml b/users/app/views/overviews/show.html.haml
index b8ad814..898cfa0 100644
--- a/users/app/views/overviews/show.html.haml
+++ b/users/app/views/overviews/show.html.haml
@@ -9,6 +9,9 @@
%br
= t(:updated)
= @user.updated_at
+ %br
+ = t(:enabled)
+ = @user.enabled?
%p= t(:overview_intro)
diff --git a/users/app/views/users/_deactivate_account.html.haml b/users/app/views/users/_deactivate_account.html.haml
deleted file mode 100644
index fec0afa..0000000
--- a/users/app/views/users/_deactivate_account.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%legend
- =t :deactivate_account
- %small=t :deactivate_description
-= link_to deactivate_user_path(@user), :method => :post, :class => "btn" do
- %i.icon-remove.icon-white
- =t :deactivate_account \ No newline at end of file
diff --git a/users/app/views/users/_edit.html.haml b/users/app/views/users/_edit.html.haml
index 41a68fd..0402f37 100644
--- a/users/app/views/users/_edit.html.haml
+++ b/users/app/views/users/_edit.html.haml
@@ -35,8 +35,17 @@
= link_to user_path(@user), :method => :delete, :confirm => t(:are_you_sure), :class => "btn btn-danger" do
%i.icon-remove.icon-white
= t(:destroy_my_account)
-
-- # TODO: should show enabled field if admin is viewing another account.
-- # TODO: admins should be able to deactivate/enable regular accounts, as appropriate. before had:
-- # = render 'deactivate_account' if @user != current_user and @user.enabled?
-- # = render 'enable_account' if @user != current_user and !@user.enabled? \ No newline at end of file
+- if @user != current_user and @user.enabled?
+ %legend
+ = t(:deactivate_account, :username => @user.login)
+ %p= t(:deactivate_description)
+ = link_to deactivate_user_path(@user), :method => :post, :class => "btn btn-warning" do
+ %i.icon-pause.icon-white
+ = t(:deactivate)
+- elsif @user != current_user and !@user.enabled?
+ %legend
+ = t(:enable_account, :username => @user.login)
+ %p= t(:enable_description)
+ = link_to enable_user_path(@user), :method => :post, :class => "btn btn-warning" do
+ %i.icon-ok.icon-white
+ = t(:enable) \ No newline at end of file
diff --git a/users/app/views/users/_enable_account.html.haml b/users/app/views/users/_enable_account.html.haml
deleted file mode 100644
index 5ecca48..0000000
--- a/users/app/views/users/_enable_account.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%legend
- =t :enable_account
- %small=t :enable_description
-= link_to enable_user_path(@user), :method => :post, :class => "btn" do
- %i.icon-remove.icon-white
- =t :enable_account \ No newline at end of file