Commit c5d65ed6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'userpage-activity-scroll'

Conflicts:
	app/controllers/users_controller.rb
parents 81d603e2 fee1f2e0
......@@ -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)
......
......@@ -97,6 +97,7 @@ class Dispatcher
new ProjectFork()
when 'users:show'
new User()
new Activities()
switch path.first()
when 'admin'
......
......@@ -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
......@@ -40,7 +40,8 @@
%strong
%i.fa.fa-rss
= render @events
.content_list
= spinner
%aside.col-md-4
= render 'profile', user: @user
= render 'projects'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment