gitlab-org--gitlab-foss/app/views/projects/show.html.haml
Stan Hu c6ac04e4da Fix commit signature error when project is disabled
When a project is disabled, visiting the home page would show,
"An error occurred while loading commit signatures". This change checks
that the user has permission to view the project to avoid unnecessary
GPG signature lookups.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50903
2018-10-15 10:18:04 -07:00

44 lines
1.8 KiB
Text

- @no_container = true
- breadcrumb_title _("Details")
- @content_class = "limit-container-width" unless fluid_layout
- show_auto_devops_callout = show_auto_devops_callout?(@project)
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, project_path(@project, rss_url_options), title: "#{@project.name} activity")
= render partial: 'flash_messages', locals: { project: @project }
- if !@project.empty_repo? && can?(current_user, :download_code, @project)
- signatures_path = project_signatures_path(@project, @project.default_branch)
.js-signature-container{ data: { 'signatures-path': signatures_path } }
%div{ class: [container_class, ("limit-container-width" unless fluid_layout)] }
= render "projects/last_push"
= render "home_panel"
- if can?(current_user, :download_code, @project)
%nav.project-stats{ class: [container_class, ("limit-container-width" unless fluid_layout)] }
.scrolling-tabs-container.inner-page-scroll-tabs.is-smaller
.fade-left= icon('angle-left')
.fade-right= icon('angle-right')
.nav-links.scrolling-tabs
= render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout)
= render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout)
= repository_languages_bar(@project.repository_languages)
%div{ class: [container_class, ("limit-container-width" unless fluid_layout)] }
- if @project.archived?
.text-warning.center.prepend-top-20
%p
= icon("exclamation-triangle fw")
#{ _('Archived project! Repository and other project resources are read-only') }
- view_path = @project.default_view
- if show_auto_devops_callout?(@project)
= render 'shared/auto_devops_callout'
%div{ class: project_child_container_class(view_path) }
= render view_path