summaryrefslogtreecommitdiff
path: root/users/app/views
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-07-03 14:07:59 -0700
committerjessib <jessib@leap.se>2013-07-03 14:07:59 -0700
commit6c413d3b0c4f9343fe35dbd6ad65b87dca4b4831 (patch)
tree115808c1aa70bb7a3257bbc15779b9b942950c27 /users/app/views
parent3ead553bdd6b28c8210d9dcb764db407ba580c23 (diff)
Accounts can be enabled or not. Admins can edit this property.
Diffstat (limited to 'users/app/views')
-rw-r--r--users/app/views/users/_deactivate_account.html.haml6
-rw-r--r--users/app/views/users/_enable_account.html.haml6
-rw-r--r--users/app/views/users/edit.html.haml2
-rw-r--r--users/app/views/users/show.html.haml2
4 files changed, 15 insertions, 1 deletions
diff --git a/users/app/views/users/_deactivate_account.html.haml b/users/app/views/users/_deactivate_account.html.haml
new file mode 100644
index 0000000..fec0afa
--- /dev/null
+++ b/users/app/views/users/_deactivate_account.html.haml
@@ -0,0 +1,6 @@
+%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/_enable_account.html.haml b/users/app/views/users/_enable_account.html.haml
new file mode 100644
index 0000000..5ecca48
--- /dev/null
+++ b/users/app/views/users/_enable_account.html.haml
@@ -0,0 +1,6 @@
+%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
diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml
index 97bd48d..49b4f6c 100644
--- a/users/app/views/users/edit.html.haml
+++ b/users/app/views/users/edit.html.haml
@@ -3,6 +3,8 @@
- tabs = []
- content_for :account do
= user_form_with 'login_and_password_fields', :legend => :update_login_and_password if @user == current_user
+ = render 'deactivate_account' if @user != current_user and @user.enabled?
+ = render 'enable_account' if @user != current_user and !@user.enabled?
= render 'cancel_account'
- tabs << :account
- if @user == current_user
diff --git a/users/app/views/users/show.html.haml b/users/app/views/users/show.html.haml
index 056ed57..52a9cf5 100644
--- a/users/app/views/users/show.html.haml
+++ b/users/app/views/users/show.html.haml
@@ -3,7 +3,7 @@
.small
= link_to 'edit', edit_user_path(@user)
%dl.offset1
- - fields = ['login', 'email_address', 'created_at', 'updated_at', 'email_forward']
+ - fields = ['login', 'email_address', 'created_at', 'updated_at', 'email_forward', 'enabled']
- fields.each do |field|
%dt
= field.titleize