To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / projects / _form.html.erb @ 1591:63650ae64bf2
History | View | Annotate | Download (4.65 KB)
| 1 |
<%= error_messages_for 'project' %>
|
|---|---|
| 2 |
|
| 3 |
<div class="box tabular"> |
| 4 |
<!--[form:project]-->
|
| 5 |
<p><%= f.text_field :name, :required => true, :size => 60 %> |
| 6 |
<br /> |
| 7 |
<em class="info"> <%= l(:text_project_name_info).html_safe %></em> |
| 8 |
</p>
|
| 9 |
|
| 10 |
<p><%= f.text_area :description, :rows => 8, :class => 'wiki-edit' %></p> |
| 11 |
<p><%= f.text_field :identifier, :required => true, :size => 60, :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %> |
| 12 |
<% unless @project.identifier_frozen? %>
|
| 13 |
<br /> |
| 14 |
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em> |
| 15 |
<% end %></p> |
| 16 |
|
| 17 |
<p><%= f.text_field :homepage, :size => 60 %> |
| 18 |
<br /> |
| 19 |
<em class="info"> <%= l(:text_project_homepage_info) %></em> |
| 20 |
</p>
|
| 21 |
<p>
|
| 22 |
<label for="project_is_public_1"><%= l(:field_public_or_private)%> <span class="required">*</span></label> |
| 23 |
<%
|
| 24 |
# if the project hasn't been created fully yet, then we don't
|
| 25 |
# want to set either public or private (make the user decide)
|
| 26 |
initialised = !@project.id.nil?
|
| 27 |
%>
|
| 28 |
<%= f.radio_button :is_public, 1, :checked => (initialised && @project.is_public?) %>
|
| 29 |
<%= l(:text_project_public_info) %>
|
| 30 |
<br /> |
| 31 |
<%= f.radio_button :is_public, 0, :checked => (initialised && !@project.is_public?) %>
|
| 32 |
<%= l(:text_project_private_info) %>
|
| 33 |
<br>
|
| 34 |
<em class="info"><%= l(:text_project_visibility_info) %></em> |
| 35 |
</p>
|
| 36 |
|
| 37 |
<% unless @project.allowed_parents.compact.empty? %>
|
| 38 |
<p><%= label(:project, :parent_id, l(:field_parent)) %><%= parent_project_select_tag(@project) %></p> |
| 39 |
<% end %>
|
| 40 |
|
| 41 |
<% if @project.safe_attribute? 'inherit_members' %>
|
| 42 |
<p><%= f.check_box :inherit_members %></p> |
| 43 |
<% end %>
|
| 44 |
|
| 45 |
<%= wikitoolbar_for 'project_description' %>
|
| 46 |
|
| 47 |
<% @project.custom_field_values.each do |value| %>
|
| 48 |
<p><%= custom_field_tag_with_label :project, value %></p> |
| 49 |
<% end %>
|
| 50 |
<%= call_hook(:view_projects_form, :project => @project, :form => f) %>
|
| 51 |
</div>
|
| 52 |
|
| 53 |
<% if @project.new_record? %>
|
| 54 |
<fieldset class="box tabular"><legend><%= l(:label_module_plural) %></legend> |
| 55 |
<% Redmine::AccessControl.available_project_modules.each do |m| %>
|
| 56 |
<label class="floating"> |
| 57 |
<%= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m), :id => "project_enabled_module_names_#{m}" %>
|
| 58 |
<%= l_or_humanize(m, :prefix => "project_module_") %>
|
| 59 |
</label>
|
| 60 |
<% end %>
|
| 61 |
<%= hidden_field_tag 'project[enabled_module_names][]', '' %>
|
| 62 |
</fieldset>
|
| 63 |
<% end %>
|
| 64 |
|
| 65 |
<% if @project.new_record? %>
|
| 66 |
<% @trackers.each do |tracker| %>
|
| 67 |
<%= hidden_field_tag 'project[tracker_ids][]', tracker.id %>
|
| 68 |
<% end %>
|
| 69 |
<%= hidden_field_tag 'project[tracker_ids][]', '' %>
|
| 70 |
<% elsif @project.module_enabled?('issue_tracking') %>
|
| 71 |
<% unless @trackers.empty? %>
|
| 72 |
<fieldset class="box tabular" id="project_trackers"><legend><%=l(:label_tracker_plural)%></legend> |
| 73 |
<% @trackers.each do |tracker| %>
|
| 74 |
<label class="floating"> |
| 75 |
<%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker), :id => nil %>
|
| 76 |
<%=h tracker %>
|
| 77 |
</label>
|
| 78 |
<% end %>
|
| 79 |
<%= hidden_field_tag 'project[tracker_ids][]', '' %>
|
| 80 |
</fieldset>
|
| 81 |
<% end %>
|
| 82 |
|
| 83 |
<% unless @issue_custom_fields.empty? %>
|
| 84 |
<fieldset class="box tabular" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend> |
| 85 |
<% @issue_custom_fields.each do |custom_field| %>
|
| 86 |
<label class="floating"> |
| 87 |
<%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field),
|
| 88 |
:disabled => (custom_field.is_for_all? ? "disabled" : nil),
|
| 89 |
:id => nil %>
|
| 90 |
<%=h custom_field.name %>
|
| 91 |
</label>
|
| 92 |
<% end %>
|
| 93 |
<%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
|
| 94 |
</fieldset>
|
| 95 |
<% end %>
|
| 96 |
<% end %>
|
| 97 |
<!--[eoform:project]-->
|
| 98 |
|
| 99 |
<% unless @project.identifier_frozen? %>
|
| 100 |
<% content_for :header_tags do %>
|
| 101 |
<%= javascript_include_tag 'project_identifier' %>
|
| 102 |
<% end %>
|
| 103 |
<% end %>
|
| 104 |
|
| 105 |
<% if !User.current.admin? && @project.inherit_members? && @project.parent && User.current.member_of?(@project.parent) %>
|
| 106 |
<%= javascript_tag do %>
|
| 107 |
$(document).ready(function() {
|
| 108 |
$("#project_inherit_members").change(function(){
|
| 109 |
if (!$(this).is(':checked')) {
|
| 110 |
if (!confirm("<%= escape_javascript(l(:text_own_membership_delete_confirmation)) %>")) {
|
| 111 |
$("#project_inherit_members").attr("checked", true);
|
| 112 |
} |
| 113 |
} |
| 114 |
}); |
| 115 |
}); |
| 116 |
<% end %>
|
| 117 |
<% end %>
|
| 118 |
|
| 119 |
<%= javascript_tag do %>
|
| 120 |
$(document).ready(function() {
|
| 121 |
$('#project_enabled_module_names_issue_tracking').on('change', function(){
|
| 122 |
if ($(this).attr('checked')){
|
| 123 |
$('#project_trackers, #project_issue_custom_fields').show();
|
| 124 |
} else {
|
| 125 |
$('#project_trackers, #project_issue_custom_fields').hide();
|
| 126 |
} |
| 127 |
}).trigger('change');
|
| 128 |
}); |
| 129 |
<% end %>
|