diff --git a/app/controllers/my_profile/profile_editor_controller.rb b/app/controllers/my_profile/profile_editor_controller.rb index d9b6da4..beac8a5 100644 --- a/app/controllers/my_profile/profile_editor_controller.rb +++ b/app/controllers/my_profile/profile_editor_controller.rb @@ -45,7 +45,7 @@ class ProfileEditorController < MyProfileController redirect_to :action => 'index' else flash[:notice] = _('Could not upload image') - render :action => 'change_imange' + render :action => 'change_image' end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3781224..828e98e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -190,10 +190,12 @@ module ApplicationHelper field_id = $1 end field_html =~ /type=['"]([^'"]*)['"]/ + field_html =~ /<(\w*)/ unless $1 field_type = $1 + field_class = 'formfield type-' + field_type if field_type label_html = content_tag('label', text, :class => 'formlabel', :for => field_id) - control_html = content_tag('div', field_html, :class => 'formfield type-'+field_type ) + control_html = content_tag('div', field_html, :class => field_class ) content_tag('div', label_html + control_html, :class => 'formfieldline' ) end diff --git a/app/views/profile_editor/enterprise_info.rhtml b/app/views/profile_editor/enterprise_info.rhtml deleted file mode 100644 index 9f333f5..0000000 --- a/app/views/profile_editor/enterprise_info.rhtml +++ /dev/null @@ -1,32 +0,0 @@ - -

<%= text_field 'enterprise', 'name', 'size' => 20, 'class' => 'formfield text_field' %>

- -


-<%= text_field 'enterprise', 'address', 'size' => 50 %>

- -


-<%= text_field 'enterprise', 'contact_phone', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'contact_person', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'acronym', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'foundation_year', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'legal_form', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'economic_activity', 'size' => 20 %>

- -


-<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %>

- -


-<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %>

- -


-<%= text_field 'enterprise', 'tag_list', 'size' => 20 %>

diff --git a/app/views/profile_editor/organization_info.rhtml b/app/views/profile_editor/organization_info.rhtml index c12d978..71b9702 100644 --- a/app/views/profile_editor/organization_info.rhtml +++ b/app/views/profile_editor/organization_info.rhtml @@ -1,29 +1,9 @@ -

-<%= text_field 'enterprise', 'name', 'size' => 20, 'class' => 'formfield text_field' %>

- -

-<%= text_field 'enterprise', 'address', 'size' => 50 , :id => 'address'%>

- -


-<%= text_field 'enterprise', 'contact_phone', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'contact_person', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'acronym', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'foundation_year', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'legal_form', 'size' => 20 %>

- -


-<%= text_field 'organization_info', 'economic_activity', 'size' => 20 %>

- -


-<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %>

- -


-<%= text_field 'enterprise', 'tag_list', 'size' => 20 %>

+<% labelled_form_for :info, @info do |f| %> + <%= f.text_field(:contact_person) %> + <%= f.text_field(:acronym) %> + <%= f.text_field(:foundation_year) %> + <%= f.text_field(:legal_form) %> + <%= f.text_field(:economic_activity) %> + <%= f.text_area(:management_information) %> + <%= display_submit_tag(_('Save')) %> +<% end %> diff --git a/app/views/profile_editor/person_info.rhtml b/app/views/profile_editor/person_info.rhtml index c46d482..e193565 100644 --- a/app/views/profile_editor/person_info.rhtml +++ b/app/views/profile_editor/person_info.rhtml @@ -1,20 +1,14 @@

<%= _('Edit person info') %>

-<% form_for :info, @info do |f| %> - - <%= display_form_field(_('Name'), f.text_field(:name)) %> - - <%= display_form_field(_('Contact Information'), f.text_area(:contact_information, :rows => 5)) %> - <%= display_form_field(_('Birth day'), f.date_select(:birth_date, :start_year => 1930, :use_month_numbers => true, :order => [:day, :month, :year])) %> +<% labelled_form_for :info, @info do |f| %> + <%= f.text_field(:name) %> <%= _('Sex: ') %> - <%= display_form_field(_('Male'), f.radio_button(:sex, 'male')) %> - <%= display_form_field(_('Female'), f.radio_button(:sex, 'female')) %> - <%= display_form_field(_('Address'), f.text_area(:address, :rows => 3)) %> - <%= display_form_field(_('City'), f.text_field(:city)) %> - <%= display_form_field(_('State'), f.text_field(:state)) %> - <%= display_form_field(_('Country'), f.text_field(:country)) %> - - <%= submit_tag _('Save') %> + <%= display_form_field(_('Male'), radio_button(:info, :sex, 'male')) %> + <%= display_form_field(_('Female'), radio_button(:info, :sex, 'female')) %> + <%= f.text_field(:city) %> + <%= f.text_field(:state) %> + <%= f.text_field(:country) %> + <%= display_submit_tag _('Save') %> <% end %> -- libgit2 0.21.2