DG MS; moved change password to account page; fixed the styling on password inputs

This commit is contained in:
danielvincent 2010-10-07 18:52:46 -07:00
parent 75aadc5c57
commit ed1cb5a0e7
8 changed files with 50 additions and 23 deletions

View file

@ -23,10 +23,6 @@ class UsersController < ApplicationController
def update
@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_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?
@ -36,10 +32,16 @@ class UsersController < ApplicationController
else
flash[:error] = "Password Change Failed"
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
@user.update_profile data
redirect_to edit_user_path(@user)
end

View file

@ -19,7 +19,7 @@
- for photo in @album.photos
.photo_edit_block= image_tag photo.url(:thumb_medium)
#submit_block
.submit_block
= link_to t('.cancel'), root_path
or
= a.submit

View 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"

View file

@ -47,16 +47,9 @@
%p
= p.label :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
= link_to t('.cancel'), root_path
.submit_block
= link_to t('.cancel'), edit_user_path(current_user)
= t('.or')
= f.submit t('.update_profile')

View file

@ -23,3 +23,4 @@
#content_bottom
.back
= link_to "⇧ home", root_path

View file

@ -26,10 +26,8 @@
= render 'users/profile'
#account.settings_pane
= link_to "download my xml", users_export_path, :class => "button"
= link_to "download my photos", users_export_photos_path, :class => "button"
= render 'users/account'
#services.settings_pane
= render 'users/services'

View file

@ -347,7 +347,9 @@ ul.comment_set {
#debug_info h5 {
color: #cccccc; }
input[type='text'], textarea {
input[type='text'],
input[type='password'],
textarea {
font-family: "lucida grande", "lucida sans", "sans-serif";
font-size: 14px;
padding: 0.3em;
@ -362,7 +364,7 @@ input[type='text'], textarea {
-moz-box-shadow: 0 1px 2px white;
-webkit-box-shadow: 0 1px 2px white; }
#submit_block {
.submit_block {
text-align: right;
font-size: 12px; }

View file

@ -467,7 +467,9 @@ ul.comment_set
:color #ccc
input[type='text'], textarea
input[type='text'],
input[type='password'],
textarea
:font
:family 'lucida grande', 'lucida sans', 'sans-serif'
:size 14px
@ -485,7 +487,7 @@ input[type='text'], textarea
:-moz-box-shadow 0 1px 2px #fff
:-webkit-box-shadow 0 1px 2px #fff
#submit_block
.submit_block
:text
:align right
:font