From d26e7850ac72fd02d152bf6775f7592aa48bd468 Mon Sep 17 00:00:00 2001 From: ilya <ilya@laptop.(none)> Date: Tue, 21 Sep 2010 15:52:26 -0700 Subject: [PATCH] RS, IZ; removed url from user and views --- app/models/user.rb | 3 +-- app/views/devise/sessions/new.html.haml | 2 +- app/views/registrations/new.html.haml | 3 --- app/views/users/edit.html.haml | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index d129db2ce9..4e9e968ca6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -25,8 +25,6 @@ class User key :visible_post_ids, Array key :visible_person_ids, Array - key :url, String - one :person, :class_name => 'Person', :foreign_key => :owner_id many :friends, :in => :friend_ids, :class_name => 'Person' @@ -224,6 +222,7 @@ class User ###Helpers############ def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{terse_url}" + opts[:person][:url] = APP_CONFIG[:pod_url] opts[:person][:serialized_key] = generate_key User.create(opts) end diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 7ce75f5f31..15880df0bb 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -10,7 +10,7 @@ = f.label :username = f.text_field :username %p.user_network - ="@#{request.host}" + ="@#{APP_CONFIG[:pod_url]}" %p = f.label :password diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index eefa945196..3e1dc08304 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -2,7 +2,6 @@ = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| - = f.hidden_field :url, :value => request.host %p = f.label :username = f.text_field :username @@ -17,8 +16,6 @@ = f.password_field :password_confirmation = f.fields_for :person do |p| - = p.hidden_field :url, :value => request.host - = p.fields_for :profile do |pr| %p = pr.label :first_name diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index fd94b2a427..880d25ef4c 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -17,11 +17,11 @@ %h3 Picture %div#image_picker - = p.hidden_field :image_url, :value => (@profile.image_url.sub(@user.url,'/') if @profile.image_url), :id => 'image_url_field' + = p.hidden_field :image_url, :value => (@profile.image_url.sub(APP_CONFIG[:pod_url],'/') if @profile.image_url), :id => 'image_url_field' - unless @photos.nil? || @photos.empty? - for photo in @photos - - if @profile.image_url && (photo.url(:thumb_medium) == @profile.image_url.sub(@user.url,'/')) + - if @profile.image_url && (photo.url(:thumb_medium) == @profile.image_url.sub(APP_CONFIG[:pod_url],'/')) %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} = check_box_tag 'checked_photo', true, true = link_to image_tag(photo.url(:thumb_medium)), "#" -- GitLab