2013-11-06 10:13:21 -05:00
|
|
|
- empty_repo = @project.empty_repo?
|
2018-12-07 09:11:42 -05:00
|
|
|
- show_auto_devops_callout = show_auto_devops_callout?(@project)
|
2019-02-28 05:37:39 -05:00
|
|
|
- max_project_topic_length = 15
|
2019-08-17 01:56:48 -04:00
|
|
|
- emails_disabled = @project.emails_disabled?
|
|
|
|
|
2020-06-26 14:09:03 -04:00
|
|
|
.project-home-panel.js-show-on-project-root{ class: [("empty-project" if empty_repo)] }
|
2020-06-15 14:08:43 -04:00
|
|
|
.row.gl-mb-3
|
2019-01-21 15:52:53 -05:00
|
|
|
.home-panel-title-row.col-md-12.col-lg-6.d-flex
|
2020-07-07 11:08:49 -04:00
|
|
|
.avatar-container.rect-avatar.s64.home-panel-avatar.gl-mr-3.float-none
|
2018-12-07 09:11:42 -05:00
|
|
|
= project_icon(@project, alt: @project.name, class: 'avatar avatar-tile s64', width: 64, height: 64)
|
|
|
|
.d-flex.flex-column.flex-wrap.align-items-baseline
|
|
|
|
.d-inline-flex.align-items-baseline
|
2020-06-30 02:08:49 -04:00
|
|
|
%h1.home-panel-title.gl-mt-3.gl-mb-2{ data: { qa_selector: 'project_name_content' } }
|
2018-12-07 09:11:42 -05:00
|
|
|
= @project.name
|
2020-05-26 20:08:11 -04:00
|
|
|
%span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@project) }
|
2018-12-07 09:11:42 -05:00
|
|
|
= visibility_level_icon(@project.visibility_level, fw: false, options: {class: 'icon'})
|
2020-04-21 11:21:10 -04:00
|
|
|
= render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project
|
2019-03-31 05:55:56 -04:00
|
|
|
.home-panel-metadata.d-flex.flex-wrap.text-secondary
|
2018-12-07 09:11:42 -05:00
|
|
|
- if can?(current_user, :read_project, @project)
|
|
|
|
%span.text-secondary
|
|
|
|
= s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id }
|
|
|
|
- if current_user
|
2020-05-28 08:08:10 -04:00
|
|
|
%span.access-request-links.gl-ml-3
|
2018-12-07 09:11:42 -05:00
|
|
|
= render 'shared/members/access_request_links', source: @project
|
|
|
|
- if @project.tag_list.present?
|
2019-03-31 05:55:56 -04:00
|
|
|
%span.home-panel-topic-list.mt-2.w-100.d-inline-flex
|
2020-06-24 14:09:03 -04:00
|
|
|
= sprite_icon('tag', size: 16, css_class: 'icon gl-mr-2')
|
2019-02-05 18:12:02 -05:00
|
|
|
|
|
|
|
- @project.topics_to_show.each do |topic|
|
2020-07-08 17:09:09 -04:00
|
|
|
- project_topics_classes = "badge badge-pill badge-secondary gl-mr-2"
|
2019-02-28 05:37:39 -05:00
|
|
|
- explore_project_topic_path = explore_projects_path(tag: topic)
|
|
|
|
- if topic.length > max_project_topic_length
|
|
|
|
%a{ class: "#{ project_topics_classes } str-truncated-30 has-tooltip", data: { container: "body" }, title: topic, href: explore_project_topic_path }
|
|
|
|
= topic.titleize
|
|
|
|
- else
|
|
|
|
%a{ class: project_topics_classes, href: explore_project_topic_path }
|
|
|
|
= topic.titleize
|
2019-02-05 18:12:02 -05:00
|
|
|
|
2019-01-10 15:08:41 -05:00
|
|
|
- if @project.has_extra_topics?
|
2019-02-28 05:37:39 -05:00
|
|
|
.text-nowrap.has-tooltip{ data: { container: 'body' }, title: @project.has_extra_topics? ? @project.topics_not_shown.join(', ') : nil }
|
2019-02-05 18:12:02 -05:00
|
|
|
= _("+ %{count} more") % { count: @project.count_of_extra_topics_not_shown }
|
2016-02-18 18:08:11 -05:00
|
|
|
|
2019-01-10 15:08:41 -05:00
|
|
|
|
2018-12-14 07:34:03 -05:00
|
|
|
.project-repo-buttons.col-md-12.col-lg-6.d-inline-flex.flex-wrap.justify-content-lg-end
|
2018-12-07 09:11:42 -05:00
|
|
|
- if current_user
|
|
|
|
.d-inline-flex
|
2019-08-17 01:56:48 -04:00
|
|
|
= render 'shared/notifications/new_button', notification_setting: @notification_setting, btn_class: 'btn-xs', emails_disabled: emails_disabled
|
2018-09-06 03:27:39 -04:00
|
|
|
|
|
|
|
.count-buttons.d-inline-flex
|
2016-06-29 08:07:12 -04:00
|
|
|
= render 'projects/buttons/star'
|
|
|
|
= render 'projects/buttons/fork'
|
2015-09-24 12:36:15 -04:00
|
|
|
|
2018-12-07 09:11:42 -05:00
|
|
|
- if can?(current_user, :download_code, @project)
|
|
|
|
%nav.project-stats
|
2019-01-21 15:52:53 -05:00
|
|
|
.nav-links.quick-links
|
2019-03-12 10:20:52 -04:00
|
|
|
- if @project.empty_repo?
|
|
|
|
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors
|
|
|
|
- else
|
|
|
|
= render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout)
|
2018-09-06 03:27:39 -04:00
|
|
|
|
2019-01-21 15:52:53 -05:00
|
|
|
.home-panel-home-desc.mt-1
|
2018-12-07 09:11:42 -05:00
|
|
|
- if @project.description.present?
|
2019-06-12 15:12:33 -04:00
|
|
|
.home-panel-description.text-break
|
2019-01-21 15:52:53 -05:00
|
|
|
.home-panel-description-markdown.read-more-container
|
2018-12-07 09:11:42 -05:00
|
|
|
= markdown_field(@project, :description)
|
|
|
|
%button.btn.btn-blank.btn-link.js-read-more-trigger.d-lg-none{ type: "button" }
|
|
|
|
= _("Read more")
|
|
|
|
|
|
|
|
- if @project.forked?
|
|
|
|
%p
|
2019-11-19 11:17:35 -05:00
|
|
|
- source = visible_fork_source(@project)
|
|
|
|
- if source
|
2018-12-07 09:11:42 -05:00
|
|
|
#{ s_('ForkedFromProjectPath|Forked from') }
|
2020-02-14 10:09:08 -05:00
|
|
|
= link_to source.full_name, project_path(source), data: { qa_selector: 'forked_from_link' }
|
2018-12-07 09:11:42 -05:00
|
|
|
- else
|
2019-11-19 11:17:35 -05:00
|
|
|
= s_('ForkedFromProjectPath|Forked from an inaccessible project')
|
2017-02-13 03:45:10 -05:00
|
|
|
|
2019-04-25 04:43:21 -04:00
|
|
|
= render_if_exists "projects/home_mirror"
|
|
|
|
|
2018-12-07 09:11:42 -05:00
|
|
|
- if @project.badges.present?
|
|
|
|
.project-badges.mb-2
|
|
|
|
- @project.badges.each do |badge|
|
2020-06-01 11:08:16 -04:00
|
|
|
%a.gl-mr-3{ href: badge.rendered_link_url(@project),
|
2018-12-07 09:11:42 -05:00
|
|
|
target: '_blank',
|
|
|
|
rel: 'noopener noreferrer' }>
|
|
|
|
%img.project-badge{ src: badge.rendered_image_url(@project),
|
|
|
|
'aria-hidden': true,
|
|
|
|
alt: 'Project badge' }>
|