diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-21 16:57:01 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-23 17:11:39 +0200 |
commit | a6dfd065ca9de2e421425a5126c68bf8949ce110 (patch) | |
tree | 45eaaf341b8c746cc69b28f207544fa9fc7e421e /app/controllers/projects_controller.rb | |
parent | 72b090b890fc438923b9bcb35d0461564f71cebc (diff) | |
download | gitlab-ce-a6dfd065ca9de2e421425a5126c68bf8949ce110.tar.gz |
Add atom feed for project activity.
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 1422f2b8a4c..883e5865a21 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -66,8 +66,6 @@ class ProjectsController < ApplicationController return end - limit = (params[:limit] || 20).to_i - @show_star = !(current_user && current_user.starred?(@project)) respond_to do |format| @@ -85,11 +83,14 @@ class ProjectsController < ApplicationController end format.json do - @events = @project.events.recent - @events = event_filter.apply_filter(@events).with_associations - @events = @events.limit(limit).offset(params[:offset] || 0) + load_events pager_json('events/_events', @events.count) end + + format.atom do + load_events + render layout: false + end end end @@ -167,6 +168,13 @@ class ProjectsController < ApplicationController current_user ? 'projects' : 'public_projects' end + def load_events + @events = @project.events.recent + @events = event_filter.apply_filter(@events).with_associations + limit = (params[:limit] || 20).to_i + @events = @events.limit(limit).offset(params[:offset] || 0) + end + def project_params params.require(:project).permit( :name, :path, :description, :issues_tracker, :tag_list, |