summaryrefslogtreecommitdiffstats
path: root/app/views/queries
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-10-19 11:42:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-10-19 11:42:20 +0000
commit45f039187df03e8925cb0d08ccc1838c9ea2d5c2 (patch)
tree3bbb8958c71b24e65123c0e8f29d6f15726424d5 /app/views/queries
parentecd9d9ba2f43f2f5a88c1d34d34d07dae40dfe4e (diff)
downloadredmine-45f039187df03e8925cb0d08ccc1838c9ea2d5c2.tar.gz
redmine-45f039187df03e8925cb0d08ccc1838c9ea2d5c2.zip
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
Diffstat (limited to 'app/views/queries')
-rw-r--r--app/views/queries/_form.html.erb21
-rw-r--r--app/views/queries/_query_form.html.erb25
2 files changed, 42 insertions, 4 deletions
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 %>
<fieldset id="options"><legend><%= l(:label_options) %></legend>
-<p><label for="query_default_columns"><%=l(:label_default_columns)%></label>
+ <% if @query.available_display_types.size > 1 %>
+ <p><label for='display_type'><%= l(:label_display_type) %></label>
+ <%= available_display_types_tags(@query) %>
+ </p>
+<% end %>
+
+<p id ="default_columns"><label for="query_default_columns"><%=l(:label_default_columns)%></label>
<%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns',
:data => {:disables => "#columns, .block_columns input"} %></p>
<% unless params[:gantt] %>
- <p><label for="query_group_by"><%= l(:field_group_by) %></label>
+ <p id="group_by"><label id="group_by" for="query_group_by"><%= l(:field_group_by) %></label>
<%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %></p>
<% 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? %>
<fieldset id="options" class="collapsible collapsed">
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_options) %></legend>
- <div style="display: none;">
- <table>
+ <div class="hidden">
+ <% if @query.available_display_types.size > 1 %>
+ <div>
+ <span class="field"><label for='display_type'><%= l(:label_display_type) %></label></span>
+ <%= available_display_types_tags(@query) %>
+ </div>
+ <% end %>
+ <table id="list" class="<%= 'hidden' if (@query.display_type == 'board') %>">
<% if @query.available_columns.any? %>
<tr>
<td class="field"><%= l(:field_column_names) %></td>
@@ -65,3 +71,18 @@
</div>
<%= error_messages_for @query %>
+
+<%= javascript_tag do %>
+$(function ($) {
+ $('#display_type').change(function (e) {
+ var option = $(e.target).val()
+ if (option == 'board') {
+ $('table#list').hide();
+ } else {
+ $('table#list').show();
+ }
+
+ })
+});
+
+<% end %>