diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-06 21:02:19 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-06 21:02:19 +0000 |
commit | 88d65c514927094e348010d31fa17fcd2a60bd69 (patch) | |
tree | 65938090fdec5eacb6dbee6b3ace36dc0ba9c420 /app | |
parent | 9222cf91eab448a2f5177f4ce6b40924f0df252c (diff) | |
download | redmine-88d65c514927094e348010d31fa17fcd2a60bd69.tar.gz redmine-88d65c514927094e348010d31fa17fcd2a60bd69.zip |
Do not show trackers and issue custom fields on project form when issue tracking is disabled (#7225).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4648 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/views/projects/_form.rhtml | 19 | ||||
-rw-r--r-- | app/views/projects/new.html.erb | 12 |
2 files changed, 17 insertions, 14 deletions
diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml index e8045bf2c..9772a899c 100644 --- a/app/views/projects/_form.rhtml +++ b/app/views/projects/_form.rhtml @@ -23,8 +23,22 @@ <%= call_hook(:view_projects_form, :project => @project, :form => f) %> </div> +<% if @project.new_record? %> +<fieldset class="box"><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}" %> + <%= l_or_humanize(m, :prefix => "project_module_") %> + </label> +<% end %> +<%= hidden_field_tag 'project[enabled_module_names][]', '' %> +<%= javascript_tag 'observeProjectModules()' %> +</fieldset> +<% end %> + +<% if @project.new_record? || @project.module_enabled?('issue_tracking') %> <% unless @trackers.empty? %> -<fieldset class="box"><legend><%=l(:label_tracker_plural)%></legend> +<fieldset class="box" 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) %> @@ -36,7 +50,7 @@ <% end %> <% unless @issue_custom_fields.empty? %> -<fieldset class="box"><legend><%=l(:label_custom_field_plural)%></legend> +<fieldset class="box" 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"} : {}) %> @@ -46,4 +60,5 @@ <%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %> </fieldset> <% end %> +<% end %> <!--[eoform:project]--> diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index 1b9907826..2642241bf 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -2,18 +2,6 @@ <% labelled_tabular_form_for :project, @project, :url => { :action => "create" } do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> - -<fieldset class="box"><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) %> - <%= l_or_humanize(m, :prefix => "project_module_") %> - </label> -<% end %> -<%= hidden_field_tag 'project[enabled_module_names][]', '' %> - -</fieldset> - <%= submit_tag l(:button_save) %> <%= javascript_tag "Form.Element.focus('project_name');" %> <% end %> |