mirror of
https://github.com/diaspora/diaspora.git
synced 2026-01-12 00:28:05 -05:00
added location to the profile
This commit is contained in:
@@ -23,6 +23,7 @@ class Profile < ActiveRecord::Base
|
||||
xml_attr :birthday
|
||||
xml_attr :gender
|
||||
xml_attr :bio
|
||||
xml_attr :location
|
||||
xml_attr :searchable
|
||||
xml_attr :tag_string
|
||||
|
||||
@@ -36,7 +37,7 @@ class Profile < ActiveRecord::Base
|
||||
validate :max_tags
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
%h4
|
||||
=t('.bio')
|
||||
= 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
|
||||
.span-4
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
= t('profiles.edit.your_bio')
|
||||
= 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
|
||||
= t('profiles.edit.your_gender')
|
||||
%br
|
||||
|
||||
@@ -371,6 +371,7 @@ en:
|
||||
remove_contact: "remove contact"
|
||||
edit_my_profile: "Edit my profile"
|
||||
bio: "bio"
|
||||
location: "location"
|
||||
gender: "gender"
|
||||
born: "birthday"
|
||||
in_aspects: "in aspects"
|
||||
@@ -435,6 +436,7 @@ en:
|
||||
your_tags: "You: in 5 #tags"
|
||||
your_tags_placeholder: "i.e. #diaspora #ironing #kittens #music"
|
||||
your_bio: "Your bio"
|
||||
your_location: "Your location"
|
||||
your_photo: "Your photo"
|
||||
update_profile: "Update Profile"
|
||||
allow_search: "Allow for people to search for you within Diaspora"
|
||||
|
||||
9
db/migrate/20110323213655_add_location_to_profile.rb
Normal file
9
db/migrate/20110323213655_add_location_to_profile.rb
Normal 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
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# 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|
|
||||
t.integer "aspect_id", :null => false
|
||||
@@ -251,6 +251,7 @@ ActiveRecord::Schema.define(:version => 20110321205715) do
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "mongo_id"
|
||||
t.string "location"
|
||||
end
|
||||
|
||||
add_index "profiles", ["first_name", "last_name", "searchable"], :name => "index_profiles_on_first_name_and_last_name_and_searchable"
|
||||
|
||||
@@ -102,6 +102,13 @@ describe Profile do
|
||||
xml = person.profile.to_diaspora_xml
|
||||
xml.should include "#one"
|
||||
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
|
||||
|
||||
describe '#image_url' do
|
||||
|
||||
Reference in New Issue
Block a user