Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb26
1 files changed, 19 insertions, 7 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index aad3709090e..d011523c94f 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -10,11 +10,11 @@ class GroupsController < ApplicationController
# Load group projects
before_filter :load_projects, except: [:new, :create, :projects, :edit, :update]
+ before_filter :event_filter, only: :show
+ before_filter :set_title, only: [:new, :create]
layout :determine_layout
- before_filter :set_title, only: [:new, :create]
-
def new
@group = Group.new
end
@@ -32,15 +32,21 @@ class GroupsController < ApplicationController
end
def show
- @events = Event.in_projects(project_ids)
- @events = event_filter.apply_filter(@events)
- @events = @events.limit(20).offset(params[:offset] || 0)
@last_push = current_user.recent_push if current_user
+ @projects = @projects.includes(:namespace)
respond_to do |format|
format.html
- format.json { pager_json("events/_events", @events.count) }
- format.atom { render layout: false }
+
+ format.json do
+ load_events
+ pager_json("events/_events", @events.count)
+ end
+
+ format.atom do
+ load_events
+ render layout: false
+ end
end
end
@@ -149,4 +155,10 @@ class GroupsController < ApplicationController
def group_params
params.require(:group).permit(:name, :description, :path, :avatar)
end
+
+ def load_events
+ @events = Event.in_projects(project_ids)
+ @events = event_filter.apply_filter(@events).with_associations
+ @events = @events.limit(20).offset(params[:offset] || 0)
+ end
end