Commit 977f0f9a924042b0ee050ecc773c0a57f3d0f7aa

Authored by JoenioCosta
1 parent 02e7c2c1

ActionItem380: added more fields to edit person info

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1807 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/person.rb
@@ -25,7 +25,7 @@ class Person < Profile @@ -25,7 +25,7 @@ class Person < Profile
25 settings_items :photo, :contact_information, :birth_date, :sex, :city, :state, :country 25 settings_items :photo, :contact_information, :birth_date, :sex, :city, :state, :country
26 26
27 def summary 27 def summary
28 - ['name', 'contact_information', 'sex', 'birth_date', 'address', 'city', 'state', 'country'].map do |col| 28 + ['name', 'contact_information', 'contact_phone', 'sex', 'birth_date', 'address', 'city', 'state', 'country'].map do |col|
29 [ col.humanize, self.send(col) ] 29 [ col.humanize, self.send(col) ]
30 end 30 end
31 end 31 end
app/views/profile_editor/person.rhtml
@@ -2,18 +2,21 @@ @@ -2,18 +2,21 @@
2 2
3 <%= error_messages_for :profile %> 3 <%= error_messages_for :profile %>
4 4
5 -<% labelled_form_for :profile, @profile do |f| %> 5 +<% labelled_form_for :profile_data, @profile do |f| %>
6 <%= f.text_field(:name) %> 6 <%= f.text_field(:name) %>
  7 + <%= f.text_field(:contact_information) %>
  8 + <%= f.text_field(:contact_phone) %>
7 <%= _('Sex: ') %> 9 <%= _('Sex: ') %>
8 <%= display_form_field(_('Male'), radio_button(:profile, :sex, 'male')) %> 10 <%= display_form_field(_('Male'), radio_button(:profile, :sex, 'male')) %>
9 <%= display_form_field(_('Female'), radio_button(:profile, :sex, 'female')) %> 11 <%= display_form_field(_('Female'), radio_button(:profile, :sex, 'female')) %>
  12 + <%= f.text_field(:birth_date) %>
  13 + <%= f.text_field(:address) %>
10 <%= f.text_field(:city) %> 14 <%= f.text_field(:city) %>
11 <%= f.text_field(:state) %> 15 <%= f.text_field(:state) %>
12 <%= f.text_field(:country) %> 16 <%= f.text_field(:country) %>
13 <% button_bar do %> 17 <% button_bar do %>
14 <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> 18 <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %>
15 <% end %> 19 <% end %>
16 -  
17 <% end %> 20 <% end %>
18 21
19 <%# = generate_form :info, @info, {...} %> 22 <%# = generate_form :info, @info, {...} %>
test/functional/profile_editor_controller_test.rb
@@ -193,7 +193,7 @@ class ProfileEditorControllerTest &lt; Test::Unit::TestCase @@ -193,7 +193,7 @@ class ProfileEditorControllerTest &lt; Test::Unit::TestCase
193 should 'display profile publication option in edit profile screen' do 193 should 'display profile publication option in edit profile screen' do
194 profile = Profile['ze'] 194 profile = Profile['ze']
195 get :edit, :profile => 'ze' 195 get :edit, :profile => 'ze'
196 - assert_tag :tag => 'input', :attributes => { :type => 'checkbox', :checked => 'checked', :name => 'profile_data[public_profile]', :value => 'true' } 196 + assert_tag :tag => 'input', :attributes => { :type => 'checkbox', :checked => 'checked', :name => 'profile_data[public_profile]', :value => 'true' }
197 assert_tag :tag => 'input', :attributes => { :type => 'hidden', :name => 'profile_data[public_profile]', :value => false } 197 assert_tag :tag => 'input', :attributes => { :type => 'hidden', :name => 'profile_data[public_profile]', :value => false }
198 end 198 end
199 199