diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-23 09:45:40 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-23 09:45:40 -0700 |
commit | c5d65ed62f637a91b6ea9554db57e4e74bab9cb3 (patch) | |
tree | 77c5916fe44afc5147179abcb153ecfbd1e1804a /app/controllers/users_controller.rb | |
parent | 81d603e2c1be5b45a623eec4f5ea9a70abcc676c (diff) | |
parent | fee1f2e0ab0336e6746aae8e9ed76549c6ac3353 (diff) | |
download | gitlab-ce-c5d65ed62f637a91b6ea9554db57e4e74bab9cb3.tar.gz |
Merge branch 'userpage-activity-scroll'
Conflicts:
app/controllers/users_controller.rb
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f9b568b8af9..679d6897ce9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -13,17 +13,21 @@ class UsersController < ApplicationController # Collect only groups common for both users @groups = @user.groups & GroupsFinder.new.execute(current_user) - # Get user activity feed for projects common for both users - @events = @user.recent_events. - where(project_id: authorized_projects_ids). - with_associations.limit(30) - @title = @user.name @title_url = user_path(@user) respond_to do |format| format.html - format.atom { render layout: false } + + format.atom do + load_events + render layout: false + end + + format.json do + load_events + pager_json("events/_events", @events.count) + end end end @@ -81,4 +85,13 @@ class UsersController < ApplicationController @contributions_calendar ||= Gitlab::ContributionsCalendar. new(contributed_projects.reject(&:forked?), @user) end + + def load_events + # Get user activity feed for projects common for both users + @events = @user.recent_events. + where(project_id: authorized_projects_ids). + with_associations + + @events = @events.limit(20).offset(params[:offset] || 0) + end end |