Use #labelled_form_for instead of #labelled_tabular_form_for.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8141 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-12-09 18:15:55 +00:00
parent 312ffe43c7
commit 9636882c1e
23 changed files with 31 additions and 30 deletions

View File

@ -866,6 +866,7 @@ module ApplicationHelper
end
def labelled_tabular_form_for(*args, &proc)
ActiveSupport::Deprecation.warn "ApplicationHelper#labelled_tabular_form_for is deprecated and will be removed in Redmine 1.5. Use #labelled_form_for instead."
args << {} unless args.last.is_a?(Hash)
options = args.last
options[:html] ||= {}

View File

@ -60,7 +60,7 @@ function toggle_custom_field_format() {
//]]>
</script>
<div class="box">
<div class="box tabular">
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :onchange => "toggle_custom_field_format();",
:disabled => !@custom_field.new_record? %></p>
@ -76,7 +76,7 @@ function toggle_custom_field_format() {
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
</div>
<div class="box">
<div class="box tabular">
<% case @custom_field.class.name
when "IssueCustomField" %>

View File

@ -2,7 +2,7 @@
&#187; <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %>
&#187; <%=h @custom_field.name %></h2>
<% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "edit", :id => @custom_field } do |f| %>
<% labelled_form_for :custom_field, @custom_field, :url => { :action => "edit", :id => @custom_field } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -2,7 +2,7 @@
&#187; <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %>
&#187; <%= l(:label_custom_field_new) %></h2>
<% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "new" } do |f| %>
<% labelled_form_for :custom_field, @custom_field, :url => { :action => "new" } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= hidden_field_tag 'type', @custom_field.type %>
<%= submit_tag l(:button_save) %>

View File

@ -1,6 +1,6 @@
<%= error_messages_for 'category' %>
<div class="box">
<div class="box tabular">
<p><%= f.text_field :name, :size => 30, :required => true %></p>
<p><%= f.select :assigned_to_id, principals_options_for_select(@project.assignable_users, @category.assigned_to), :include_blank => true %></p>
</div>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_issue_category)%></h2>
<% labelled_tabular_form_for :issue_category, @category, :url => issue_category_path(@category), :html => {:method => :put} do |f| %>
<% labelled_form_for :issue_category, @category, :url => issue_category_path(@category), :html => {:method => :put} do |f| %>
<%= render :partial => 'issue_categories/form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_issue_category_new)%></h2>
<% labelled_tabular_form_for :issue_category, @category, :url => project_issue_categories_path(@project) do |f| %>
<% labelled_form_for :issue_category, @category, :url => project_issue_categories_path(@project) do |f| %>
<%= render :partial => 'issue_categories/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<% end %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_news)%></h2>
<% labelled_tabular_form_for @news, :html => { :id => 'news-form', :method => :put } do |f| %>
<% labelled_form_for @news, :html => { :id => 'news-form', :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= link_to_remote l(:label_preview),

View File

@ -7,7 +7,7 @@
<div id="add-news" style="display:none;">
<h2><%=l(:label_news_new)%></h2>
<% labelled_tabular_form_for @news, :url => project_news_index_path(@project),
<% labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form' } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_news_new)%></h2>
<% labelled_tabular_form_for @news, :url => project_news_index_path(@project),
<% labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form' } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>

View File

@ -16,7 +16,7 @@
<% if authorize_for('news', 'edit') %>
<div id="edit-news" style="display:none;">
<% labelled_tabular_form_for :news, @news, :url => news_path(@news),
<% labelled_form_for :news, @news, :url => news_path(@news),
:html => { :id => 'news-form', :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>

View File

@ -1,4 +1,4 @@
<% labelled_tabular_form_for @project do |f| %>
<% labelled_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<%= error_messages_for 'project' %>
<div class="box">
<div class="box tabular">
<!--[form:project]-->
<p><%= f.text_field :name, :required => true, :size => 60 %></p>
@ -24,7 +24,7 @@
</div>
<% if @project.new_record? %>
<fieldset class="box"><legend><%= l(:label_module_plural) %></legend>
<fieldset class="box tabular"><legend><%= l(:label_module_plural) %></legend>
<% Redmine::AccessControl.available_project_modules.each do |m| %>
<label class="floating">
<%= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m), :id => "project_enabled_module_names_#{m}" %>
@ -38,7 +38,7 @@
<% if @project.new_record? || @project.module_enabled?('issue_tracking') %>
<% unless @trackers.empty? %>
<fieldset class="box" id="project_trackers"><legend><%=l(:label_tracker_plural)%></legend>
<fieldset class="box tabular" id="project_trackers"><legend><%=l(:label_tracker_plural)%></legend>
<% @trackers.each do |tracker| %>
<label class="floating">
<%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
@ -50,7 +50,7 @@
<% end %>
<% unless @issue_custom_fields.empty? %>
<fieldset class="box" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend>
<fieldset class="box tabular" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend>
<% @issue_custom_fields.each do |custom_field| %>
<label class="floating">
<%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>

View File

@ -1,9 +1,9 @@
<h2><%=l(:label_project_new)%></h2>
<% labelled_tabular_form_for @project, :url => { :action => "copy" } do |f| %>
<% labelled_form_for @project, :url => { :action => "copy" } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<fieldset class="box"><legend><%= l(:button_copy) %></legend>
<fieldset class="box tabular"><legend><%= l(:button_copy) %></legend>
<label class="block"><%= check_box_tag 'only[]', 'members', true %> <%= l(:label_member_plural) %> (<%= @source_project.members.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'versions', true %> <%= l(:label_version_plural) %> (<%= @source_project.versions.count %>)</label>
<label class="block"><%= check_box_tag 'only[]', 'issue_categories', true %> <%= l(:label_issue_category_plural) %> (<%= @source_project.issue_categories.count %>)</label>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_project_new)%></h2>
<% labelled_tabular_form_for @project do |f| %>
<% labelled_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>

View File

@ -1,6 +1,6 @@
<%= error_messages_for 'role' %>
<div class="box">
<div class="box tabular">
<% unless @role.builtin? %>
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.check_box :assignable %></p>
@ -13,7 +13,7 @@
</div>
<h3><%= l(:label_permissions) %></h3>
<div class="box" id="permissions">
<div class="box tabular" id="permissions">
<% perms_by_module = @permissions.group_by {|p| p.project_module.to_s} %>
<% perms_by_module.keys.sort.each do |mod| %>
<fieldset><legend><%= mod.blank? ? l(:label_project) : l_or_humanize(mod, :prefix => 'project_module_') %></legend>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_role_plural), :controller => 'roles', :action => 'index' %> &#187; <%=h @role.name %></h2>
<% labelled_tabular_form_for :role, @role, :url => { :action => 'edit' }, :html => {:id => 'role_form'} do |f| %>
<% labelled_form_for :role, @role, :url => { :action => 'edit' }, :html => {:id => 'role_form'} do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_role_plural), :controller => 'roles', :action => 'index' %> &#187; <%=l(:label_role_new)%></h2>
<% labelled_tabular_form_for :role, @role, :url => { :action => 'new' }, :html => {:id => 'role_form'} do |f| %>
<% labelled_form_for :role, @role, :url => { :action => 'new' }, :html => {:id => 'role_form'} do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<% end %>

