debian-mirror-gitlab/app/views/shared/projects/_project.html.haml

63 lines
2.9 KiB
Text
Raw Normal View History

2015-09-25 12:07:36 +05:30
- avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false
2016-04-02 18:10:28 +05:30
- forks = false unless local_assigns[:forks] == true
2015-10-24 18:46:33 +05:30
- skip_namespace = false unless local_assigns[:skip_namespace] == true
2018-11-08 19:23:39 +05:30
- access = max_project_member_access(project)
2015-09-25 12:07:36 +05:30
- css_class = '' unless local_assigns[:css_class]
2018-03-27 19:54:05 +05:30
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project)
2016-04-02 18:10:28 +05:30
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
2017-08-17 22:00:37 +05:30
- cache_key = project_list_cache_key(project)
2017-09-10 17:25:29 +05:30
- updated_tooltip = time_ago_with_tooltip(project.last_activity_date)
2015-09-25 12:07:36 +05:30
%li.project-row{ class: css_class }
= cache(cache_key) do
2017-08-17 22:00:37 +05:30
- if avatar
.avatar-container.s40
= link_to project_path(project), class: dom_class(project) do
2017-09-10 17:25:29 +05:30
- if project.creator && use_creator_avatar
2018-03-27 19:54:05 +05:30
= image_tag avatar_icon_for_user(project.creator, 40), class: "avatar s40", alt:''
2017-08-17 22:00:37 +05:30
- else
2018-11-18 11:00:15 +05:30
= project_icon(project, alt: '', class: 'avatar project-avatar s40', width: 40, height: 40)
2017-08-17 22:00:37 +05:30
.project-details
%h3.prepend-top-0.append-bottom-0
2018-03-17 18:26:18 +05:30
= link_to project_path(project), class: 'text-plain' do
%span.project-full-name><
2017-08-17 22:00:37 +05:30
%span.namespace-name
- if project.namespace && !skip_namespace
= project.namespace.human_name
\/
2018-03-17 18:26:18 +05:30
%span.project-name<
2017-08-17 22:00:37 +05:30
= project.name
2016-06-02 11:05:42 +05:30
2018-03-17 18:26:18 +05:30
- if access&.nonzero?
-# haml-lint:disable UnnecessaryStringOutput
= ' ' # prevent haml from eating the space between elements
%span.user-access-role= Gitlab::Access.human_access(access)
2017-08-17 22:00:37 +05:30
- if show_last_commit_as_description
.description.prepend-top-5
2018-03-17 18:26:18 +05:30
= link_to_markdown(project.commit.title, project_commit_path(project, project.commit), class: "commit-row-message")
2017-08-17 22:00:37 +05:30
- elsif project.description.present?
.description.prepend-top-5
= markdown_field(project, :description)
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
.controls
.prepend-top-0
- if project.archived
2018-11-08 19:23:39 +05:30
%span.prepend-left-10.badge.badge-warning archived
2018-03-27 19:54:05 +05:30
- if can?(current_user, :read_cross_project) && project.pipeline_status.has_status?
2017-08-17 22:00:37 +05:30
%span.prepend-left-10
= render_project_pipeline_status(project.pipeline_status)
- if forks
%span.prepend-left-10
2018-03-17 18:26:18 +05:30
= sprite_icon('fork', size: 12)
2017-08-17 22:00:37 +05:30
= number_with_delimiter(project.forks_count)
- if stars
%span.prepend-left-10
= icon('star')
= number_with_delimiter(project.star_count)
%span.prepend-left-10.visibility-icon.has-tooltip{ data: { container: 'body', placement: 'left' }, title: visibility_icon_description(project) }
= visibility_level_icon(project.visibility_level, fw: true)
.prepend-top-0
updated #{updated_tooltip}