Commit 2b05bf4b authored by Rubén Dávila's avatar Rubén Dávila

Use Project creator's avatar in fork listing. #2406

parent 7765ce18
......@@ -4,6 +4,7 @@ class Projects::ForksController < Projects::ApplicationController
before_action :authorize_download_code!
def index
@forked_projects = project.forks.includes(:creator)
end
def new
......@@ -13,7 +14,7 @@ class Projects::ForksController < Projects::ApplicationController
def create
namespace = Namespace.find(params[:namespace_key])
@forked_project = namespace.projects.find_by(path: project.path)
@forked_project = nil unless @forked_project && @forked_project.forked_from_project == project
......
......@@ -9,7 +9,7 @@
%span.count
= @project.forks_count
- else
= link_to new_namespace_project_forks_path(@project.namespace, @project), title: "Fork project", class: 'btn has_tooltip' do
= link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn has_tooltip' do
= icon('code-fork fw')
Fork
%div.count-with-arrow
......
.projects-list-holder
= render 'shared/projects/list', projects: @forked_projects, use_creator_avatar: true
- projects_limit = 20 unless local_assigns[:projects_limit]
- avatar = true unless local_assigns[:avatar] == false
- use_creator_avatar = false unless local_assigns[:use_creator_avatar] == true
- stars = true unless local_assigns[:stars] == false
- ci = false unless local_assigns[:ci] == true
- skip_namespace = false unless local_assigns[:skip_namespace] == true
......@@ -8,7 +9,7 @@
- projects.each_with_index do |project, i|
- css_class = (i >= projects_limit) ? 'hide' : nil
= render "shared/projects/project", project: project, skip_namespace: skip_namespace,
avatar: avatar, stars: stars, css_class: css_class, ci: ci
avatar: avatar, stars: stars, css_class: css_class, ci: ci, use_creator_avatar: use_creator_avatar
- if projects.size > projects_limit
%li.bottom.center
......
......@@ -13,7 +13,10 @@
= link_to project_path(project), class: dom_class(project) do
- if avatar
.dash-project-avatar
= project_icon(project, alt: '', class: 'avatar project-avatar s46')
- if use_creator_avatar
= image_tag avatar_icon(project.creator.email, 46), class: "avatar s46", alt:''
- else
= project_icon(project, alt: '', class: 'avatar project-avatar s46')
%span.project-full-name
%span.namespace-name
- if project.namespace && !skip_namespace
......
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