* added issue_relations branch
* issue_relation model added git-svn-id: http://redmine.rubyforge.org/svn/branches/work@162 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<%= error_messages_for 'custom_field' %>
|
||||
|
||||
<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>
|
||||
|
||||
<!--[form:custom_field]-->
|
||||
<div class="box">
|
||||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
|
||||
<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
|
||||
<%= 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>
|
||||
</div>
|
||||
<%= javascript_tag "toggle_custom_field_format();" %>
|
||||
<!--[eoform:custom_field]-->
|
||||
|
||||
<div class="box">
|
||||
<% 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>
|
||||
|
||||
<% when "ProjectCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<h2><%=l(:label_custom_field)%> (<%=l(@custom_field.type_name)%>)</h2>
|
||||
|
||||
<% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "edit", :id => @custom_field } do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,38 @@
|
||||
<h2><%=l(:label_custom_field_plural)%></h2>
|
||||
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th><%=l(:field_name)%></th>
|
||||
<th><%=l(:field_type)%></th>
|
||||
<th><%=l(:field_field_format)%></th>
|
||||
<th><%=l(:field_is_required)%></th>
|
||||
<th><%=l(:field_is_for_all)%></th>
|
||||
<th><%=l(:label_used_by)%></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% for custom_field in @custom_fields %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td>
|
||||
<td align="center"><%= l(custom_field.type_name) %></td>
|
||||
<td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td>
|
||||
<td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td>
|
||||
<td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td>
|
||||
<td align="center"><%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
|
||||
<td align="center">
|
||||
<%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= pagination_links_full @custom_field_pages %>
|
||||
|
||||
<br />
|
||||
<%=l(:label_custom_field_new)%>:
|
||||
<ul>
|
||||
<li><%= link_to l(:label_issue_plural), :action => 'new', :type => 'IssueCustomField' %></li>
|
||||
<li><%= link_to l(:label_project_plural), :action => 'new', :type => 'ProjectCustomField' %></li>
|
||||
<li><%= link_to l(:label_user_plural), :action => 'new', :type => 'UserCustomField' %></li>
|
||||
</ul>
|
||||
@@ -0,0 +1,7 @@
|
||||
<h2><%=l(:label_custom_field_new)%> (<%=l(@custom_field.type_name)%>)</h2>
|
||||
|
||||
<% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "new" } do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= hidden_field_tag 'type', @custom_field.type %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user