diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 22b5dc7..24ca7e7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -691,8 +691,12 @@ module ApplicationHelper form_for(name, object, { :builder => NoosferoFormBuilder }.merge(options), &proc) end - def custom_field(profile, name, field_html, options = {}) + def custom_field(profile, name, field_html = nil, options = {}, &block) result = "" + if block + field_html ||= '' + field_html += capture(&block) + end if (controller.action_name == 'signup') if profile.signup_fields.include?(name) result = field_html @@ -705,6 +709,11 @@ module ApplicationHelper if profile.required_fields.include?(name) result = required(result) end + + if block + concat(result, block.binding) + end + result end diff --git a/app/views/account/_signup_form.rhtml b/app/views/account/_signup_form.rhtml index 4d7215e..408ddfd 100644 --- a/app/views/account/_signup_form.rhtml +++ b/app/views/account/_signup_form.rhtml @@ -21,7 +21,7 @@ in this environment.') % environment.name %> <%= help %> <%= required f.text_field(:email, - :help => help=_('We\'ll send you an e-mail to validate your registration.')) %> + :help => help=_('This e-mail address will be used to contact you about events that deserve your attention.')) %> <%= help %> <%= required f.password_field(:password, diff --git a/app/views/profile_editor/_person_form.rhtml b/app/views/profile_editor/_person_form.rhtml index 8d1da03..f90d88c 100644 --- a/app/views/profile_editor/_person_form.rhtml +++ b/app/views/profile_editor/_person_form.rhtml @@ -1,14 +1,10 @@ <% @person ||= @profile %> -<%= custom_field(@person, 'nickname', f.text_field(:nickname, :maxlength => 16, :size => 30)) %> - -<% nickname_tip = "
" + _('A short name by which you like to be known. Will be used in friends listings, community member listings etc.') + "
" %> -<% if controller.action_name == 'signup' %> - <% if @person.signup_fields.include?('nickname') %> - <%= nickname_tip %> - <% end%> -<% elsif @person.active_fields.include?('nickname') %> - <%= nickname_tip %> +<% custom_field(@person, 'nickname') do %> + <%= f.text_field(:nickname, :maxlength => 16, :size => 30) %> +
+ <%= _('A short name by which you like to be known. Will be used in friends listings, community member listings etc.') %> +
<% end %> <%= custom_field(@person, 'contact_information', f.text_field(:contact_information)) %> @@ -24,13 +20,13 @@ <%= custom_field(@person, 'country', select_country(_('Country'), 'profile_data', 'country', {:class => 'type-select'})) %> <%= custom_field(@person, 'nationality', f.text_field(:nationality)) %> -<% if @person.active_fields.include?('schooling') %> - <% schooling_label = "" %> -
<%= @person.required_fields.include?('schooling') ? required(schooling_label) : schooling_label %> -
- <%= custom_field(@person, 'schooling', select_schooling('profile_data', 'schooling', {:class => 'select-schooling'})) %> - <%= custom_field(@person, 'schooling_status', select_schooling_status('profile_data', 'schooling_status', {:class => 'select-schooling'})) %> -
+<% custom_field(@person, 'schooling') do %> +
+ +
+ <%= select_schooling('profile_data', 'schooling', {:class => 'select-schooling'}) %> + <%= select_schooling_status('profile_data', 'schooling_status', {:class => 'select-schooling'}) %> +
<% end %> -- libgit2 0.21.2