View File

@ -1,6 +1,6 @@
<h2><%= l(:label_spent_time) %></h2>
<% labelled_tabular_form_for(:time_entry, @time_entry, :url => {
<% labelled_form_for(:time_entry, @time_entry, :url => {
:action => (@time_entry.new_record? ? 'create' : 'update'),
:id => @time_entry,
:project_id => @time_entry.project
@ -9,7 +9,7 @@
<%= error_messages_for 'time_entry' %>
<%= back_url_hidden_field_tag %>
<div class="box">
<div class="box tabular">
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
<p><%= f.text_field :hours, :size => 6, :required => true %></p>

View File

@ -1,7 +1,7 @@
<%= back_url_hidden_field_tag %>
<%= error_messages_for 'version' %>
<div class="box">
<div class="box tabular">
<p><%= f.text_field :name, :size => 60, :required => true %></p>
<p><%= f.text_field :description, :size => 60 %></p>
<p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_version)%></h2>
<% labelled_tabular_form_for @version do |f| %>
<% labelled_form_for @version do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_version_new)%></h2>
<% labelled_tabular_form_for @version, :url => project_versions_path(@project) do |f| %>
<% labelled_form_for @version, :url => project_versions_path(@project) do |f| %>
<%= render :partial => 'versions/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<% end %>

View File

@ -4,8 +4,8 @@
<%= error_messages_for 'page' %>
<% labelled_tabular_form_for :wiki_page, @page, :url => { :action => 'rename' } do |f| %>
<div class="box">
<% labelled_form_for :wiki_page, @page, :url => { :action => 'rename' } do |f| %>
<div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 100 %></p>
<p><%= f.check_box :redirect_existing_links %></p>
<p><%= f.select :parent_id, "<option value=''></option>" + wiki_page_options_for_select(@wiki.pages.all(:include => :parent) - @page.self_and_descendants, @page.parent), :label => :field_parent_title %></p>