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 / custom_fields / _form.html.erb @ 1531:ae8145b28b2b
History | View | Annotate | Download (4.26 KB)
| 1 |
<%= error_messages_for 'custom_field' %>
|
|---|---|
| 2 |
|
| 3 |
<div class="splitcontentleft"> |
| 4 |
<div class="box tabular"> |
| 5 |
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></p> |
| 6 |
<p><%= f.text_field :name, :required => true %></p> |
| 7 |
<p><%= f.text_area :description, :rows => 7 %></p> |
| 8 |
|
| 9 |
<% if @custom_field.format.multiple_supported %>
|
| 10 |
<p>
|
| 11 |
<%= f.check_box :multiple %>
|
| 12 |
<% if !@custom_field.new_record? && @custom_field.multiple %>
|
| 13 |
<em class="info"><%= l(:text_turning_multiple_off) %></em> |
| 14 |
<% end %>
|
| 15 |
</p>
|
| 16 |
<% end %>
|
| 17 |
|
| 18 |
<%= render_custom_field_format_partial f, @custom_field %>
|
| 19 |
|
| 20 |
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
|
| 21 |
</div>
|
| 22 |
<p><%= submit_tag l(:button_save) %></p> |
| 23 |
</div>
|
| 24 |
|
| 25 |
<div class="splitcontentright"> |
| 26 |
<div class="box tabular"> |
| 27 |
<% case @custom_field.class.name
|
| 28 |
when "IssueCustomField" %>
|
| 29 |
<p><%= f.check_box :is_required %></p> |
| 30 |
<p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p> |
| 31 |
<p><%= f.check_box :is_filter %></p> |
| 32 |
<% if @custom_field.format.searchable_supported %>
|
| 33 |
<p><%= f.check_box :searchable %></p> |
| 34 |
<% end %>
|
| 35 |
<p>
|
| 36 |
<label><%= l(:field_visible) %></label> |
| 37 |
<label class="block"> |
| 38 |
<%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on',
|
| 39 |
:data => {:disables => '.custom_field_role input'} %>
|
| 40 |
<%= l(:label_visibility_public) %>
|
| 41 |
</label>
|
| 42 |
<label class="block"> |
| 43 |
<%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off',
|
| 44 |
:data => {:enables => '.custom_field_role input'} %>
|
| 45 |
<%= l(:label_visibility_roles) %>:
|
| 46 |
</label>
|
| 47 |
<% Role.givable.sorted.each do |role| %>
|
| 48 |
<label class="block custom_field_role" style="padding-left:2em;"> |
| 49 |
<%= check_box_tag 'custom_field[role_ids][]', role.id, @custom_field.roles.include?(role), :id => nil %>
|
| 50 |
<%= role.name %>
|
| 51 |
</label>
|
| 52 |
<% end %>
|
| 53 |
<%= hidden_field_tag 'custom_field[role_ids][]', '' %>
|
| 54 |
</p>
|
| 55 |
|
| 56 |
<% when "UserCustomField" %>
|
| 57 |
<p><%= f.check_box :is_required %></p> |
| 58 |
<p><%= f.check_box :visible %></p> |
| 59 |
<p><%= f.check_box :editable %></p> |
| 60 |
<p><%= f.check_box :is_filter %></p> |
| 61 |
|
| 62 |
<% when "ProjectCustomField" %>
|
| 63 |
<p><%= f.check_box :is_required %></p> |
| 64 |
<p><%= f.check_box :visible %></p> |
| 65 |
<% if @custom_field.format.searchable_supported %>
|
| 66 |
<p><%= f.check_box :searchable %></p> |
| 67 |
<% end %>
|
| 68 |
<p><%= f.check_box :is_filter %></p> |
| 69 |
|
| 70 |
<% when "VersionCustomField" %>
|
| 71 |
<p><%= f.check_box :is_required %></p> |
| 72 |
<p><%= f.check_box :is_filter %></p> |
| 73 |
|
| 74 |
<% when "GroupCustomField" %>
|
| 75 |
<p><%= f.check_box :is_required %></p> |
| 76 |
<p><%= f.check_box :is_filter %></p> |
| 77 |
|
| 78 |
<% when "TimeEntryCustomField" %>
|
| 79 |
<p><%= f.check_box :is_required %></p> |
| 80 |
<p><%= f.check_box :is_filter %></p> |
| 81 |
|
| 82 |
<% else %>
|
| 83 |
<p><%= f.check_box :is_required %></p> |
| 84 |
|
| 85 |
<% end %>
|
| 86 |
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
| 87 |
</div>
|
| 88 |
|
| 89 |
<% if @custom_field.is_a?(IssueCustomField) %>
|
| 90 |
<fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend> |
| 91 |
<% Tracker.sorted.each do |tracker| %>
|
| 92 |
<%= check_box_tag "custom_field[tracker_ids][]",
|
| 93 |
tracker.id,
|
| 94 |
(@custom_field.trackers.include? tracker),
|
| 95 |
:id => "custom_field_tracker_ids_#{tracker.id}" %>
|
| 96 |
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>"> |
| 97 |
<%= h(tracker.name) %>
|
| 98 |
</label>
|
| 99 |
<% end %>
|
| 100 |
<%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
|
| 101 |
<p><%= check_all_links 'custom_field_tracker_ids' %></p> |
| 102 |
</fieldset>
|
| 103 |
|
| 104 |
<fieldset class="box" id="custom_field_project_ids"><legend><%= l(:label_project_plural) %></legend> |
| 105 |
<%= render_project_nested_lists(Project.all) do |p|
|
| 106 |
content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, @custom_field.projects.to_a.include?(p), :id => nil) + ' ' + h(p))
|
| 107 |
end %>
|
| 108 |
<%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
|
| 109 |
<p><%= check_all_links 'custom_field_project_ids' %></p> |
| 110 |
</fieldset>
|
| 111 |
<% end %>
|
| 112 |
</div>
|
| 113 |
|
| 114 |
<% include_calendar_headers_tags %>
|