Commit 72b29525 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show only personal projects on profile page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent d54d3324
......@@ -4,10 +4,12 @@ class UsersController < ApplicationController
def show
@user = User.find_by_username!(params[:username])
@projects = @user.authorized_projects.accessible_to(current_user)
@projects = Project.personal(@user).accessible_to(current_user)
if !current_user && @projects.empty?
return authenticate_user!
end
@groups = @user.groups.accessible_to(current_user)
@events = @user.recent_events.where(project_id: @projects.pluck(:id)).limit(20)
@title = @user.name
......
.panel.panel-default
.panel-heading Projects
.panel-heading Personal projects
%ul.well-list
- @projects.each do |project|
%li
......
......@@ -20,4 +20,5 @@
= render @events
.col-md-4
= render 'profile', user: @user
- if @projects.present?
= 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