2006-06-28 22:11:03 +04:00
|
|
|
<%= error_messages_for 'custom_field' %>
|
|
|
|
|
2006-12-17 17:22:09 +03:00
|
|
|
<script>
|
|
|
|
function toggle_custom_field_format() {
|
|
|
|
format = $("custom_field_field_format");
|
|
|
|
p_length = $("custom_field_min_length");
|
|
|
|
p_regexp = $("custom_field_regexp");
|
|
|
|
p_values = $("custom_field_possible_values");
|
|
|
|
switch (format.value) {
|
|
|
|
case "list":
|
|
|
|
Element.hide(p_length.parentNode);
|
|
|
|
Element.hide(p_regexp.parentNode);
|
|
|
|
Element.show(p_values.parentNode);
|
|
|
|
break;
|
|
|
|
case "int":
|
|
|
|
case "string":
|
|
|
|
case "text":
|
|
|
|
Element.show(p_length.parentNode);
|
|
|
|
Element.show(p_regexp.parentNode);
|
|
|
|
Element.hide(p_values.parentNode);
|
|
|
|
break;
|
|
|
|
case "date":
|
|
|
|
case "bool":
|
|
|
|
Element.hide(p_length.parentNode);
|
|
|
|
Element.hide(p_regexp.parentNode);
|
|
|
|
Element.hide(p_values.parentNode);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
Element.show(p_length.parentNode);
|
|
|
|
Element.show(p_regexp.parentNode);
|
|
|
|
Element.show(p_values.parentNode);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2006-06-28 22:11:03 +04:00
|
|
|
<!--[form:custom_field]-->
|
2006-07-29 13:32:58 +04:00
|
|
|
<div class="box">
|
2006-12-17 17:22:09 +03:00
|
|
|
<p><%= f.text_field :name, :required => true %></p>
|
|
|
|
<p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
|
2006-09-02 17:33:23 +04:00
|
|
|
<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
|
2006-12-17 17:22:09 +03:00
|
|
|
<%= f.text_field :min_length, :size => 5, :no_label => true %> -
|
|
|
|
<%= f.text_field :max_length, :size => 5, :no_label => true %><br>(<%=l(:text_min_max_length_info)%>)</p>
|
|
|
|
<p><%= f.text_field :regexp, :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p>
|
|
|
|
<p><%= f.text_area :possible_values, :rows => 5, :cols => 60 %><br>(<%=l(:text_possible_values_info)%>)</p>
|
2006-07-29 13:32:58 +04:00
|
|
|
</div>
|
2006-12-17 17:22:09 +03:00
|
|
|
<%= javascript_tag "toggle_custom_field_format();" %>
|
2006-06-28 22:11:03 +04:00
|
|
|
<!--[eoform:custom_field]-->
|
|
|
|
|
2006-07-29 13:32:58 +04:00
|
|
|
<div class="box">
|
2006-12-17 17:22:09 +03:00
|
|
|
<% case @custom_field.type.to_s
|
|
|
|
when "IssueCustomField" %>
|
|
|
|
|
|
|
|
<fieldset><legend><%=l(:label_tracker_plural)%></legend>
|
|
|
|
<% for tracker in @trackers %>
|
|
|
|
<%= check_box_tag "tracker_ids[]", tracker.id, (@custom_field.trackers.include? tracker) %> <%= tracker.name %>
|
|
|
|
<% end %>
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
|
|
|
<p><%= f.check_box :is_for_all %></p>
|
|
|
|
|
|
|
|
<% when "UserCustomField" %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
2006-07-29 13:32:58 +04:00
|
|
|
|
2006-12-17 17:22:09 +03:00
|
|
|
<% when "ProjectCustomField" %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
2006-07-29 13:32:58 +04:00
|
|
|
|
|
|
|
<% end %>
|
|
|
|
</div>
|