##// END OF EJS Templates
Use ids for testing inclusion....
Jean-Philippe Lang -
r15879:3d3192b187f5
parent child
Show More
@@ -1,131 +1,133
1 <%= error_messages_for 'custom_field' %>
1 <%= error_messages_for 'custom_field' %>
2
2
3 <div class="splitcontentleft">
3 <div class="splitcontentleft">
4 <div class="box tabular">
4 <div class="box tabular">
5 <p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></p>
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, :size => 50, :required => true %></p>
6 <p><%= f.text_field :name, :size => 50, :required => true %></p>
7 <p><%= f.text_area :description, :rows => 7 %></p>
7 <p><%= f.text_area :description, :rows => 7 %></p>
8
8
9 <% if @custom_field.format.multiple_supported %>
9 <% if @custom_field.format.multiple_supported %>
10 <p>
10 <p>
11 <%= f.check_box :multiple %>
11 <%= f.check_box :multiple %>
12 <% if !@custom_field.new_record? && @custom_field.multiple %>
12 <% if !@custom_field.new_record? && @custom_field.multiple %>
13 <em class="info"><%= l(:text_turning_multiple_off) %></em>
13 <em class="info"><%= l(:text_turning_multiple_off) %></em>
14 <% end %>
14 <% end %>
15 </p>
15 </p>
16 <% end %>
16 <% end %>
17
17
18 <%= render_custom_field_format_partial f, @custom_field %>
18 <%= render_custom_field_format_partial f, @custom_field %>
19
19
20 <%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
20 <%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
21 </div>
21 </div>
22 <p><%= submit_tag l(:button_save) %></p>
22 <p><%= submit_tag l(:button_save) %></p>
23 </div>
23 </div>
24
24
25 <div class="splitcontentright">
25 <div class="splitcontentright">
26 <div class="box tabular">
26 <div class="box tabular">
27 <% case @custom_field.class.name
27 <% case @custom_field.class.name
28 when "IssueCustomField" %>
28 when "IssueCustomField" %>
29 <p><%= f.check_box :is_required %></p>
29 <p><%= f.check_box :is_required %></p>
30 <% if @custom_field.format.is_filter_supported %>
30 <% if @custom_field.format.is_filter_supported %>
31 <p><%= f.check_box :is_filter %></p>
31 <p><%= f.check_box :is_filter %></p>
32 <% end %>
32 <% end %>
33 <% if @custom_field.format.searchable_supported %>
33 <% if @custom_field.format.searchable_supported %>
34 <p><%= f.check_box :searchable %></p>
34 <p><%= f.check_box :searchable %></p>
35 <% end %>
35 <% end %>
36
36
37 <% when "UserCustomField" %>
37 <% when "UserCustomField" %>
38 <p><%= f.check_box :is_required %></p>
38 <p><%= f.check_box :is_required %></p>
39 <p><%= f.check_box :visible %></p>
39 <p><%= f.check_box :visible %></p>
40 <p><%= f.check_box :editable %></p>
40 <p><%= f.check_box :editable %></p>
41 <% if @custom_field.format.is_filter_supported %>
41 <% if @custom_field.format.is_filter_supported %>
42 <p><%= f.check_box :is_filter %></p>
42 <p><%= f.check_box :is_filter %></p>
43 <% end %>
43 <% end %>
44
44
45 <% when "ProjectCustomField" %>
45 <% when "ProjectCustomField" %>
46 <p><%= f.check_box :is_required %></p>
46 <p><%= f.check_box :is_required %></p>
47 <p><%= f.check_box :visible %></p>
47 <p><%= f.check_box :visible %></p>
48 <% if @custom_field.format.searchable_supported %>
48 <% if @custom_field.format.searchable_supported %>
49 <p><%= f.check_box :searchable %></p>
49 <p><%= f.check_box :searchable %></p>
50 <% end %>
50 <% end %>
51 <% if @custom_field.format.is_filter_supported %>
51 <% if @custom_field.format.is_filter_supported %>
52 <p><%= f.check_box :is_filter %></p>
52 <p><%= f.check_box :is_filter %></p>
53 <% end %>
53 <% end %>
54
54
55 <% when "VersionCustomField" %>
55 <% when "VersionCustomField" %>
56 <p><%= f.check_box :is_required %></p>
56 <p><%= f.check_box :is_required %></p>
57 <% if @custom_field.format.is_filter_supported %>
57 <% if @custom_field.format.is_filter_supported %>
58 <p><%= f.check_box :is_filter %></p>
58 <p><%= f.check_box :is_filter %></p>
59 <% end %>
59 <% end %>
60
60
61 <% when "GroupCustomField" %>
61 <% when "GroupCustomField" %>
62 <p><%= f.check_box :is_required %></p>
62 <p><%= f.check_box :is_required %></p>
63 <% if @custom_field.format.is_filter_supported %>
63 <% if @custom_field.format.is_filter_supported %>
64 <p><%= f.check_box :is_filter %></p>
64 <p><%= f.check_box :is_filter %></p>
65 <% end %>
65 <% end %>
66
66
67 <% when "TimeEntryCustomField" %>
67 <% when "TimeEntryCustomField" %>
68 <p><%= f.check_box :is_required %></p>
68 <p><%= f.check_box :is_required %></p>
69 <% if @custom_field.format.is_filter_supported %>
69 <% if @custom_field.format.is_filter_supported %>
70 <p><%= f.check_box :is_filter %></p>
70 <p><%= f.check_box :is_filter %></p>
71 <% end %>
71 <% end %>
72
72
73 <% else %>
73 <% else %>
74 <p><%= f.check_box :is_required %></p>
74 <p><%= f.check_box :is_required %></p>
75
75
76 <% end %>
76 <% end %>
77 <%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
77 <%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
78 </div>
78 </div>
79
79
80 <% if @custom_field.is_a?(IssueCustomField) %>
80 <% if @custom_field.is_a?(IssueCustomField) %>
81
81
82 <fieldset class="box tabular"><legend><%= l(:field_visible) %></legend>
82 <fieldset class="box tabular"><legend><%= l(:field_visible) %></legend>
83 <label class="block">
83 <label class="block">
84 <%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on',
84 <%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on',
85 :data => {:disables => '.custom_field_role input'} %>
85 :data => {:disables => '.custom_field_role input'} %>
86 <%= l(:label_visibility_public) %>
86 <%= l(:label_visibility_public) %>
87 </label>
87 </label>
88 <label class="block">
88 <label class="block">
89 <%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off',
89 <%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off',
90 :data => {:enables => '.custom_field_role input'} %>
90 :data => {:enables => '.custom_field_role input'} %>
91 <%= l(:label_visibility_roles) %>:
91 <%= l(:label_visibility_roles) %>:
92 </label>
92 </label>
93 <% role_ids = @custom_field.role_ids %>
93 <% Role.givable.sorted.each do |role| %>
94 <% Role.givable.sorted.each do |role| %>
94 <label class="block custom_field_role" style="padding-left:2em;">
95 <label class="block custom_field_role" style="padding-left:2em;">
95 <%= check_box_tag 'custom_field[role_ids][]', role.id, @custom_field.roles.to_a.include?(role), :id => nil %>
96 <%= check_box_tag 'custom_field[role_ids][]', role.id, role_ids.include?(role.id), :id => nil %>
96 <%= role.name %>
97 <%= role.name %>
97 </label>
98 </label>
98 <% end %>
99 <% end %>
99 <%= hidden_field_tag 'custom_field[role_ids][]', '' %>
100 <%= hidden_field_tag 'custom_field[role_ids][]', '' %>
100 </fieldset>
101 </fieldset>
101
102
102 <fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend>
103 <fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend>
104 <% tracker_ids = @custom_field.tracker_ids %>
103 <% Tracker.sorted.each do |tracker| %>
105 <% Tracker.sorted.each do |tracker| %>
104 <%= check_box_tag "custom_field[tracker_ids][]",
106 <%= check_box_tag "custom_field[tracker_ids][]",
105 tracker.id,
107 tracker.id,
106 (@custom_field.trackers.to_a.include? tracker),
108 tracker_ids.include?(tracker.id),
107 :id => "custom_field_tracker_ids_#{tracker.id}" %>
109 :id => "custom_field_tracker_ids_#{tracker.id}" %>
108 <label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
110 <label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
109 <%= tracker.name %>
111 <%= tracker.name %>
110 </label>
112 </label>
111 <% end %>
113 <% end %>
112 <%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
114 <%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
113 <p><%= check_all_links 'custom_field_tracker_ids' %></p>
115 <p><%= check_all_links 'custom_field_tracker_ids' %></p>
114 </fieldset>
116 </fieldset>
115
117
116 <fieldset class="box"><legend><%= l(:label_project_plural) %></legend>
118 <fieldset class="box"><legend><%= l(:label_project_plural) %></legend>
117 <p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p>
119 <p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p>
118
120
119 <div id="custom_field_project_ids">
121 <div id="custom_field_project_ids">
120 <% project_ids = @custom_field.project_ids.to_a %>
122 <% project_ids = @custom_field.project_ids.to_a %>
121 <%= render_project_nested_lists(Project.all) do |p|
123 <%= render_project_nested_lists(Project.all) do |p|
122 content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p)
124 content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p)
123 end %>
125 end %>
124 <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
126 <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
125 <p><%= check_all_links 'custom_field_project_ids' %></p>
127 <p><%= check_all_links 'custom_field_project_ids' %></p>
126 </div>
128 </div>
127 </fieldset>
129 </fieldset>
128 <% end %>
130 <% end %>
129 </div>
131 </div>
130
132
131 <% include_calendar_headers_tags %>
133 <% include_calendar_headers_tags %>
General Comments 0
You need to be logged in to leave comments. Login now