2014-09-02 18:07:02 +05:30
|
|
|
- empty_repo = @project.empty_repo?
|
2019-02-15 15:39:39 +05:30
|
|
|
- show_auto_devops_callout = show_auto_devops_callout?(@project)
|
2019-10-12 21:52:04 +05:30
|
|
|
- emails_disabled = @project.emails_disabled?
|
2022-07-16 23:28:13 +05:30
|
|
|
- cache_enabled = Feature.enabled?(:cache_home_panel, @project, type: :development)
|
2019-10-12 21:52:04 +05:30
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
.project-home-panel.js-show-on-project-root.gl-mt-2.gl-mb-5{ class: [("empty-project" if empty_repo)] }
|
2023-03-04 22:38:38 +05:30
|
|
|
.gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3.gl-gap-5
|
|
|
|
.home-panel-title-row.gl-display-flex.gl-align-items-center
|
2021-04-29 21:17:54 +05:30
|
|
|
%div{ class: 'avatar-container rect-avatar s64 home-panel-avatar gl-flex-shrink-0 gl-w-11 gl-h-11 gl-mr-3! float-none' }
|
2021-01-29 00:20:46 +05:30
|
|
|
= project_icon(@project, alt: @project.name, class: 'avatar avatar-tile s64', width: 64, height: 64, itemprop: 'image')
|
2023-03-04 22:38:38 +05:30
|
|
|
%div
|
|
|
|
%h1.home-panel-title.gl-font-size-h1.gl-mt-3.gl-mb-2.gl-display-flex{ data: { qa_selector: 'project_name_content' }, itemprop: 'name' }
|
|
|
|
= @project.name
|
|
|
|
%span.visibility-icon.gl-text-secondary.has-tooltip.gl-ml-2{ data: { container: 'body' }, title: visibility_icon_description(@project) }
|
|
|
|
= visibility_level_icon(@project.visibility_level, options: { class: 'icon' })
|
|
|
|
= render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project, additional_classes: 'gl-align-self-center gl-ml-2'
|
2023-03-17 16:20:25 +05:30
|
|
|
- if @project.group
|
|
|
|
= render_if_exists 'shared/tier_badge', source: @project, source_type: 'Project'
|
2022-10-11 01:57:18 +05:30
|
|
|
.home-panel-metadata.gl-font-sm.gl-text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal{ data: { qa_selector: 'project_id_content' }, itemprop: 'identifier' }
|
2019-02-15 15:39:39 +05:30
|
|
|
- if can?(current_user, :read_project, @project)
|
2022-03-02 08:16:31 +05:30
|
|
|
%span.gl-display-inline-block.gl-vertical-align-middle
|
|
|
|
= s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id }
|
2022-07-16 23:28:13 +05:30
|
|
|
= clipboard_button(title: s_('ProjectPage|Copy project ID'), text: @project.id)
|
2019-02-15 15:39:39 +05:30
|
|
|
- if current_user
|
2022-03-02 08:16:31 +05:30
|
|
|
%span.gl-ml-3.gl-mb-3
|
2019-02-15 15:39:39 +05:30
|
|
|
= render 'shared/members/access_request_links', source: @project
|
2019-03-02 22:35:43 +05:30
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
= cache_if(cache_enabled, [@project, @project.star_count, @project.forks_count, :buttons, current_user, @notification_setting], expires_in: 1.day) do
|
2023-03-04 22:38:38 +05:30
|
|
|
.project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-center.gl-flex-wrap.gl-gap-3
|
2021-06-08 01:23:25 +05:30
|
|
|
- if current_user
|
2021-09-30 23:02:18 +05:30
|
|
|
- if current_user.admin?
|
2023-03-04 22:38:38 +05:30
|
|
|
= link_to [:admin, @project], class: 'btn btn-default gl-button btn-icon', title: _('View project in admin area'),
|
2022-08-27 11:52:29 +05:30
|
|
|
data: {toggle: 'tooltip', placement: 'top', container: 'body'} do
|
2021-09-30 23:02:18 +05:30
|
|
|
= sprite_icon('admin')
|
2023-03-04 22:38:38 +05:30
|
|
|
- if @notification_setting
|
|
|
|
.js-vue-notification-dropdown{ data: { disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), project_id: @project.id, no_flip: 'true' } }
|
2019-01-03 12:48:30 +05:30
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
= render 'projects/buttons/star'
|
|
|
|
= render 'projects/buttons/fork'
|
2016-06-16 23:09:34 +05:30
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
- if can?(current_user, :read_code, @project)
|
|
|
|
= cache_if(cache_enabled, [@project, :read_code], expires_in: 1.minute) do
|
2021-06-08 01:23:25 +05:30
|
|
|
%nav.project-stats
|
2021-11-18 22:05:49 +05:30
|
|
|
- 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)
|
2022-08-27 11:52:29 +05:30
|
|
|
.gl-my-3
|
|
|
|
= render "shared/projects/topics", project: @project, cache_enabled: cache_enabled
|
2019-03-02 22:35:43 +05:30
|
|
|
.home-panel-home-desc.mt-1
|
2019-02-15 15:39:39 +05:30
|
|
|
- if @project.description.present?
|
2019-09-04 21:01:54 +05:30
|
|
|
.home-panel-description.text-break
|
2021-02-22 17:27:13 +05:30
|
|
|
.home-panel-description-markdown.read-more-container{ itemprop: 'description' }
|
2019-02-15 15:39:39 +05:30
|
|
|
= markdown_field(@project, :description)
|
2021-03-11 19:13:27 +05:30
|
|
|
%button.btn.gl-button.btn-blank.btn-link.js-read-more-trigger.d-lg-none{ type: "button" }
|
2019-02-15 15:39:39 +05:30
|
|
|
= _("Read more")
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
- if @project.forked? && Feature.disabled?(:fork_divergence_counts, @project.fork_source)
|
2019-02-15 15:39:39 +05:30
|
|
|
%p
|
2019-12-04 20:38:33 +05:30
|
|
|
- source = visible_fork_source(@project)
|
|
|
|
- if source
|
2019-02-15 15:39:39 +05:30
|
|
|
#{ s_('ForkedFromProjectPath|Forked from') }
|
2020-03-13 15:44:24 +05:30
|
|
|
= link_to source.full_name, project_path(source), data: { qa_selector: 'forked_from_link' }
|
2019-02-15 15:39:39 +05:30
|
|
|
- else
|
2023-03-17 16:20:25 +05:30
|
|
|
= s_('ForkedFromProjectPath|Forked from an inaccessible project.')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-07-31 22:56:46 +05:30
|
|
|
= render_if_exists "projects/home_mirror"
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
- if @project.badges.present?
|
2022-04-04 11:22:00 +05:30
|
|
|
.project-badges.mb-2{ data: { qa_selector: 'project_badges_content' } }
|
2021-10-27 15:23:28 +05:30
|
|
|
- @project.badges.each do |badge|
|
2022-04-04 11:22:00 +05:30
|
|
|
- badge_link_url = badge.rendered_link_url(@project)
|
|
|
|
%a.gl-mr-3{ href: badge_link_url,
|
2021-10-27 15:23:28 +05:30
|
|
|
target: '_blank',
|
2022-04-04 11:22:00 +05:30
|
|
|
rel: 'noopener noreferrer',
|
|
|
|
data: { qa_selector: 'badge_image_link', qa_link_url: badge_link_url } }>
|
2021-10-27 15:23:28 +05:30
|
|
|
%img.project-badge{ src: badge.rendered_image_url(@project),
|
|
|
|
'aria-hidden': true,
|
|
|
|
alt: 'Project badge' }>
|