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/projects/_board.html.erb | 3 +++ app/views/projects/_list.html.erb | 35 ++++++++++++++++++++++++++++++++++ app/views/projects/index.html.erb | 7 +++---- app/views/queries/_form.html.erb | 21 ++++++++++++++++++-- app/views/queries/_query_form.html.erb | 25 ++++++++++++++++++++++-- 5 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 app/views/projects/_board.html.erb create mode 100644 app/views/projects/_list.html.erb (limited to 'app/views') diff --git a/app/views/projects/_board.html.erb b/app/views/projects/_board.html.erb new file mode 100644 index 000000000..7d63a533d --- /dev/null +++ b/app/views/projects/_board.html.erb @@ -0,0 +1,3 @@ +
+ <%= render_project_hierarchy(@entries) %> +
diff --git a/app/views/projects/_list.html.erb b/app/views/projects/_list.html.erb new file mode 100644 index 000000000..8a1efc204 --- /dev/null +++ b/app/views/projects/_list.html.erb @@ -0,0 +1,35 @@ +
+ + + + <% @query.inline_columns.each do |column| %> + <%= column_header(@query, column) %> + <% end %> + + + +<% grouped_project_list(entries, @query) do |entry, level, group_name, group_count, group_totals| -%> + <% if group_name %> + <% reset_cycle %> + + + + <% end %> + "> + <% @query.inline_columns.each do |column| %> + <%= content_tag('td', column_content(column, entry), :class => column.css_classes) %> + <% end %> + +<% end -%> + +
+   + <%= group_name %> + <% if group_count %> + <%= group_count %> + <% end %> + <%= group_totals %> + <%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", + "toggleAllRowGroups(this)", :class => 'toggle-all') %> +
+
diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 3c2543b43..067c9bdee 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -11,12 +11,11 @@ <% end %> <% if @query.valid? %> - <% if @projects.empty? %> + <% if @entries.empty? %>

<%= l(:label_no_data) %>

<% else %> -
- <%= render_project_hierarchy(@projects) %> -
+ <%= render :partial => @query.display_type, :locals => { :entries => @entries }%> + <%= pagination_links_full @entry_pages, @entry_count %> <% end %> <% end %> 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? %>