DG MS; moved change password to account page; fixed the styling on password inputs
This commit is contained in:
parent
75aadc5c57
commit
ed1cb5a0e7
8 changed files with 50 additions and 23 deletions
|
|
@ -23,10 +23,6 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@user = current_user
|
@user = current_user
|
||||||
data = clean_hash params[:user]
|
|
||||||
prep_image_url(data)
|
|
||||||
|
|
||||||
|
|
||||||
params[:user].delete(:password) if params[:user][:password].blank?
|
params[:user].delete(:password) if params[:user][:password].blank?
|
||||||
params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?
|
params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?
|
||||||
|
|
||||||
|
|
@ -36,10 +32,16 @@ class UsersController < ApplicationController
|
||||||
else
|
else
|
||||||
flash[:error] = "Password Change Failed"
|
flash[:error] = "Password Change Failed"
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
data = clean_hash params[:user]
|
||||||
|
prep_image_url(data)
|
||||||
|
|
||||||
|
if @user.update_profile data
|
||||||
|
flash[:notice] = "Profile updated"
|
||||||
|
else
|
||||||
|
flash[:error] = "Failed to update profile"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@user.update_profile data
|
|
||||||
redirect_to edit_user_path(@user)
|
redirect_to edit_user_path(@user)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- for photo in @album.photos
|
- for photo in @album.photos
|
||||||
.photo_edit_block= image_tag photo.url(:thumb_medium)
|
.photo_edit_block= image_tag photo.url(:thumb_medium)
|
||||||
|
|
||||||
#submit_block
|
.submit_block
|
||||||
= link_to t('.cancel'), root_path
|
= link_to t('.cancel'), root_path
|
||||||
or
|
or
|
||||||
= a.submit
|
= a.submit
|
||||||
|
|
|
||||||
29
app/views/users/_account.haml
Normal file
29
app/views/users/_account.haml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
||||||
|
%h2 Account
|
||||||
|
|
||||||
|
%h3 Change Password
|
||||||
|
|
||||||
|
= form_for @user do |f|
|
||||||
|
= f.error_messages
|
||||||
|
|
||||||
|
%p
|
||||||
|
= f.label :password, "New Password"
|
||||||
|
= f.password_field :password
|
||||||
|
%p
|
||||||
|
= f.label :password_confirmation
|
||||||
|
= f.password_field :password_confirmation
|
||||||
|
|
||||||
|
.submit_block
|
||||||
|
= link_to "Cancel", edit_user_path(current_user)
|
||||||
|
or
|
||||||
|
= f.submit 'Change password'
|
||||||
|
|
||||||
|
%h3 Export Data
|
||||||
|
|
||||||
|
= link_to "download my xml", users_export_path, :class => "button"
|
||||||
|
= link_to "download my photos", users_export_photos_path, :class => "button"
|
||||||
|
|
||||||
|
|
@ -47,16 +47,9 @@
|
||||||
%p
|
%p
|
||||||
= p.label :last_name
|
= p.label :last_name
|
||||||
= p.text_field :last_name, :value => @profile.last_name
|
= p.text_field :last_name, :value => @profile.last_name
|
||||||
%p
|
|
||||||
= f.label :password
|
|
||||||
= f.password_field :password
|
|
||||||
%p
|
|
||||||
= f.label :password_confirmation
|
|
||||||
= f.password_field :password_confirmation
|
|
||||||
|
|
||||||
|
.submit_block
|
||||||
#submit_block
|
= link_to t('.cancel'), edit_user_path(current_user)
|
||||||
= link_to t('.cancel'), root_path
|
|
||||||
= t('.or')
|
= t('.or')
|
||||||
= f.submit t('.update_profile')
|
= f.submit t('.update_profile')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,3 +23,4 @@
|
||||||
#content_bottom
|
#content_bottom
|
||||||
.back
|
.back
|
||||||
= link_to "⇧ home", root_path
|
= link_to "⇧ home", root_path
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,8 @@
|
||||||
= render 'users/profile'
|
= render 'users/profile'
|
||||||
|
|
||||||
#account.settings_pane
|
#account.settings_pane
|
||||||
= link_to "download my xml", users_export_path, :class => "button"
|
= render 'users/account'
|
||||||
= link_to "download my photos", users_export_photos_path, :class => "button"
|
|
||||||
|
|
||||||
#services.settings_pane
|
#services.settings_pane
|
||||||
= render 'users/services'
|
= render 'users/services'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,9 @@ ul.comment_set {
|
||||||
#debug_info h5 {
|
#debug_info h5 {
|
||||||
color: #cccccc; }
|
color: #cccccc; }
|
||||||
|
|
||||||
input[type='text'], textarea {
|
input[type='text'],
|
||||||
|
input[type='password'],
|
||||||
|
textarea {
|
||||||
font-family: "lucida grande", "lucida sans", "sans-serif";
|
font-family: "lucida grande", "lucida sans", "sans-serif";
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
|
|
@ -362,7 +364,7 @@ input[type='text'], textarea {
|
||||||
-moz-box-shadow: 0 1px 2px white;
|
-moz-box-shadow: 0 1px 2px white;
|
||||||
-webkit-box-shadow: 0 1px 2px white; }
|
-webkit-box-shadow: 0 1px 2px white; }
|
||||||
|
|
||||||
#submit_block {
|
.submit_block {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 12px; }
|
font-size: 12px; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -467,7 +467,9 @@ ul.comment_set
|
||||||
:color #ccc
|
:color #ccc
|
||||||
|
|
||||||
|
|
||||||
input[type='text'], textarea
|
input[type='text'],
|
||||||
|
input[type='password'],
|
||||||
|
textarea
|
||||||
:font
|
:font
|
||||||
:family 'lucida grande', 'lucida sans', 'sans-serif'
|
:family 'lucida grande', 'lucida sans', 'sans-serif'
|
||||||
:size 14px
|
:size 14px
|
||||||
|
|
@ -485,7 +487,7 @@ input[type='text'], textarea
|
||||||
:-moz-box-shadow 0 1px 2px #fff
|
:-moz-box-shadow 0 1px 2px #fff
|
||||||
:-webkit-box-shadow 0 1px 2px #fff
|
:-webkit-box-shadow 0 1px 2px #fff
|
||||||
|
|
||||||
#submit_block
|
.submit_block
|
||||||
:text
|
:text
|
||||||
:align right
|
:align right
|
||||||
:font
|
:font
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue