Commit 0e9f4320 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'improve-user-profile' into 'master'

Improve user profile page

See merge request !1539
parents a04ac761 367d9a2d
...@@ -59,6 +59,7 @@ v 7.8.0 (unreleased) ...@@ -59,6 +59,7 @@ v 7.8.0 (unreleased)
- Fix duplicate authorized applications in user profile and incorrect application client count in admin area. - Fix duplicate authorized applications in user profile and incorrect application client count in admin area.
- Make sure Markdown previews always use the same styling as the eventual destination. - Make sure Markdown previews always use the same styling as the eventual destination.
- Remove deprecated Group#owner_id from API - Remove deprecated Group#owner_id from API
- Show projects user contributed to on user page. Show stars near project on user page.
v 7.7.2 v 7.7.2
- Update GitLab Shell to version 2.4.2 that fixes a bug when developers can push to protected branch - Update GitLab Shell to version 2.4.2 that fixes a bug when developers can push to protected branch
......
...@@ -8,6 +8,9 @@ class UsersController < ApplicationController ...@@ -8,6 +8,9 @@ class UsersController < ApplicationController
visible_projects = ProjectsFinder.new.execute(current_user) visible_projects = ProjectsFinder.new.execute(current_user)
authorized_projects_ids = visible_projects.pluck(:id) authorized_projects_ids = visible_projects.pluck(:id)
@contributed_projects = Project.where(id: authorized_projects_ids).
in_group_namespace
@projects = @user.personal_projects. @projects = @user.personal_projects.
where(id: authorized_projects_ids) where(id: authorized_projects_ids)
......
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
.project-access-icon .project-access-icon
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
= link_to project.name_with_namespace, project = link_to project.name_with_namespace, project
%span.pull-right
- if current_page?(starred_explore_projects_path)
%strong.pull-right
%i.fa.fa-star %i.fa.fa-star
= pluralize project.star_count, 'star' = project.star_count
.project-info .project-info
- if project.description.present? - if project.description.present?
......
.panel.panel-default - if @contributed_projects.present?
.panel.panel-default
.panel-heading Projects contributed to
%ul.well-list
- @contributed_projects.sort_by(&:star_count).reverse.each do |project|
%li
= link_to_project project
%span.pull-right.light
%i.fa.fa-star
= project.star_count
- if @projects.present?
.panel.panel-default
.panel-heading Personal projects .panel-heading Personal projects
%ul.well-list %ul.well-list
- projects.each do |project| - @projects.sort_by(&:star_count).reverse.each do |project|
%li %li
= link_to_project project = link_to_project project
%span.pull-right.light
%i.fa.fa-star
= project.star_count
...@@ -35,9 +35,7 @@ ...@@ -35,9 +35,7 @@
= render @events = render @events
.col-md-4 .col-md-4
= render 'profile', user: @user = render 'profile', user: @user
- if @projects.present? = render 'projects'
= render 'projects', projects: @projects
:coffeescript :coffeescript
$ -> $ ->
......
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