@@ -1,114 +1,114 | |||||
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.text_field :name, :required => true %></p> |
|
6 | <p><%= f.text_field :name, :required => true %></p> | |
6 | <p><%= f.text_area :description, :rows => 7 %></p> |
|
7 | <p><%= f.text_area :description, :rows => 7 %></p> | |
7 | <p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></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 | <p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></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> |
|
31 | <p><%= f.check_box :is_filter %></p> | |
32 | <% if @custom_field.format.searchable_supported %> |
|
32 | <% if @custom_field.format.searchable_supported %> | |
33 | <p><%= f.check_box :searchable %></p> |
|
33 | <p><%= f.check_box :searchable %></p> | |
34 | <% end %> |
|
34 | <% end %> | |
35 | <p> |
|
35 | <p> | |
36 | <label><%= l(:field_visible) %></label> |
|
36 | <label><%= l(:field_visible) %></label> | |
37 | <label class="block"> |
|
37 | <label class="block"> | |
38 | <%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on', |
|
38 | <%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on', | |
39 | :data => {:disables => '.custom_field_role input'} %> |
|
39 | :data => {:disables => '.custom_field_role input'} %> | |
40 | <%= l(:label_visibility_public) %> |
|
40 | <%= l(:label_visibility_public) %> | |
41 | </label> |
|
41 | </label> | |
42 | <label class="block"> |
|
42 | <label class="block"> | |
43 | <%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off', |
|
43 | <%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off', | |
44 | :data => {:enables => '.custom_field_role input'} %> |
|
44 | :data => {:enables => '.custom_field_role input'} %> | |
45 | <%= l(:label_visibility_roles) %>: |
|
45 | <%= l(:label_visibility_roles) %>: | |
46 | </label> |
|
46 | </label> | |
47 | <% Role.givable.sorted.each do |role| %> |
|
47 | <% Role.givable.sorted.each do |role| %> | |
48 | <label class="block custom_field_role" style="padding-left:2em;"> |
|
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 %> |
|
49 | <%= check_box_tag 'custom_field[role_ids][]', role.id, @custom_field.roles.include?(role), :id => nil %> | |
50 | <%= role.name %> |
|
50 | <%= role.name %> | |
51 | </label> |
|
51 | </label> | |
52 | <% end %> |
|
52 | <% end %> | |
53 | <%= hidden_field_tag 'custom_field[role_ids][]', '' %> |
|
53 | <%= hidden_field_tag 'custom_field[role_ids][]', '' %> | |
54 | </p> |
|
54 | </p> | |
55 |
|
55 | |||
56 | <% when "UserCustomField" %> |
|
56 | <% when "UserCustomField" %> | |
57 | <p><%= f.check_box :is_required %></p> |
|
57 | <p><%= f.check_box :is_required %></p> | |
58 | <p><%= f.check_box :visible %></p> |
|
58 | <p><%= f.check_box :visible %></p> | |
59 | <p><%= f.check_box :editable %></p> |
|
59 | <p><%= f.check_box :editable %></p> | |
60 | <p><%= f.check_box :is_filter %></p> |
|
60 | <p><%= f.check_box :is_filter %></p> | |
61 |
|
61 | |||
62 | <% when "ProjectCustomField" %> |
|
62 | <% when "ProjectCustomField" %> | |
63 | <p><%= f.check_box :is_required %></p> |
|
63 | <p><%= f.check_box :is_required %></p> | |
64 | <p><%= f.check_box :visible %></p> |
|
64 | <p><%= f.check_box :visible %></p> | |
65 | <% if @custom_field.format.searchable_supported %> |
|
65 | <% if @custom_field.format.searchable_supported %> | |
66 | <p><%= f.check_box :searchable %></p> |
|
66 | <p><%= f.check_box :searchable %></p> | |
67 | <% end %> |
|
67 | <% end %> | |
68 | <p><%= f.check_box :is_filter %></p> |
|
68 | <p><%= f.check_box :is_filter %></p> | |
69 |
|
69 | |||
70 | <% when "VersionCustomField" %> |
|
70 | <% when "VersionCustomField" %> | |
71 | <p><%= f.check_box :is_required %></p> |
|
71 | <p><%= f.check_box :is_required %></p> | |
72 | <p><%= f.check_box :is_filter %></p> |
|
72 | <p><%= f.check_box :is_filter %></p> | |
73 |
|
73 | |||
74 | <% when "GroupCustomField" %> |
|
74 | <% when "GroupCustomField" %> | |
75 | <p><%= f.check_box :is_required %></p> |
|
75 | <p><%= f.check_box :is_required %></p> | |
76 | <p><%= f.check_box :is_filter %></p> |
|
76 | <p><%= f.check_box :is_filter %></p> | |
77 |
|
77 | |||
78 | <% when "TimeEntryCustomField" %> |
|
78 | <% when "TimeEntryCustomField" %> | |
79 | <p><%= f.check_box :is_required %></p> |
|
79 | <p><%= f.check_box :is_required %></p> | |
80 | <p><%= f.check_box :is_filter %></p> |
|
80 | <p><%= f.check_box :is_filter %></p> | |
81 |
|
81 | |||
82 | <% else %> |
|
82 | <% else %> | |
83 | <p><%= f.check_box :is_required %></p> |
|
83 | <p><%= f.check_box :is_required %></p> | |
84 |
|
84 | |||
85 | <% end %> |
|
85 | <% end %> | |
86 | <%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %> |
|
86 | <%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %> | |
87 | </div> |
|
87 | </div> | |
88 |
|
88 | |||
89 | <% if @custom_field.is_a?(IssueCustomField) %> |
|
89 | <% if @custom_field.is_a?(IssueCustomField) %> | |
90 | <fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend> |
|
90 | <fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend> | |
91 | <% Tracker.sorted.each do |tracker| %> |
|
91 | <% Tracker.sorted.each do |tracker| %> | |
92 | <%= check_box_tag "custom_field[tracker_ids][]", |
|
92 | <%= check_box_tag "custom_field[tracker_ids][]", | |
93 | tracker.id, |
|
93 | tracker.id, | |
94 | (@custom_field.trackers.include? tracker), |
|
94 | (@custom_field.trackers.include? tracker), | |
95 | :id => "custom_field_tracker_ids_#{tracker.id}" %> |
|
95 | :id => "custom_field_tracker_ids_#{tracker.id}" %> | |
96 | <label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>"> |
|
96 | <label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>"> | |
97 | <%= h(tracker.name) %> |
|
97 | <%= h(tracker.name) %> | |
98 | </label> |
|
98 | </label> | |
99 | <% end %> |
|
99 | <% end %> | |
100 | <%= hidden_field_tag "custom_field[tracker_ids][]", '' %> |
|
100 | <%= hidden_field_tag "custom_field[tracker_ids][]", '' %> | |
101 | <p><%= check_all_links 'custom_field_tracker_ids' %></p> |
|
101 | <p><%= check_all_links 'custom_field_tracker_ids' %></p> | |
102 | </fieldset> |
|
102 | </fieldset> | |
103 |
|
103 | |||
104 | <fieldset class="box" id="custom_field_project_ids"><legend><%= l(:label_project_plural) %></legend> |
|
104 | <fieldset class="box" id="custom_field_project_ids"><legend><%= l(:label_project_plural) %></legend> | |
105 | <%= render_project_nested_lists(Project.all) do |p| |
|
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)) |
|
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 %> |
|
107 | end %> | |
108 | <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %> |
|
108 | <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %> | |
109 | <p><%= check_all_links 'custom_field_project_ids' %></p> |
|
109 | <p><%= check_all_links 'custom_field_project_ids' %></p> | |
110 | </fieldset> |
|
110 | </fieldset> | |
111 | <% end %> |
|
111 | <% end %> | |
112 | </div> |
|
112 | </div> | |
113 |
|
113 | |||
114 | <% include_calendar_headers_tags %> |
|
114 | <% include_calendar_headers_tags %> |
General Comments 0
You need to be logged in to leave comments.
Login now