From 45f039187df03e8925cb0d08ccc1838c9ea2d5c2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 19 Oct 2019 11:42:20 +0000 Subject: Option to switch between table list and board list (#29482). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18765 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/queries/_form.html.erb | 21 +++++++++++++++++++-- app/views/queries/_query_form.html.erb | 25 +++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) (limited to 'app/views/queries') diff --git a/app/views/queries/_form.html.erb b/app/views/queries/_form.html.erb index a2dd9f589..12a1d0202 100644 --- a/app/views/queries/_form.html.erb +++ b/app/views/queries/_form.html.erb @@ -29,12 +29,18 @@ <% end %>
<%= l(:label_options) %> -

+ <% if @query.available_display_types.size > 1 %> +

+ <%= available_display_types_tags(@query) %> +

+<% end %> + +

<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns', :data => {:disables => "#columns, .block_columns input"} %>

<% unless params[:gantt] %> -

+

<%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %>

<% unless @query.available_block_columns.empty? %> @@ -99,4 +105,15 @@ $(document).ready(function(){ $("input.disable-unless-private").attr('disabled', !private_checked); }).trigger('change'); }); + +$(function ($) { + $('#display_type').change(function (e) { + var option = $(e.target).val() + if (option == 'board') { + $('fieldset#columns, fieldset#sort, p#default_columns, p#group_by').hide(); + } else { + $('fieldset#columns, fieldset#sort, p#default_columns, p#group_by').show(); + } + }).change() +}); <% end %> diff --git a/app/views/queries/_query_form.html.erb b/app/views/queries/_query_form.html.erb index 65bcc3eb5..62d156684 100644 --- a/app/views/queries/_query_form.html.erb +++ b/app/views/queries/_query_form.html.erb @@ -14,8 +14,14 @@ <% if @query.available_columns.any? %>