diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/models/project_query.rb | 2 | ||||
-rw-r--r-- | app/views/settings/_projects.html.erb | 8 |
3 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index b9bda6b43..2e4fc5303 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -274,6 +274,6 @@ class ProjectsController < ApplicationController end def retrieve_project_query - retrieve_query(ProjectQuery, false) + retrieve_query(ProjectQuery, false, :defaults => @default_columns_names) end end diff --git a/app/models/project_query.rb b/app/models/project_query.rb index ecf3e687b..c0e0e92e7 100644 --- a/app/models/project_query.rb +++ b/app/models/project_query.rb @@ -69,7 +69,7 @@ class ProjectQuery < Query end def default_columns_names - @default_columns_names ||= [:name, :identifier, :short_description] + @default_columns_names = Setting.project_list_defaults.symbolize_keys[:column_names].map(&:to_sym) end def default_sort_criteria diff --git a/app/views/settings/_projects.html.erb b/app/views/settings/_projects.html.erb index fd9ea1b76..230e2803e 100644 --- a/app/views/settings/_projects.html.erb +++ b/app/views/settings/_projects.html.erb @@ -16,5 +16,13 @@ :blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %></p> </div> +<fieldset class="box"> + <legend><%= l(:setting_project_list_defaults) %></legend> + <% query = ProjectQuery.new(Setting.project_list_defaults) %> + <%= render_query_columns_selection(query, + :name => 'settings[project_list_defaults][column_names]') %> +</fieldset> + + <%= submit_tag l(:button_save) %> <% end %> |