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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

116 lines
7.4 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
2019-02-15 15:39:39 +05:30
- forks = true unless local_assigns[:forks] == false
- merge_requests = true unless local_assigns[:merge_requests] == false
- issues = true unless local_assigns[:issues] == false
- pipeline_status = true unless local_assigns[:pipeline_status] == false
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)
2019-02-15 15:39:39 +05:30
- compact_mode = false unless local_assigns[:compact_mode] == true
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)
2023-01-13 00:05:48 +05:30
- css_class = "gl-sm-display-flex gl-align-items-center gl-vertical-align-middle!" if project.description.blank? && !show_last_commit_as_description
2019-07-07 11:18:12 +05:30
- cache_key = project_list_cache_key(project, pipeline_status: pipeline_status)
2017-09-10 17:25:29 +05:30
- updated_tooltip = time_ago_with_tooltip(project.last_activity_date)
2021-04-17 20:07:23 +05:30
- show_pipeline_status_icon = pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project)
- last_pipeline = project.last_pipeline if show_pipeline_status_icon
2023-01-13 00:05:48 +05:30
- css_controls_class = "with-pipeline-status" if show_pipeline_status_icon && last_pipeline.present?
- css_controls_container_class = compact_mode ? "" : "gl-lg-flex-direction-row gl-justify-content-space-between"
- css_metadata_classes = "gl-display-flex gl-align-items-center gl-mr-5 gl-reset-color! icon-wrapper has-tooltip"
2023-01-13 00:05:48 +05:30
%li.project-row
= cache(cache_key) do
2017-08-17 22:00:37 +05:30
- if avatar
2023-01-13 00:05:48 +05:30
.project-cell.gl-w-11
2017-08-17 22:00:37 +05:30
= link_to project_path(project), class: dom_class(project) do
2017-09-10 17:25:29 +05:30
- if project.creator && use_creator_avatar
2022-11-25 23:54:43 +05:30
= render Pajamas::AvatarComponent.new(project.creator, size: 48, alt: '', class: 'gl-mr-5')
2017-08-17 22:00:37 +05:30
- else
2022-11-25 23:54:43 +05:30
= render Pajamas::AvatarComponent.new(project, size: 48, alt: '', class: 'gl-mr-5')
2023-01-13 00:05:48 +05:30
.project-cell{ class: css_class }
.project-details.gl-pr-9.gl-sm-pr-0.gl-w-full.gl-display-flex.gl-flex-direction-column{ data: { qa_selector: 'project_content', qa_project_name: project.name } }
.gl-display-flex.gl-align-items-center.gl-flex-wrap-wrap
%h2.gl-font-base.gl-line-height-20.gl-my-0
= link_to project_path(project), class: 'text-plain gl-mr-3 js-prefetch-document' do
%span.namespace-name.gl-font-weight-normal
- if project.namespace && !skip_namespace
= project.namespace.human_name
\/
%span.project-name<
= project.name
2019-02-15 15:39:39 +05:30
2023-01-13 00:05:48 +05:30
%span.gl-mr-3.has-tooltip{ data: { container: 'body', placement: 'top' }, title: visibility_icon_description(project) }
= visibility_level_icon(project.visibility_level)
2019-02-15 15:39:39 +05:30
2023-01-13 00:05:48 +05:30
- if explore_projects_tab? && project_license_name(project)
%span.gl-display-inline-flex.gl-align-items-center.gl-mr-3
= sprite_icon('scale', size: 14, css_class: 'gl-mr-2')
= project_license_name(project)
2019-02-15 15:39:39 +05:30
2023-01-13 00:05:48 +05:30
- if !explore_projects_tab? && access&.nonzero?
-# haml-lint:disable UnnecessaryStringOutput
= ' ' # prevent haml from eating the space between elements
%span.user-access-role.gl-display-block.gl-m-0{ data: { qa_selector: 'user_role_content' } }= Gitlab::Access.human_access(access)
2019-02-15 15:39:39 +05:30
2023-01-13 00:05:48 +05:30
- if !explore_projects_tab?
2023-03-04 22:38:38 +05:30
= render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: project, additional_classes: 'gl-ml-3!'
2020-04-22 19:07:51 +05:30
2023-01-13 00:05:48 +05:30
- if show_last_commit_as_description
.description.gl-display-none.gl-sm-display-block.gl-overflow-hidden.gl-mr-3.gl-mt-2
= link_to_markdown(project.commit.title, project_commit_path(project, project.commit), class: "commit-row-message")
- elsif project.description.present?
.description.gl-display-none.gl-sm-display-block.gl-overflow-hidden.gl-mr-3.gl-mt-2
= markdown_field(project, :description)
2019-02-15 15:39:39 +05:30
2023-01-13 00:05:48 +05:30
- if project.topics.any?
.gl-mt-2
= render "shared/projects/topics", project: project.present(current_user: current_user)
2021-10-27 15:23:28 +05:30
2023-01-13 00:05:48 +05:30
= render_if_exists 'shared/projects/removed', project: project
2020-10-24 23:57:45 +05:30
2023-01-13 00:05:48 +05:30
.gl-display-flex.gl-mt-3{ class: "#{css_class} gl-sm-display-none!" }
.controls.gl-display-flex.gl-align-items-center
2021-04-17 20:07:23 +05:30
- if show_pipeline_status_icon && last_pipeline.present?
2019-12-04 20:38:33 +05:30
- pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
2023-01-13 00:05:48 +05:30
%span.icon-wrapper.pipeline-status.gl-mr-5
2021-04-17 20:07:23 +05:30
= render 'ci/status/icon', status: last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path
2019-12-04 20:38:33 +05:30
2020-01-01 13:55:28 +05:30
= render_if_exists 'shared/projects/archived', project: project
2019-02-15 15:39:39 +05:30
- if stars
2023-01-13 00:05:48 +05:30
= link_to project_starrers_path(project), class: "#{css_metadata_classes} stars", title: _('Stars'), data: { container: 'body', placement: 'top' } do
= sprite_icon('star-o', size: 14, css_class: 'gl-mr-2')
= badge_count(project.star_count)
.updated-note.gl-ml-3.gl-sm-ml-0
2019-10-12 21:52:04 +05:30
%span
= _('Updated')
= updated_tooltip
2023-01-13 00:05:48 +05:30
.project-cell{ class: "#{css_class} gl-xs-display-none!" }
.project-controls.gl-display-flex.gl-flex-direction-column.gl-w-full{ class: css_controls_container_class, data: { testid: 'project_controls'} }
.controls.gl-display-flex.gl-align-items-center{ class: css_controls_class }
- if show_pipeline_status_icon && last_pipeline.present?
- pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
%span.icon-wrapper.pipeline-status.gl-mr-5
= render 'ci/status/icon', status: last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path
= render_if_exists 'shared/projects/archived', project: project
- if stars
= link_to project_starrers_path(project), class: "#{css_metadata_classes} stars", title: _('Stars'), data: { container: 'body', placement: 'top' } do
= sprite_icon('star-o', size: 14, css_class: 'gl-mr-2')
= badge_count(project.star_count)
2023-04-23 21:23:45 +05:30
- if show_count?(disabled: !forks, compact_mode: compact_mode)
2023-01-13 00:05:48 +05:30
= link_to project_forks_path(project), class: "#{css_metadata_classes} forks", title: _('Forks'), data: { container: 'body', placement: 'top' } do
= sprite_icon('fork', size: 14, css_class: 'gl-mr-2')
= badge_count(project.forks_count)
2023-04-23 21:23:45 +05:30
- if show_count?(disabled: !merge_requests, compact_mode: compact_mode)
2023-01-13 00:05:48 +05:30
= link_to project_merge_requests_path(project), class: "#{css_metadata_classes} merge-requests", title: _('Merge requests'), data: { container: 'body', placement: 'top' } do
= sprite_icon('git-merge', size: 14, css_class: 'gl-mr-2')
= badge_count(project.open_merge_requests_count)
2023-04-23 21:23:45 +05:30
- if show_count?(disabled: !issues, compact_mode: compact_mode)
2023-01-13 00:05:48 +05:30
= link_to project_issues_path(project), class: "#{css_metadata_classes} issues", title: _('Issues'), data: { container: 'body', placement: 'top' } do
= sprite_icon('issues', size: 14, css_class: 'gl-mr-2')
= badge_count(project.open_issues_count)
.updated-note.gl-white-space-nowrap.gl-justify-content-end
%span
= _('Updated')
= updated_tooltip