@@ -882,6 +882,20 module ApplicationHelper | |||
|
882 | 882 | form_for(*args, &proc) |
|
883 | 883 | end |
|
884 | 884 | |
|
885 | def labelled_fields_for(*args, &proc) | |
|
886 | args << {} unless args.last.is_a?(Hash) | |
|
887 | options = args.last | |
|
888 | options.merge!({:builder => TabularFormBuilder}) | |
|
889 | fields_for(*args, &proc) | |
|
890 | end | |
|
891 | ||
|
892 | def labelled_remote_form_for(*args, &proc) | |
|
893 | args << {} unless args.last.is_a?(Hash) | |
|
894 | options = args.last | |
|
895 | options.merge!({:builder => TabularFormBuilder}) | |
|
896 | remote_form_for(*args, &proc) | |
|
897 | end | |
|
898 | ||
|
885 | 899 | def back_url_hidden_field_tag |
|
886 | 900 | back_url = params[:back_url] || request.env['HTTP_REFERER'] |
|
887 | 901 | back_url = CGI.unescape(back_url.to_s) |
@@ -1,6 +1,6 | |||
|
1 | 1 | <h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> » <%=h @issue_status %></h2> |
|
2 | 2 | |
|
3 |
<% form_for @issue_status |
|
|
3 | <% labelled_form_for @issue_status do |f| %> | |
|
4 | 4 | <%= render :partial => 'form', :locals => {:f => f} %> |
|
5 | 5 | <%= submit_tag l(:button_save) %> |
|
6 | 6 | <% end %> |
@@ -1,6 +1,6 | |||
|
1 | 1 | <h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> » <%=l(:label_issue_status_new)%></h2> |
|
2 | 2 | |
|
3 |
<% form_for @issue_status |
|
|
3 | <% labelled_form_for @issue_status do |f| %> | |
|
4 | 4 | <%= render :partial => 'form', :locals => {:f => f} %> |
|
5 | 5 | <%= submit_tag l(:button_create) %> |
|
6 | 6 | <% end %> |
@@ -1,4 +1,4 | |||
|
1 |
<% fields_for :issue, @issue |
|
|
1 | <% labelled_fields_for :issue, @issue do |f| %> | |
|
2 | 2 | |
|
3 | 3 | <div class="splitcontentleft"> |
|
4 | 4 | <% if @issue.new_record? || @allowed_statuses.any? %> |
@@ -8,7 +8,7 | |||
|
8 | 8 | <% end %> |
|
9 | 9 | <% if User.current.allowed_to?(:log_time, @project) %> |
|
10 | 10 | <fieldset class="tabular"><legend><%= l(:button_log_time) %></legend> |
|
11 |
<% fields_for :time_entry, @time_entry |
|
|
11 | <% labelled_fields_for :time_entry, @time_entry do |time_entry| %> | |
|
12 | 12 | <div class="splitcontentleft"> |
|
13 | 13 | <p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p> |
|
14 | 14 | </div> |
@@ -6,9 +6,7 | |||
|
6 | 6 | <h2><%=l(:label_my_account)%></h2> |
|
7 | 7 | <%= error_messages_for 'user' %> |
|
8 | 8 | |
|
9 | <% form_for :user, @user, :url => { :action => "account" }, | |
|
10 | :builder => TabularFormBuilder, | |
|
11 | :lang => current_language, | |
|
9 | <% labelled_form_for :user, @user, :url => { :action => "account" }, | |
|
12 | 10 | :html => { :id => 'my_account_form' } do |f| %> |
|
13 | 11 | <div class="splitcontentleft"> |
|
14 | 12 | <fieldset class="box tabular"> |
@@ -1,7 +1,5 | |||
|
1 | <% remote_form_for :repository, @repository, | |
|
2 |
:url => { :controller => 'repositories', :action => 'edit', :id => @project } |
|
|
3 | :builder => TabularFormBuilder, | |
|
4 | :lang => current_language do |f| %> | |
|
1 | <% labelled_remote_form_for :repository, @repository, | |
|
2 | :url => { :controller => 'repositories', :action => 'edit', :id => @project } do |f| %> | |
|
5 | 3 | |
|
6 | 4 | <%= error_messages_for 'repository' %> |
|
7 | 5 |
@@ -1,7 +1,5 | |||
|
1 | <% remote_form_for :wiki, @wiki, | |
|
2 |
:url => { :controller => 'wikis', :action => 'edit', :id => @project } |
|
|
3 | :builder => TabularFormBuilder, | |
|
4 | :lang => current_language do |f| %> | |
|
1 | <% labelled_remote_form_for :wiki, @wiki, | |
|
2 | :url => { :controller => 'wikis', :action => 'edit', :id => @project } do |f| %> | |
|
5 | 3 | |
|
6 | 4 | <%= error_messages_for 'wiki' %> |
|
7 | 5 |
@@ -1,5 +1,5 | |||
|
1 | 1 | <h2><%= link_to l(:label_tracker_plural), trackers_path %> » <%=h @tracker %></h2> |
|
2 | 2 | |
|
3 | <% form_for @tracker, :builder => TabularFormBuilder do |f| %> | |
|
3 | <% labelled_form_for @tracker do |f| %> | |
|
4 | 4 | <%= render :partial => 'form', :locals => { :f => f } %> |
|
5 | 5 | <% end %> |
@@ -1,5 +1,5 | |||
|
1 | 1 | <h2><%= link_to l(:label_tracker_plural), trackers_path %> » <%=l(:label_tracker_new)%></h2> |
|
2 | 2 | |
|
3 | <% form_for @tracker, :builder => TabularFormBuilder do |f| %> | |
|
3 | <% labelled_form_for @tracker do |f| %> | |
|
4 | 4 | <%= render :partial => 'form', :locals => { :f => f } %> |
|
5 | 5 | <% end %> |
@@ -1,4 +1,4 | |||
|
1 | <% form_for @user, :builder => TabularFormBuilder do |f| %> | |
|
1 | <% labelled_form_for @user do |f| %> | |
|
2 | 2 | <%= render :partial => 'form', :locals => { :f => f } %> |
|
3 | 3 | <% if @user.active? && email_delivery_enabled? -%> |
|
4 | 4 | <p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p> |
@@ -1,4 +1,4 | |||
|
1 |
<% fields_for :pref, @user.pref |
|
|
1 | <% labelled_fields_for :pref, @user.pref do |pref_fields| %> | |
|
2 | 2 | <p><%= pref_fields.check_box :hide_mail %></p> |
|
3 | 3 | <p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p> |
|
4 | 4 | <p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p> |
@@ -1,6 +1,6 | |||
|
1 | 1 | <h2><%= link_to l(:label_user_plural), users_path %> » <%=l(:label_user_new)%></h2> |
|
2 | 2 | |
|
3 | <% form_for @user, :builder => TabularFormBuilder do |f| %> | |
|
3 | <% labelled_form_for @user do |f| %> | |
|
4 | 4 | <%= render :partial => 'form', :locals => { :f => f } %> |
|
5 | 5 | <% if email_delivery_enabled? %> |
|
6 | 6 | <p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p> |
General Comments 0
You need to be logged in to leave comments.
Login now