summaryrefslogtreecommitdiffstats
path: root/app/views/projects/_form.html.erb
blob: 0e8978519b2a670ab65c70c9f335439c765f0160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<%= error_messages_for 'project' %>

<div class="box">
<!--[form:project]-->
<p><%= f.text_field :name, :required => true, :size => 60 %></p>

<% unless @project.allowed_parents.compact.empty? %>
    <p><%= label(:project, :parent_id, l(:field_parent)) %><%= parent_project_select_tag(@project) %></p>
<% end %>

<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
<p><%= f.text_field :identifier, :required => true, :size => 60, :disabled => @project.identifier_frozen? %>
<% unless @project.identifier_frozen? %>
<br /><em><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
<% end %></p>
<p><%= f.text_field :homepage, :size => 60 %></p>
<p><%= f.check_box :is_public %></p>
<%= wikitoolbar_for 'project_description' %>

<% @project.custom_field_values.each do |value| %>
  <p><%= custom_field_tag_with_label :project, value %></p>
<% end %>
<%= 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" 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) %>
    <%=h tracker %>
    </label>
<% end %>
<%= hidden_field_tag 'project[tracker_ids][]', '' %>
</fieldset>
<% end %>

<% unless @issue_custom_fields.empty? %>
<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"} : {}) %>
  <%=h custom_field.name %>
  </label>
<% end %>
<%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
</fieldset>
<% end %>
<% end %>
<!--[eoform:project]-->