# HG changeset patch # User Chris Cannam # Date 1363263386 0 # Node ID 775d89567f411155436b5ab4929ca58a1e549ad2 # Parent e0167f4e1d8a59e7524b4e017ce683d33d6aa8c4 Converting fields_for ... :builder => TabularFormBuilder to labelled_fields_for seems like the thing to do diff -r e0167f4e1d8a -r 775d89567f41 app/views/account/register.html.erb --- a/app/views/account/register.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/app/views/account/register.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -23,26 +23,27 @@ + +<%= labelled_fields_for :ssamr_user_details, @ssamr_user_details do |fields| %> +

<%=l(:label_ssamr_details)%>

+ +

+ <%= fields.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> + <%=l(:text_user_ssamr_description_info).html_safe%> +

-

<%=l(:label_ssamr_details)%>

- - <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %> -

- <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> - <%=l(:text_user_ssamr_description_info)%> -

+

+ <%= fields.radio_button :institution_type, true %> + <%= fields.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true}).gsub('&', '&').html_safe %> +

-

- <%= ssamr_user_detail.radio_button :institution_type, true %> - <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true}).gsub('&', '&') %> -

+

+ <%= fields.radio_button :institution_type, false %> Other: + <%= fields.text_field(:other_institution) %> +

+<% end %> + -

- <%= ssamr_user_detail.radio_button :institution_type, false %> Other: - <%= ssamr_user_detail.text_field(:other_institution) %> -

- <% end %> - <% if Setting.openid? %>

<%= f.text_field :identity_url %>

<% end %> @@ -58,3 +59,4 @@ <%= submit_tag l(:button_submit) %> <% end %> + diff -r e0167f4e1d8a -r 775d89567f41 app/views/my/account.html.erb --- a/app/views/my/account.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/app/views/my/account.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -30,30 +30,28 @@ <%= call_hook(:view_my_account, :user => @user, :form => f) %> +<%= labelled_fields_for :ssamr_user_details, @user.ssamr_user_detail do |fields| %>

<%=l(:label_ssamr_details)%>

- <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %>

- <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 25, :required => true, :class => 'wiki-edit' %> + <%= fields.text_area :description, :rows => 3, :cols => 25, :required => true, :class => 'wiki-edit' %>

-

- <%= ssamr_user_detail.radio_button :institution_type, true %> - <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&', '&') %> + <%= fields.radio_button :institution_type, true %> + <%= fields.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&', '&').html_safe %>

- <%= ssamr_user_detail.radio_button :institution_type, false %> Other: - <%= ssamr_user_detail.text_field :other_institution, :size => 19 %> + <%= fields.radio_button :institution_type, false %> Other: + <%= fields.text_field :other_institution, :size => 19 %>

- <% end %>
- +<% end %> <%= submit_tag l(:button_save) %> @@ -72,14 +70,6 @@ <% end %> - - - - - - - - <% content_for :sidebar do %> <%= render :partial => 'sidebar' %> <% end %> diff -r e0167f4e1d8a -r 775d89567f41 app/views/users/_form.html.erb --- a/app/views/users/_form.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/app/views/users/_form.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -27,7 +27,7 @@

<%=l(:label_ssamr_details)%>

- <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %> + <%= labelled_fields_for :ssamr_user_details do |ssamr_user_detail| %>

<%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %>

@@ -35,7 +35,7 @@

<%= ssamr_user_detail.radio_button :institution_type, true %> - <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&', '&') %> + <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true} ).gsub('&', '&').html_safe %>

diff -r e0167f4e1d8a -r 775d89567f41 plugins/redmine_bibliography/app/views/publications/edit.html.erb --- a/plugins/redmine_bibliography/app/views/publications/edit.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/edit.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -6,7 +6,7 @@

<%=l(:label_publication_show)%>

-<% form_for @publication, :url => { :project_id => @project, :action => :update }, :builder => TabularFormBuilder do |f| -%> +<% labelled_form_for @publication, :url => { :project_id => @project, :action => :update } do |f| -%> <%= render :partial => 'form', :locals => { :f => f } %>
diff -r e0167f4e1d8a -r 775d89567f41 plugins/redmine_bibliography/app/views/publications/new.html.erb --- a/plugins/redmine_bibliography/app/views/publications/new.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/new.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -5,7 +5,7 @@

<%=l(:label_publication_new)%>

-<% form_for @publication, :url => { :project_id => @project, :action => :create }, :builder => TabularFormBuilder do |f| -%> +<% labelled_form_for @publication, :url => { :project_id => @project, :action => :create } do |f| -%> <%= render :partial => 'form', :locals => { :f => f } %>
<%= f.submit %> diff -r e0167f4e1d8a -r 775d89567f41 plugins/redmine_tags/app/views/projects/_filter_tags.html.erb --- a/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -1,5 +1,5 @@

- <% fields_for @project, :builder => TabularFormBuilder do |f| -%> + <%= labelled_fields_for @project do |f| -%>

<%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %> diff -r e0167f4e1d8a -r 775d89567f41 plugins/redmine_tags/app/views/projects/_tags_form.html.erb --- a/plugins/redmine_tags/app/views/projects/_tags_form.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/plugins/redmine_tags/app/views/projects/_tags_form.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -1,4 +1,4 @@ -<% fields_for :project, project, :builder => TabularFormBuilder do |f| -%> +<%= labelled_fields_for :project, project do |f| -%>

<%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %>
@@ -8,4 +8,4 @@ <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_tags')}', false)" %>

-<% end -%> \ No newline at end of file +<% end -%> diff -r e0167f4e1d8a -r 775d89567f41 plugins/redmine_tags/app/views/projects/index.html.erb --- a/plugins/redmine_tags/app/views/projects/index.html.erb Wed Mar 13 14:00:01 2013 +0000 +++ b/plugins/redmine_tags/app/views/projects/index.html.erb Thu Mar 14 12:16:26 2013 +0000 @@ -7,7 +7,7 @@
<%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%> - <%= '| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> + <%= ('| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add')).html_safe if User.current.allowed_to?(:add_project, nil, :global => true) %>