##// END OF EJS Templates
Prevents one query per tracker....
Jean-Philippe Lang -
r13161:b3f377dfc471
parent child
Show More
@@ -1,102 +1,102
1 1 <%= error_messages_for 'project' %>
2 2
3 3 <div class="box tabular">
4 4 <!--[form:project]-->
5 5 <p><%= f.text_field :name, :required => true, :size => 60 %></p>
6 6
7 7 <p><%= f.text_area :description, :rows => 8, :class => 'wiki-edit' %></p>
8 8 <p><%= f.text_field :identifier, :required => true, :size => 60, :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %>
9 9 <% unless @project.identifier_frozen? %>
10 10 <em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
11 11 <% end %></p>
12 12 <p><%= f.text_field :homepage, :size => 60 %></p>
13 13 <p><%= f.check_box :is_public %></p>
14 14
15 15 <% unless @project.allowed_parents.compact.empty? %>
16 16 <p><%= label(:project, :parent_id, l(:field_parent)) %><%= parent_project_select_tag(@project) %></p>
17 17 <% end %>
18 18
19 19 <% if @project.safe_attribute? 'inherit_members' %>
20 20 <p><%= f.check_box :inherit_members %></p>
21 21 <% end %>
22 22
23 23 <%= wikitoolbar_for 'project_description' %>
24 24
25 25 <% @project.custom_field_values.each do |value| %>
26 26 <p><%= custom_field_tag_with_label :project, value %></p>
27 27 <% end %>
28 28 <%= call_hook(:view_projects_form, :project => @project, :form => f) %>
29 29 </div>
30 30
31 31 <% if @project.new_record? %>
32 32 <fieldset class="box tabular"><legend><%= l(:label_module_plural) %></legend>
33 33 <% Redmine::AccessControl.available_project_modules.each do |m| %>
34 34 <label class="floating">
35 35 <%= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m), :id => "project_enabled_module_names_#{m}" %>
36 36 <%= l_or_humanize(m, :prefix => "project_module_") %>
37 37 </label>
38 38 <% end %>
39 39 <%= hidden_field_tag 'project[enabled_module_names][]', '' %>
40 40 </fieldset>
41 41 <% end %>
42 42
43 43 <% if @project.new_record? || @project.module_enabled?('issue_tracking') %>
44 44 <% unless @trackers.empty? %>
45 45 <fieldset class="box tabular" id="project_trackers"><legend><%=l(:label_tracker_plural)%></legend>
46 46 <% @trackers.each do |tracker| %>
47 47 <label class="floating">
48 <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker), :id => nil %>
48 <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.to_a.include?(tracker), :id => nil %>
49 49 <%=h tracker %>
50 50 </label>
51 51 <% end %>
52 52 <%= hidden_field_tag 'project[tracker_ids][]', '' %>
53 53 </fieldset>
54 54 <% end %>
55 55
56 56 <% unless @issue_custom_fields.empty? %>
57 57 <fieldset class="box tabular" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend>
58 58 <% @issue_custom_fields.each do |custom_field| %>
59 59 <label class="floating">
60 60 <%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field),
61 61 :disabled => (custom_field.is_for_all? ? "disabled" : nil),
62 62 :id => nil %>
63 63 <%=h custom_field.name %>
64 64 </label>
65 65 <% end %>
66 66 <%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
67 67 </fieldset>
68 68 <% end %>
69 69 <% end %>
70 70 <!--[eoform:project]-->
71 71
72 72 <% unless @project.identifier_frozen? %>
73 73 <% content_for :header_tags do %>
74 74 <%= javascript_include_tag 'project_identifier' %>
75 75 <% end %>
76 76 <% end %>
77 77
78 78 <% if !User.current.admin? && @project.inherit_members? && @project.parent && User.current.member_of?(@project.parent) %>
79 79 <%= javascript_tag do %>
80 80 $(document).ready(function() {
81 81 $("#project_inherit_members").change(function(){
82 82 if (!$(this).is(':checked')) {
83 83 if (!confirm("<%= escape_javascript(l(:text_own_membership_delete_confirmation)) %>")) {
84 84 $("#project_inherit_members").attr("checked", true);
85 85 }
86 86 }
87 87 });
88 88 });
89 89 <% end %>
90 90 <% end %>
91 91
92 92 <%= javascript_tag do %>
93 93 $(document).ready(function() {
94 94 $('#project_enabled_module_names_issue_tracking').on('change', function(){
95 95 if ($(this).prop('checked')){
96 96 $('#project_trackers, #project_issue_custom_fields').show();
97 97 } else {
98 98 $('#project_trackers, #project_issue_custom_fields').hide();
99 99 }
100 100 }).trigger('change');
101 101 });
102 102 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now