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:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 15:11:55 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 17:54:28 +0300
commitaee5691db3ec411c242e050aaa11ebb44f07f164 (patch)
tree1bacabb4632b3d90701729d32cbaf41ddeb51c14 /app/controllers/groups_controller.rb
parent3fe7f31ac047e1b9ba3ae53cea17012ce2f7f3e7 (diff)
Don't load unneeded elements in GroupsController#show
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb23
1 files changed, 5 insertions, 18 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 8c2053e8574..a24a0056a30 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -45,13 +45,14 @@ class GroupsController < Groups::ApplicationController
end
def show
- setup_children(@group)
-
respond_to do |format|
- format.html
+ format.html do
+ @has_children = GroupDescendantsFinder.new(current_user: current_user,
+ parent_group: @group,
+ params: params).has_children?
+ end
format.atom do
- setup_projects
load_events
render layout: 'xml.atom'
end
@@ -126,20 +127,6 @@ class GroupsController < Groups::ApplicationController
@children = @children.page(params[:page])
end
- def setup_projects
- set_non_archived_param
- params[:sort] ||= 'latest_activity_desc'
- @sort = params[:sort]
-
- options = {}
- options[:only_owned] = true if params[:shared] == '0'
- options[:only_shared] = true if params[:shared] == '1'
-
- @projects = GroupProjectsFinder.new(params: params, group: group, options: options, current_user: current_user).execute
- @projects = @projects.includes(:namespace)
- @projects = @projects.page(params[:page]) if params[:name].blank?
- end
-
def authorize_create_group!
allowed = if params[:parent_id].present?
parent = Group.find_by(id: params[:parent_id])