summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/app/views/users/_form.html.haml18
-rw-r--r--users/app/views/users/edit.html.haml11
2 files changed, 15 insertions, 14 deletions
diff --git a/users/app/views/users/_form.html.haml b/users/app/views/users/_form.html.haml
index fc835af..39e26a6 100644
--- a/users/app/views/users/_form.html.haml
+++ b/users/app/views/users/_form.html.haml
@@ -1,9 +1,15 @@
+- only = local_assigns[:only]
- html = {:class => 'form-horizontal user form ' + (@user.new_record? ? 'new' : 'edit')}
= simple_form_for @user, :validate => true, :format => :json, :html => html do |f|
%legend
- = @user.new_record? ? t(:signup_message) : t(:edit_settings)
- = f.input :login, :input_html => { :id => :srp_username }
- = f.input :password, :required => true, :validate => true, :input_html => { :id => :srp_password }
- = f.input :password_confirmation, :required => true, :input_html => { :id => :srp_password_confirmation }
- = f.button :submit, :class => 'btn-primary'
- = link_to t(:cancel), root_url, :class => :btn
+ = t(only || :signup_message)
+ - if !only || only == :change_login
+ = f.input :login, :input_html => { :id => :srp_username }
+ - if !only || only == :change_password
+ = f.input :password, :required => true, :validate => true, :input_html => { :id => :srp_password }
+ = f.input :password_confirmation, :required => true, :input_html => { :id => :srp_password_confirmation }
+ .pull-right
+ = f.button :submit, :class => 'btn-primary'
+ - unless only
+ = link_to t(:cancel), root_url, :class => :btn
+ .clearfix
diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml
index cfcf220..25da71a 100644
--- a/users/app/views/users/edit.html.haml
+++ b/users/app/views/users/edit.html.haml
@@ -1,10 +1,5 @@
.span8.offset2
%h2=t :settings
- = render 'form'
- - if @user == current_user
- %legend
- =t :cancel_account
- %small You will not be able to login anymore.
- = link_to user_path(@user), :method => :delete, :class => "btn btn-danger" do
- %i.icon-remove.icon-white
- Remove my Account
+ = render :partial => 'form', :locals => {:only => :change_login}
+ = render :partial => 'form', :locals => {:only => :change_password}
+ = render 'cancel_account' if @user == current_user