diff options
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r-- | app/controllers/groups_controller.rb | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index b4dd0021ed7..99d38615c08 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -14,7 +14,7 @@ class GroupsController < Groups::ApplicationController # Load group projects before_action :load_projects, except: [:index, :new, :create, :projects, :edit, :update, :autocomplete] - before_action :event_filter, only: :show + before_action :event_filter, only: [:show, :events] layout :determine_layout @@ -42,20 +42,15 @@ class GroupsController < Groups::ApplicationController @last_push = current_user.recent_push if current_user @projects = @projects.includes(:namespace) @projects = @projects.search(params[:filter_projects]) if params[:filter_projects].present? - @projects = @projects.page(params[:page]).per(PER_PAGE) + @projects = @projects.page(params[:page]).per(PER_PAGE) if !params[:filter_projects].present? respond_to do |format| format.html format.json do - if params[:filter_projects] - render json: { - html: view_to_html_string("dashboard/projects/_projects", locals: { projects: @projects }) - } - else - load_events - pager_json("events/_events", @events.count) - end + render json: { + html: view_to_html_string("dashboard/projects/_projects", locals: { projects: @projects }) + } end format.atom do @@ -65,6 +60,15 @@ class GroupsController < Groups::ApplicationController end end + def events + respond_to do |format| + format.json do + load_events + pager_json("events/_events", @events.count) + end + end + end + def edit end |