Commit 50affc9e authored by jplang's avatar jplang

Project settings: Move issue tracking settings to their own tab (#26488).

git-svn-id: https://svn.redmine.org/redmine/trunk@16896 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent dadb63d3
......@@ -189,7 +189,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_to settings_project_path(@project)
redirect_to settings_project_path(@project, params[:tab])
}
format.api { render_api_ok }
end
......
......@@ -21,6 +21,7 @@ module ProjectsHelper
def project_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural},
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural},
{:name => 'issues', :action => :edit_project, :partial => 'projects/settings/issues', :label => :label_issue_tracking},
{:name => 'versions', :action => :manage_versions, :partial => 'projects/settings/versions', :label => :label_version_plural,
:url => {:tab => 'versions', :version_status => params[:version_status], :version_name => params[:version_name]}},
{:name => 'categories', :action => :manage_categories, :partial => 'projects/settings/issue_categories', :label => :label_issue_category_plural},
......
......@@ -20,14 +20,6 @@
<p><%= f.check_box :inherit_members %></p>
<% end %>
<% if @project.safe_attribute?('default_version_id') && (default_version_options = project_default_version_options(@project)).present? %>
<p><%= f.select :default_version_id, project_default_version_options(@project), :include_blank => true %></p>
<% end %>
<% if @project.safe_attribute?('default_assigned_to_id') && (default_assigned_to_options = project_default_assigned_to_options(@project)).present? %>
<p><%= f.select :default_assigned_to_id, default_assigned_to_options, include_blank: true %></p>
<% end %>
<%= wikitoolbar_for 'project_description' %>
<% @project.custom_field_values.each do |value| %>
......@@ -47,34 +39,6 @@
<%= hidden_field_tag 'project[enabled_module_names][]', '' %>
</fieldset>
<% end %>
<% if @project.new_record? || @project.module_enabled?('issue_tracking') %>
<% unless @trackers.empty? %>
<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.to_a.include?(tracker), :id => nil %>
<%= tracker %>
</label>
<% end %>
<%= hidden_field_tag 'project[tracker_ids][]', '' %>
</fieldset>
<% end %>
<% unless @issue_custom_fields.empty? %>
<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),
:disabled => (custom_field.is_for_all? ? "disabled" : nil),
:id => nil %>
<%= custom_field_name_tag(custom_field) %>
</label>
<% end %>
<%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
</fieldset>
<% end %>
<% end %>
<!--[eoform:project]-->
<% unless @project.identifier_frozen? %>
......@@ -96,15 +60,3 @@
});
<% end %>
<% end %>
<%= javascript_tag do %>
$(document).ready(function() {
$('#project_enabled_module_names_issue_tracking').on('change', function(){
if ($(this).prop('checked')){
$('#project_trackers, #project_issue_custom_fields').show();
} else {
$('#project_trackers, #project_issue_custom_fields').hide();
}
}).trigger('change');
});
<% end %>
......@@ -16,5 +16,13 @@
<label class="block"><%= check_box_tag 'notifications', 1, params[:notifications] %> <%= l(:label_project_copy_notifications) %></label>
</fieldset>
<% @project.tracker_ids.each do |tracker_id| %>
<%= hidden_field_tag 'project[tracker_ids][]', tracker_id %>
<% end %>
<% @project.issue_custom_field_ids.each do |issue_custom_field_id| %>
<%= hidden_field_tag 'project[issue_custom_field_ids][]', issue_custom_field_id %>
<% end %>
<%= submit_tag l(:button_copy) %>
<% end %>
<%= labelled_form_for @project do |f| %>
<%= hidden_field_tag 'tab', 'issues' %>
<% unless @trackers.empty? %>
<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.to_a.include?(tracker), :id => nil %>
<%= tracker %>
</label>
<% end %>
<%= hidden_field_tag 'project[tracker_ids][]', '' %>
</fieldset>
<% end %>
<% unless @issue_custom_fields.empty? %>
<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),
:disabled => (custom_field.is_for_all? ? "disabled" : nil),
:id => nil %>
<%= custom_field_name_tag(custom_field) %>
</label>
<% end %>
<%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
</fieldset>
<% end %>
<div class="box tabular">
<% if @project.safe_attribute?('default_version_id') %>
<p><%= f.select :default_version_id, project_default_version_options(@project), include_blank: l(:label_none) %></p>
<% end %>
<% if @project.safe_attribute?('default_assigned_to_id') %>
<p><%= f.select :default_assigned_to_id, project_default_assigned_to_options(@project), include_blank: l(:label_none) %></p>
<% end %>
</div>
<p><%= submit_tag l(:button_save) %></p>
<% end %>
......@@ -879,10 +879,8 @@ class ProjectsControllerTest < Redmine::ControllerTest
:id => source.id
}
assert_response :success
assert_select 'fieldset#project_issue_custom_fields' do
assert_select 'input[type=checkbox][value=?][checked=checked]', field1.id.to_s
assert_select 'input[type=checkbox][value=?]:not([checked])', field2.id.to_s
end
assert_select 'input[type=hidden][name=?][value=?]', 'project[issue_custom_field_ids][]', field1.id.to_s
assert_select 'input[type=hidden][name=?][value=?]', 'project[issue_custom_field_ids][]', field2.id.to_s, 0
end
def test_post_copy_should_copy_requested_items
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment