summaryrefslogtreecommitdiffstats
path: root/app/controllers/projects_controller.rb
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/controllers/projects_controller.rb
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/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e7a79e495..b9bda6b43 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -34,6 +34,8 @@ class ProjectsController < ApplicationController
helper :issues
helper :queries
include QueriesHelper
+ helper :projects_queries
+ include ProjectsQueriesHelper
helper :repositories
helper :members
helper :trackers
@@ -50,7 +52,9 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html {
- @projects = scope.to_a
+ @entry_count = scope.count
+ @entry_pages = Paginator.new @entry_count, per_page_option, params['page']
+ @entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).to_a
}
format.api {
@offset, @limit = api_offset_and_limit
@@ -61,6 +65,11 @@ class ProjectsController < ApplicationController
projects = scope.reorder(:created_on => :desc).limit(Setting.feeds_limit.to_i).to_a
render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
}
+ format.csv {
+ # Export all entries
+ @entries = scope.to_a
+ send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => 'projects.csv')
+ }
end
end