Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merge account settings

  • Loading branch information...
commit 3b1a040faead8bc68bea83376534f68034cc177e 1 parent 1f84123
Jon Rose ghostandthemachine authored
2  lib/model/user.rb
View
@@ -21,6 +21,8 @@ class Link #from http://datamapper.org/docs/associations.html
property :img_url, String
property :email, String
property :password, String
+ property :display_name, String
+ property :location, String
property :salt, String
property :session_id, String
property :hashed_password, String
8 lib/routes/user/user.rb
View
@@ -262,5 +262,11 @@ def categories
end
##############################################################
-
+post '/user/:username/account' do
+ @user = current_user
+ @user.display_name = params[:display_name]
+ @user.location = params[:location]
+ @user.save!
+ redirect '/'
+end
4 lib/views/event/event.haml
View
@@ -57,9 +57,9 @@
#event_map{:style => "width:400px;height:300px;"}
.row#follow-tray
-if current_user.following?(event.user) || current_user == event.user
- %p.btn.btn-primary.following-btn= "Following #{event.user.user_name}"
+ %p.btn.btn-primary.following-btn= "Following #{event.user.display_name ? event.user.display_name : event.user.user_name}"
-else
- %a.btn.btn-warning.follow-btn{id: "followed-user-#{event.user.user_name}-#{event.user.id}"}= "Follow #{event.user.user_name}"
+ %a.btn.btn-warning.follow-btn{id: "followed-user-#{event.user.user_name}-#{event.user.id}"}= "Follow #{event.user.display_name ? event.user.display_name : event.user.user_name}"
.row
%h4= "comments"
%hr
16 lib/views/user/account.haml
View
@@ -8,20 +8,20 @@
.content.span9
-#%h2.center= user.user_name.to_s
%img.center_block.mid_mb{:src => gravatar_for(user,200)}
- %form.form-horizontal
+ %form.form-horizontal{:action => "", :method => "post"}
.control-group
- %label.control-label{:for => "inputEmail"}
+ %label.control-label{:for => "inputEmail"}
Email:
.controls
- %input#inputEmail{:value => "#{user.email.to_s}", :placeholder => "Email", :type => "email"}
+ %input#inputEmail{:name => "email", :value => "#{user.email}", :type => "text"}
.control-group
- %label.control-label{:for => "inputUrl"}
+ %label.control-label{:for => "inputDisplayName"}
Display Name
.controls
- %input#inputDisplayName{:value => "#{user.img_url.to_s}", :placeholder => "Display Name", :type => "url"}
+ %input#inputDisplayName{:name => "display_name", :placeholder => "#{user.display_name ? user.display_name : 'Display Name'}", :type => "text"}
.control-group
- %label.control-label{:for => "inputUrl"}
+ %label.control-label{:for => "location"}
Location
.controls
- %input#inputUrl{:value => "#{user.img_url.to_s}", :placeholder => "Location", :type => "url"}
- %input.center_block{:type => "submit", :class => "btn", :value => "Update"}/
+ %input#location{:name => "location", :placeholder => "Location", :type => "text"}
+ %input.center_block{:type => "submit", :class => "btn", :name => "Update"}/
Please sign in to comment.
Something went wrong with that request. Please try again.