diff options
author | Gilbert Roulot <groulot@gitlab.com> | 2019-03-14 15:55:46 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-03-14 15:55:46 +0300 |
commit | 6ab102a2f832a15c7aae3e4fa74dde6ad08e15db (patch) | |
tree | cb25cf8c16a62e0c50980657fada9a961c1a9c0b /app/controllers/groups_controller.rb | |
parent | b5bf179e6994566265cf91c32bcb264875b79249 (diff) |
Security Dashboard as default view for groups
Add a supporting code to separate groups#show
and groups#details which is required for the
proper implementation of the Group Overview
content and Security Dashboard option for it
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r-- | app/controllers/groups_controller.rb | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 4e50106398a..0192b1c253e 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -58,11 +58,24 @@ class GroupsController < Groups::ApplicationController def show respond_to do |format| - format.html + format.html do + render_show_html + end format.atom do - load_events - render layout: 'xml.atom' + render_details_view_atom + end + end + end + + def details + respond_to do |format| + format.html do + render_details_html + end + + format.atom do + render_details_view_atom end end end @@ -119,6 +132,19 @@ class GroupsController < Groups::ApplicationController protected + def render_show_html + render 'groups/show' + end + + def render_details_html + render 'groups/show' + end + + def render_details_view_atom + load_events + render layout: 'xml.atom', template: 'groups/show' + end + # rubocop: disable CodeReuse/ActiveRecord def authorize_create_group! allowed = if params[:parent_id].present? @@ -178,8 +204,8 @@ class GroupsController < Groups::ApplicationController .includes(:namespace) @events = EventCollection - .new(@projects, offset: params[:offset].to_i, filter: event_filter) - .to_a + .new(@projects, offset: params[:offset].to_i, filter: event_filter) + .to_a Events::RenderService .new(current_user) |