summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-23 09:45:40 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-23 09:45:40 -0700
commitc5d65ed62f637a91b6ea9554db57e4e74bab9cb3 (patch)
tree77c5916fe44afc5147179abcb153ecfbd1e1804a
parent81d603e2c1be5b45a623eec4f5ea9a70abcc676c (diff)
parentfee1f2e0ab0336e6746aae8e9ed76549c6ac3353 (diff)
downloadgitlab-ce-c5d65ed62f637a91b6ea9554db57e4e74bab9cb3.tar.gz
Merge branch 'userpage-activity-scroll'
Conflicts: app/controllers/users_controller.rb
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/javascripts/dispatcher.js.coffee1
-rw-r--r--app/controllers/users_controller.rb25
-rw-r--r--app/views/users/show.html.haml3
4 files changed, 23 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fa97c52d34a..593b3d27466 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -29,6 +29,7 @@ v 7.10.0 (unreleased)
- Improve oauth accounts UI in profile page
- Add ability to unlink connected accounts
- Replace commits calendar with faster contribution calendar that includes issues and merge requests
+ - Add inifinite scroll to user page activity
v 7.9.0
- Add HipChat integration documentation (Stan Hu)
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index edf482f33d8..deabaf8a784 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -97,6 +97,7 @@ class Dispatcher
new ProjectFork()
when 'users:show'
new User()
+ new Activities()
switch path.first()
when 'admin'
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
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index fd96020d129..0653fb871ae 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -40,7 +40,8 @@
%strong
%i.fa.fa-rss
- = render @events
+ .content_list
+ = spinner
%aside.col-md-4
= render 'profile', user: @user
= render 'projects'