summaryrefslogtreecommitdiffstats
path: root/app/views/custom_fields
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/custom_fields')
-rw-r--r--app/views/custom_fields/_form.rhtml52
-rw-r--r--app/views/custom_fields/edit.rhtml6
-rw-r--r--app/views/custom_fields/list.rhtml36
-rw-r--r--app/views/custom_fields/new.rhtml8
4 files changed, 102 insertions, 0 deletions
diff --git a/app/views/custom_fields/_form.rhtml b/app/views/custom_fields/_form.rhtml
new file mode 100644
index 000000000..f7f968e33
--- /dev/null
+++ b/app/views/custom_fields/_form.rhtml
@@ -0,0 +1,52 @@
+<%= error_messages_for 'custom_field' %>
+
+<!--[form:custom_field]-->
+<div class="box">
+<p><label for="custom_field_name"><%=l(:field_name)%><span class="required"> *</span></label>
+<%= text_field 'custom_field', 'name' %></p>
+
+<p><label for="custom_field_field_format"><%=l(:field_field_format)%></label>
+<%= select("custom_field", "field_format", custom_field_formats_for_select) %></p>
+
+<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
+<%= text_field 'custom_field', 'min_length', :size => 5 %> -
+<%= text_field 'custom_field', 'max_length', :size => 5 %><br>(<%=l(:text_min_max_length_info)%>)</p>
+
+<p><label for="custom_field_regexp"><%=l(:field_regexp)%></label>
+<%= text_field 'custom_field', 'regexp', :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p>
+
+<p><label for="custom_field_possible_values"><%=l(:field_possible_values)%></label>
+<%= text_area 'custom_field', 'possible_values', :rows => 5, :cols => 60 %><br>(<%=l(:text_possible_values_info)%>)</p>
+</div>
+<!--[eoform:custom_field]-->
+
+<div class="box">
+<% case type.to_s
+ when "IssueCustomField" %>
+
+<fieldset><legend><%=l(:label_tracker_plural)%></legend>
+<% for tracker in @trackers %>
+ <input type="checkbox"
+ name="tracker_ids[]"
+ value="<%= tracker.id %>"
+ <%if @custom_field.trackers.include? tracker%>checked="checked"<%end%>
+ > <%= tracker.name %>
+<% end %></fieldset>
+&nbsp;
+
+<p><label for="custom_field_is_required"><%=l(:field_is_required)%></label>
+<%= check_box 'custom_field', 'is_required' %></p>
+
+<p><label for="custom_field_is_for_all"><%=l(:field_is_for_all)%></label>
+<%= check_box 'custom_field', 'is_for_all' %></p>
+
+<% when "UserCustomField" %>
+<p><label for="custom_field_is_required"><%=l(:field_is_required)%></label>
+<%= check_box 'custom_field', 'is_required' %></p>
+
+<% when "ProjectCustomField" %>
+<p><label for="custom_field_is_required"><%=l(:field_is_required)%></label>
+<%= check_box 'custom_field', 'is_required' %></p>
+
+<% end %>
+</div>
diff --git a/app/views/custom_fields/edit.rhtml b/app/views/custom_fields/edit.rhtml
new file mode 100644
index 000000000..201047a8d
--- /dev/null
+++ b/app/views/custom_fields/edit.rhtml
@@ -0,0 +1,6 @@
+<h2><%=l(:label_custom_field)%> (<%=l(@custom_field.type_name)%>)</h2>
+
+<%= start_form_tag({:action => 'edit', :id => @custom_field}, :class => "tabular") %>
+ <%= render :partial => 'form', :locals => { :type => @custom_field.type } %>
+ <%= submit_tag l(:button_save) %>
+<%= end_form_tag %>
diff --git a/app/views/custom_fields/list.rhtml b/app/views/custom_fields/list.rhtml
new file mode 100644
index 000000000..858590c49
--- /dev/null
+++ b/app/views/custom_fields/list.rhtml
@@ -0,0 +1,36 @@
+<h2><%=l(:label_custom_field_plural)%></h2>
+
+<table class="listTableContent">
+<tr class="ListHead">
+ <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>
+<% 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]) %></td>
+ <td align="center"><%= image_tag 'true' if custom_field.is_required? %></td>
+ <td align="center"><%= image_tag 'true' 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 %>
+</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>
diff --git a/app/views/custom_fields/new.rhtml b/app/views/custom_fields/new.rhtml
new file mode 100644
index 000000000..3b215dc9f
--- /dev/null
+++ b/app/views/custom_fields/new.rhtml
@@ -0,0 +1,8 @@
+<h2><%=l(:label_custom_field_new)%> (<%=l(@custom_field.type_name)%>)</h2>
+
+<%= start_form_tag({:action => 'new'}, :class => "tabular") %>
+ <%= render :partial => 'form', :locals => { :type => @custom_field.type } %>
+ <%= hidden_field_tag 'type', @custom_field.type %>
+ <%= submit_tag l(:button_save) %>
+<%= end_form_tag %>
+