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/models/query.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/models/query.rb') diff --git a/app/models/query.rb b/app/models/query.rb index 7372f712e..19db899d8 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -409,6 +409,7 @@ class Query < ActiveRecord::Base self.column_names = params[:c] || query_params[:column_names] || self.column_names self.totalable_names = params[:t] || query_params[:totalable_names] || self.totalable_names self.sort_criteria = params[:sort] || query_params[:sort_criteria] || self.sort_criteria + self.display_type = params[:display_type] || query_params[:display_type] || self.display_type self end @@ -983,6 +984,21 @@ class Query < ActiveRecord::Base end end + def display_type + options[:display_type] || self.available_display_types.first + end + + def display_type=(type) + unless type || self.available_display_types.include?(type) + type = self.available_display_types.first + end + options[:display_type] = type + end + + def available_display_types + ['list'] + end + private def grouped_query(&block) -- cgit v1.2.3