diff options
Diffstat (limited to 'users/app')
-rw-r--r-- | users/app/views/users/_cancel_account.html.haml | 6 | ||||
-rw-r--r-- | users/app/views/users/_form.html.haml | 18 | ||||
-rw-r--r-- | users/app/views/users/edit.html.haml | 11 |
3 files changed, 21 insertions, 14 deletions
diff --git a/users/app/views/users/_cancel_account.html.haml b/users/app/views/users/_cancel_account.html.haml new file mode 100644 index 0000000..41580b0 --- /dev/null +++ b/users/app/views/users/_cancel_account.html.haml @@ -0,0 +1,6 @@ +%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 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 |