Commit 3c24e65e authored by jplang's avatar jplang

Removes the Modules tab in project settings (#26488).

Modules can now be select on the first tab, just like when creating a project.

git-svn-id: https://svn.redmine.org/redmine/trunk@16892 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 8bfa52d5
......@@ -204,12 +204,6 @@ class ProjectsController < ApplicationController
end
end
def modules
@project.enabled_module_names = params[:enabled_module_names]
flash[:notice] = l(:notice_successful_update)
redirect_to settings_project_path(@project, :tab => 'modules')
end
def archive
unless @project.archive
flash[:error] = l(:error_can_not_archive_project)
......
......@@ -20,7 +20,6 @@
module ProjectsHelper
def project_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural},
{:name => 'modules', :action => :select_project_modules, :partial => 'projects/settings/modules', :label => :label_module_plural},
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural},
{: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]}},
......
......@@ -36,7 +36,7 @@
<%= call_hook(:view_projects_form, :project => @project, :form => f) %>
</div>
<% if @project.new_record? && @project.safe_attribute?('enabled_module_names') %>
<% if @project.safe_attribute?('enabled_module_names') %>
<fieldset class="box tabular"><legend><%= l(:label_module_plural) %></legend>
<% Redmine::AccessControl.available_project_modules.each do |m| %>
<label class="floating">
......
<%= form_for @project,
:url => { :action => 'modules', :id => @project },
:html => {:id => 'modules-form',
:method => :post} do |f| %>
<fieldset class="box">
<legend><%= l(:text_select_project_modules) %></legend>
<% Redmine::AccessControl.available_project_modules.each do |m| %>
<p><label><%= check_box_tag 'enabled_module_names[]', m, @project.module_enabled?(m), :id => nil -%>
<%= l_or_humanize(m, :prefix => "project_module_") %></label></p>
<% end %>
</fieldset>
<p><%= check_all_links 'modules-form' %></p>
<p><%= submit_tag l(:button_save) %></p>
<% end %>
......@@ -107,7 +107,6 @@ Rails.application.routes.draw do
member do
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
post 'modules'
post 'archive'
post 'unarchive'
post 'close'
......
......@@ -730,15 +730,17 @@ class ProjectsControllerTest < Redmine::ControllerTest
assert_match /Successful update/, flash[:notice]
end
def test_modules
def test_update_modules
@request.session[:user_id] = 2
Project.find(1).enabled_module_names = ['issue_tracking', 'news']
post :modules, :params => {
post :update, :params => {
:id => 1,
:enabled_module_names => ['issue_tracking', 'repository', 'documents']
:project => {
:enabled_module_names => ['issue_tracking', 'repository', 'documents']
}
}
assert_redirected_to '/projects/ecookbook/settings/modules'
assert_redirected_to '/projects/ecookbook/settings'
assert_equal ['documents', 'issue_tracking', 'repository'], Project.find(1).enabled_module_names.sort
end
......
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