summaryrefslogtreecommitdiffstats
path: root/app/views/custom_fields
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-10-20 08:29:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-10-20 08:29:55 +0000
commit13e381d31de0055905bd95813fc8034582b2dedc (patch)
tree1354c6ec8032935df3bc21c92a7821a7fbef03df /app/views/custom_fields
parent4eea64d38fd813d8f0edf87efe59ed7d3826d29c (diff)
downloadredmine-13e381d31de0055905bd95813fc8034582b2dedc.tar.gz
redmine-13e381d31de0055905bd95813fc8034582b2dedc.zip
Projects selection on custom field form (#15136).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12225 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/custom_fields')
-rw-r--r--app/views/custom_fields/_form.html.erb49
-rw-r--r--app/views/custom_fields/edit.html.erb1
-rw-r--r--app/views/custom_fields/new.html.erb1
3 files changed, 35 insertions, 16 deletions
diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erb
index 4c0b70243..356d0bca3 100644
--- a/app/views/custom_fields/_form.html.erb
+++ b/app/views/custom_fields/_form.html.erb
@@ -1,5 +1,9 @@
<%= error_messages_for 'custom_field' %>
+<% if @custom_field.is_a?(IssueCustomField) %>
+<div class="splitcontentleft">
+<% end %>
+
<div class="box tabular">
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></p>
@@ -46,20 +50,6 @@
<div class="box tabular">
<% case @custom_field.class.name
when "IssueCustomField" %>
-
- <fieldset><legend><%=l(:label_tracker_plural)%></legend>
- <% Tracker.sorted.all.each do |tracker| %>
- <%= check_box_tag "custom_field[tracker_ids][]",
- tracker.id,
- (@custom_field.trackers.include? tracker),
- :id => "custom_field_tracker_ids_#{tracker.id}" %>
- <label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
- <%= h(tracker.name) %>
- </label>
- <% end %>
- <%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
- </fieldset>
- &nbsp;
<p><%= f.check_box :is_required %></p>
<p><%= f.check_box :is_for_all %></p>
<p><%= f.check_box :is_filter %></p>
@@ -113,6 +103,33 @@ when "IssueCustomField" %>
<% end %>
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
</div>
+<%= submit_tag l(:button_save) %>
+
+<% if @custom_field.is_a?(IssueCustomField) %>
+</div>
+<div class="splitcontentright">
+ <fieldset class="box"><legend><%=l(:label_tracker_plural)%></legend>
+ <% Tracker.sorted.all.each do |tracker| %>
+ <%= check_box_tag "custom_field[tracker_ids][]",
+ tracker.id,
+ (@custom_field.trackers.include? tracker),
+ :id => "custom_field_tracker_ids_#{tracker.id}" %>
+ <label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
+ <%= h(tracker.name) %>
+ </label>
+ <% end %>
+ <%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
+ </fieldset>
+
+ <fieldset class="box" id="custom_field_project_ids"><legend><%= l(:label_project_plural) %></legend>
+ <%= render_project_nested_lists(Project.all) do |p|
+ content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, @custom_field.projects.to_a.include?(p), :id => nil) + ' ' + h(p))
+ end %>
+ <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
+ <p><%= check_all_links 'custom_field_project_ids' %></p>
+ </fieldset>
+</div>
+<% end %>
<% include_calendar_headers_tags %>
@@ -123,4 +140,8 @@ function toggleCustomFieldRoles(){
}
$("#custom_field_visible_on, #custom_field_visible_off").change(toggleCustomFieldRoles);
$(document).ready(toggleCustomFieldRoles);
+
+$("#custom_field_is_for_all").change(function(){
+ $("#custom_field_project_ids input").attr("disabled", $(this).is(":checked"));
+}).trigger('change');
<% end %>
diff --git a/app/views/custom_fields/edit.html.erb b/app/views/custom_fields/edit.html.erb
index 803ba0558..cd52e0075 100644
--- a/app/views/custom_fields/edit.html.erb
+++ b/app/views/custom_fields/edit.html.erb
@@ -4,5 +4,4 @@
<%= labelled_form_for :custom_field, @custom_field, :url => custom_field_path(@custom_field), :html => {:method => :put, :id => 'custom_field_form'} do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
-<%= submit_tag l(:button_save) %>
<% end %>
diff --git a/app/views/custom_fields/new.html.erb b/app/views/custom_fields/new.html.erb
index 7af7735f0..69328412e 100644
--- a/app/views/custom_fields/new.html.erb
+++ b/app/views/custom_fields/new.html.erb
@@ -5,7 +5,6 @@
<%= labelled_form_for :custom_field, @custom_field, :url => custom_fields_path, :html => {:id => 'custom_field_form'} do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= hidden_field_tag 'type', @custom_field.type %>
-<%= submit_tag l(:button_save) %>
<% end %>
<%= javascript_tag do %>