diff options
Diffstat (limited to 'users/app/views')
-rw-r--r-- | users/app/views/users/_cancel_account.html.haml | 6 | ||||
-rw-r--r-- | users/app/views/users/_email_field.html.haml | 1 | ||||
-rw-r--r-- | users/app/views/users/_email_forward_field.html.haml | 1 | ||||
-rw-r--r-- | users/app/views/users/_form.html.haml | 14 | ||||
-rw-r--r-- | users/app/views/users/_legend_and_submit.html.haml | 4 | ||||
-rw-r--r-- | users/app/views/users/_login_field.html.haml | 1 | ||||
-rw-r--r-- | users/app/views/users/_password_fields.html.haml | 2 | ||||
-rw-r--r-- | users/app/views/users/_user.html.haml | 3 | ||||
-rw-r--r-- | users/app/views/users/edit.html.haml | 15 | ||||
-rw-r--r-- | users/app/views/users/new.html.haml | 10 |
10 files changed, 49 insertions, 8 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/_email_field.html.haml b/users/app/views/users/_email_field.html.haml new file mode 100644 index 0000000..36bbeca --- /dev/null +++ b/users/app/views/users/_email_field.html.haml @@ -0,0 +1 @@ += f.input :email diff --git a/users/app/views/users/_email_forward_field.html.haml b/users/app/views/users/_email_forward_field.html.haml new file mode 100644 index 0000000..049428f --- /dev/null +++ b/users/app/views/users/_email_forward_field.html.haml @@ -0,0 +1 @@ += f.input :email_forward diff --git a/users/app/views/users/_form.html.haml b/users/app/views/users/_form.html.haml index fc835af..cb51175 100644 --- a/users/app/views/users/_form.html.haml +++ b/users/app/views/users/_form.html.haml @@ -1,9 +1,11 @@ +- 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) + = yield + .pull-right + = f.button :submit + - unless only + = link_to t(:cancel), root_url, :class => :btn + .clearfix diff --git a/users/app/views/users/_legend_and_submit.html.haml b/users/app/views/users/_legend_and_submit.html.haml new file mode 100644 index 0000000..6fc0e4a --- /dev/null +++ b/users/app/views/users/_legend_and_submit.html.haml @@ -0,0 +1,4 @@ +%legend= t(legend) +=yield +.pull-right= f.button :submit, :value => t(legend) +.clearfix diff --git a/users/app/views/users/_login_field.html.haml b/users/app/views/users/_login_field.html.haml new file mode 100644 index 0000000..8ab36c3 --- /dev/null +++ b/users/app/views/users/_login_field.html.haml @@ -0,0 +1 @@ += f.input :login, :input_html => { :id => :srp_username } diff --git a/users/app/views/users/_password_fields.html.haml b/users/app/views/users/_password_fields.html.haml new file mode 100644 index 0000000..c2e6a69 --- /dev/null +++ b/users/app/views/users/_password_fields.html.haml @@ -0,0 +1,2 @@ += f.input :password, :required => true, :validate => true, :input_html => { :id => :srp_password } += f.input :password_confirmation, :required => true, :input_html => { :id => :srp_password_confirmation } diff --git a/users/app/views/users/_user.html.haml b/users/app/views/users/_user.html.haml index 5eb7941..7db0041 100644 --- a/users/app/views/users/_user.html.haml +++ b/users/app/views/users/_user.html.haml @@ -2,6 +2,9 @@ %td= user.login %td= time_ago_in_words(user.created_at) + " ago" %td + = link_to edit_user_path(user), :class => "btn btn-mini btn-primary" do + %i.icon-edit.icon-white + Edit = link_to user_path(user), :method => :delete, :class => "btn btn-danger btn-mini" do %i.icon-remove.icon-white Remove diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml index 8298443..b33c19b 100644 --- a/users/app/views/users/edit.html.haml +++ b/users/app/views/users/edit.html.haml @@ -1,3 +1,16 @@ .span8.offset2 %h2=t :settings - = render 'form' + %ul.nav.nav-tabs + %li.active + %a{:href => '#account', 'data-toggle' => 'tab'}Account + %li + %a{:href => '#email', 'data-toggle' => 'tab'}Email + + .tab-content + .tab-pane.active#account + = user_form_with 'login_field', :legend => :change_login + = user_form_with 'password_fields', :legend => :change_password + = render 'cancel_account' if @user == current_user + .tab-pane#email + = user_form_with 'email_field', :legend => :set_email_address + = user_form_with 'email_forward_field', :legend => :forward_email diff --git a/users/app/views/users/new.html.haml b/users/app/views/users/new.html.haml index c1c4208..98cccb0 100644 --- a/users/app/views/users/new.html.haml +++ b/users/app/views/users/new.html.haml @@ -1,3 +1,11 @@ .span8.offset2 %h2=t :signup - = render 'form' + = user_form do |f| + %legend= t(:signup_message) + = render :partial => 'login_field', :locals => {:f => f} + = render :partial => 'password_fields', :locals => {:f => f} + .pull-right + = f.button :submit, :class => 'btn-primary' + = link_to t(:cancel), root_url, :class => :btn + .clearfix + |