added location to the profile

This commit is contained in:
zhitomirskiyi 2011-03-23 15:56:46 -07:00
parent 804b0b534a
commit 7a31531258
7 changed files with 32 additions and 2 deletions

View file

@ -23,6 +23,7 @@ class Profile < ActiveRecord::Base
xml_attr :birthday xml_attr :birthday
xml_attr :gender xml_attr :gender
xml_attr :bio xml_attr :bio
xml_attr :location
xml_attr :searchable xml_attr :searchable
xml_attr :tag_string xml_attr :tag_string
@ -36,7 +37,7 @@ class Profile < ActiveRecord::Base
validate :max_tags validate :max_tags
attr_accessible :first_name, :last_name, :image_url, :image_url_medium, attr_accessible :first_name, :last_name, :image_url, :image_url_medium,
:image_url_small, :birthday, :gender, :bio, :searchable, :date, :tag_string :image_url_small, :birthday, :gender, :bio, :location, :searchable, :date, :tag_string
belongs_to :person belongs_to :person

View file

@ -42,6 +42,11 @@
%h4 %h4
=t('.bio') =t('.bio')
= markdownify(person.profile.bio, :newlines => true) = markdownify(person.profile.bio, :newlines => true)
- unless person.profile.location.blank?
%li
%h4
=t('.location')
= markdownify(person.profile.location, :newlines => true)
%li.span-8.last %li.span-8.last
.span-4 .span-4

View file

@ -17,6 +17,11 @@
= t('profiles.edit.your_bio') = t('profiles.edit.your_bio')
= text_area_tag 'profile[bio]', profile.bio, :rows => 5, :placeholder => t('fill_me_out') = text_area_tag 'profile[bio]', profile.bio, :rows => 5, :placeholder => t('fill_me_out')
%h4
= t('profiles.edit.your_location')
%br
= text_field_tag 'profile[location]', profile.location, :placeholder => t('fill_me_out')
%h4 %h4
= t('profiles.edit.your_gender') = t('profiles.edit.your_gender')
%br %br

View file

@ -371,6 +371,7 @@ en:
remove_contact: "remove contact" remove_contact: "remove contact"
edit_my_profile: "Edit my profile" edit_my_profile: "Edit my profile"
bio: "bio" bio: "bio"
location: "location"
gender: "gender" gender: "gender"
born: "birthday" born: "birthday"
in_aspects: "in aspects" in_aspects: "in aspects"
@ -435,6 +436,7 @@ en:
your_tags: "You: in 5 #tags" your_tags: "You: in 5 #tags"
your_tags_placeholder: "i.e. #diaspora #ironing #kittens #music" your_tags_placeholder: "i.e. #diaspora #ironing #kittens #music"
your_bio: "Your bio" your_bio: "Your bio"
your_location: "Your location"
your_photo: "Your photo" your_photo: "Your photo"
update_profile: "Update Profile" update_profile: "Update Profile"
allow_search: "Allow for people to search for you within Diaspora" allow_search: "Allow for people to search for you within Diaspora"

View file

@ -0,0 +1,9 @@
class AddLocationToProfile < ActiveRecord::Migration
def self.up
add_column :profiles, :location, :string
end
def self.down
remove_column :profiles, :location
end
end

View file

@ -10,7 +10,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110321205715) do ActiveRecord::Schema.define(:version => 20110323213655) do
create_table "aspect_memberships", :force => true do |t| create_table "aspect_memberships", :force => true do |t|
t.integer "aspect_id", :null => false t.integer "aspect_id", :null => false
@ -251,6 +251,7 @@ ActiveRecord::Schema.define(:version => 20110321205715) do
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "mongo_id" t.string "mongo_id"
t.string "location"
end end
add_index "profiles", ["first_name", "last_name", "searchable"], :name => "index_profiles_on_first_name_and_last_name_and_searchable" add_index "profiles", ["first_name", "last_name", "searchable"], :name => "index_profiles_on_first_name_and_last_name_and_searchable"

View file

@ -102,6 +102,13 @@ describe Profile do
xml = person.profile.to_diaspora_xml xml = person.profile.to_diaspora_xml
xml.should include "#one" xml.should include "#one"
end end
it 'includes location' do
person.profile.location = 'Dark Side, Moon'
person.profile.save
xml = person.profile.to_diaspora_xml
xml.should include "Dark Side, Moon"
end
end end
describe '#image_url' do describe '#image_url' do