summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-09 18:40:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-09 18:40:28 +0000
commitede9a03405fb4ae78bf5542e0d629111fb340fc6 (patch)
tree6b8b26a5734a63012ba9da9ce195a2f3a4da5eb6
parent9636882c1e890c7d6dda6b974b9765bebe3f880a (diff)
downloadredmine-ede9a03405fb4ae78bf5542e0d629111fb340fc6.tar.gz
redmine-ede9a03405fb4ae78bf5542e0d629111fb340fc6.zip
Removed TabularFormBuilder references in views.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8142 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb14
-rw-r--r--app/views/issue_statuses/edit.html.erb2
-rw-r--r--app/views/issue_statuses/new.html.erb2
-rw-r--r--app/views/issues/_attributes.html.erb2
-rw-r--r--app/views/issues/_edit.html.erb2
-rw-r--r--app/views/my/account.html.erb4
-rw-r--r--app/views/projects/settings/_repository.html.erb6
-rw-r--r--app/views/projects/settings/_wiki.html.erb6
-rw-r--r--app/views/trackers/edit.html.erb2
-rw-r--r--app/views/trackers/new.html.erb2
-rw-r--r--app/views/users/_general.html.erb2
-rw-r--r--app/views/users/_preferences.html.erb2
-rw-r--r--app/views/users/new.html.erb2
13 files changed, 28 insertions, 20 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 58e1cf8ec..ddfc44a8c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -882,6 +882,20 @@ module ApplicationHelper
form_for(*args, &proc)
end
+ def labelled_fields_for(*args, &proc)
+ args << {} unless args.last.is_a?(Hash)
+ options = args.last
+ options.merge!({:builder => TabularFormBuilder})
+ fields_for(*args, &proc)
+ end
+
+ def labelled_remote_form_for(*args, &proc)
+ args << {} unless args.last.is_a?(Hash)
+ options = args.last
+ options.merge!({:builder => TabularFormBuilder})
+ remote_form_for(*args, &proc)
+ end
+
def back_url_hidden_field_tag
back_url = params[:back_url] || request.env['HTTP_REFERER']
back_url = CGI.unescape(back_url.to_s)
diff --git a/app/views/issue_statuses/edit.html.erb b/app/views/issue_statuses/edit.html.erb
index 82a1a2e55..584fe06a9 100644
--- a/app/views/issue_statuses/edit.html.erb
+++ b/app/views/issue_statuses/edit.html.erb
@@ -1,6 +1,6 @@
<h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> &#187; <%=h @issue_status %></h2>
-<% form_for @issue_status, :builder => TabularFormBuilder do |f| %>
+<% labelled_form_for @issue_status do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_save) %>
<% end %>
diff --git a/app/views/issue_statuses/new.html.erb b/app/views/issue_statuses/new.html.erb
index cefd493b4..6ab77b214 100644
--- a/app/views/issue_statuses/new.html.erb
+++ b/app/views/issue_statuses/new.html.erb
@@ -1,6 +1,6 @@
<h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> &#187; <%=l(:label_issue_status_new)%></h2>
-<% form_for @issue_status, :builder => TabularFormBuilder do |f| %>
+<% labelled_form_for @issue_status do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %>
<% end %>
diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb
index 76bb624a3..c4a087dae 100644
--- a/app/views/issues/_attributes.html.erb
+++ b/app/views/issues/_attributes.html.erb
@@ -1,4 +1,4 @@
-<% fields_for :issue, @issue, :builder => TabularFormBuilder do |f| %>
+<% labelled_fields_for :issue, @issue do |f| %>
<div class="splitcontentleft">
<% if @issue.new_record? || @allowed_statuses.any? %>
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index 022d159f1..ffffeb175 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -8,7 +8,7 @@
<% end %>
<% if User.current.allowed_to?(:log_time, @project) %>
<fieldset class="tabular"><legend><%= l(:button_log_time) %></legend>
- <% fields_for :time_entry, @time_entry, { :builder => TabularFormBuilder, :lang => current_language} do |time_entry| %>
+ <% labelled_fields_for :time_entry, @time_entry do |time_entry| %>
<div class="splitcontentleft">
<p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p>
</div>
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index e3bcd4504..f59c3dd1d 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -6,9 +6,7 @@
<h2><%=l(:label_my_account)%></h2>
<%= error_messages_for 'user' %>
-<% form_for :user, @user, :url => { :action => "account" },
- :builder => TabularFormBuilder,
- :lang => current_language,
+<% labelled_form_for :user, @user, :url => { :action => "account" },
:html => { :id => 'my_account_form' } do |f| %>
<div class="splitcontentleft">
<fieldset class="box tabular">
diff --git a/app/views/projects/settings/_repository.html.erb b/app/views/projects/settings/_repository.html.erb
index cba6c4e16..bbfc105de 100644
--- a/app/views/projects/settings/_repository.html.erb
+++ b/app/views/projects/settings/_repository.html.erb
@@ -1,7 +1,5 @@
-<% remote_form_for :repository, @repository,
- :url => { :controller => 'repositories', :action => 'edit', :id => @project },
- :builder => TabularFormBuilder,
- :lang => current_language do |f| %>
+<% labelled_remote_form_for :repository, @repository,
+ :url => { :controller => 'repositories', :action => 'edit', :id => @project } do |f| %>
<%= error_messages_for 'repository' %>
diff --git a/app/views/projects/settings/_wiki.html.erb b/app/views/projects/settings/_wiki.html.erb
index 00da93039..e627adc07 100644
--- a/app/views/projects/settings/_wiki.html.erb
+++ b/app/views/projects/settings/_wiki.html.erb
@@ -1,7 +1,5 @@
-<% remote_form_for :wiki, @wiki,
- :url => { :controller => 'wikis', :action => 'edit', :id => @project },
- :builder => TabularFormBuilder,
- :lang => current_language do |f| %>
+<% labelled_remote_form_for :wiki, @wiki,
+ :url => { :controller => 'wikis', :action => 'edit', :id => @project } do |f| %>
<%= error_messages_for 'wiki' %>
diff --git a/app/views/trackers/edit.html.erb b/app/views/trackers/edit.html.erb
index d7ba2591c..b553704a0 100644
--- a/app/views/trackers/edit.html.erb
+++ b/app/views/trackers/edit.html.erb
@@ -1,5 +1,5 @@
<h2><%= link_to l(:label_tracker_plural), trackers_path %> &#187; <%=h @tracker %></h2>
-<% form_for @tracker, :builder => TabularFormBuilder do |f| %>
+<% labelled_form_for @tracker do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<% end %>
diff --git a/app/views/trackers/new.html.erb b/app/views/trackers/new.html.erb
index 93b0bc1ae..e48525793 100644
--- a/app/views/trackers/new.html.erb
+++ b/app/views/trackers/new.html.erb
@@ -1,5 +1,5 @@
<h2><%= link_to l(:label_tracker_plural), trackers_path %> &#187; <%=l(:label_tracker_new)%></h2>
-<% form_for @tracker, :builder => TabularFormBuilder do |f| %>
+<% labelled_form_for @tracker do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<% end %>
diff --git a/app/views/users/_general.html.erb b/app/views/users/_general.html.erb
index de81e0365..b332e856e 100644
--- a/app/views/users/_general.html.erb
+++ b/app/views/users/_general.html.erb
@@ -1,4 +1,4 @@
-<% form_for @user, :builder => TabularFormBuilder do |f| %>
+<% labelled_form_for @user do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<% if @user.active? && email_delivery_enabled? -%>
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
diff --git a/app/views/users/_preferences.html.erb b/app/views/users/_preferences.html.erb
index 57f050b10..a5a0e5cb1 100644
--- a/app/views/users/_preferences.html.erb
+++ b/app/views/users/_preferences.html.erb
@@ -1,4 +1,4 @@
-<% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %>
+<% labelled_fields_for :pref, @user.pref do |pref_fields| %>
<p><%= pref_fields.check_box :hide_mail %></p>
<p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p>
<p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
index fc58b0988..eb8a9f93d 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -1,6 +1,6 @@
<h2><%= link_to l(:label_user_plural), users_path %> &#187; <%=l(:label_user_new)%></h2>
-<% form_for @user, :builder => TabularFormBuilder do |f| %>
+<% labelled_form_for @user do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<% if email_delivery_enabled? %>
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>