1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
- can_add_new_domain = can_create_pages_custom_domains?(current_user, @project)
- verification_enabled = Gitlab::CurrentSettings.pages_domain_verification_enabled?
- if can?(current_user, :update_pages, @project)
= render ::Layouts::CrudComponent.new(s_('GitLabPages|Domains'),
icon: 'earth',
count: @domains.size,
count_options: { class: 'js-admin-labels-count' },
options: { class: 'gl-mt-5' }) do |c|
- c.with_actions do
- if can_add_new_domain
= render Pajamas::ButtonComponent.new(size: :small, href: new_project_pages_domain_path(@project)) do
= s_('GitLabPages|New domain')
- c.with_body do
- if @domains.any?
%ul.content-list
- @domains.each do |domain|
%li
.gl-flex.gl-justify-between.gl-items-baseline
.gl-flex.gl-gap-3
- if verification_enabled
- tooltip, status = domain.unverified? ? [s_('GitLabPages|Unverified'), 'failed'] : [s_('GitLabPages|Verified'), 'success']
.domain-status.ci-status-icon.has-tooltip{ class: "ci-status-icon-#{status}", title: tooltip }
= sprite_icon("status_#{status}")
.domain-name
= external_link(domain.url, domain.url)
- if domain.certificate && domain.pages_domain.subject
%div
= gl_badge_tag(s_('GitLabPages|Certificate: %{subject}') % { subject: domain.pages_domain.subject })
- if domain.expired?
= gl_badge_tag s_('GitLabPages|Expired'), variant: :danger
.gl-flex.gl-gap-2
= render Pajamas::ButtonComponent.new(href: project_pages_domain_path(@project, domain),
icon: 'pencil',
category: :tertiary,
button_options: { title: s_('GitLabPages|Edit'), data: { toggle: 'tooltip', container: 'body' } })
= render Pajamas::ButtonComponent.new(href: project_pages_domain_path(@project, domain),
icon: 'remove',
category: :tertiary,
button_options: { title: s_("GitLabPages|Remove domain"), "aria-label": s_("GitLabPages|Remove domain"), data: { method: :delete, confirm: s_('GitLabPages|Are you sure?'), 'confirm-btn-variant': 'danger', toggle: 'tooltip', container: 'body' } })
- if domain.needs_verification?
.gl-mt-3
- details_link_start = "<a href='#{project_pages_domain_path(@project, domain)}'>".html_safe
- details_link_end = '</a>'.html_safe
= render Pajamas::AlertComponent.new(dismissible: false,
variant: :warning) do |c|
- c.with_body do
= s_('GitLabPages|%{domain} is not verified. To learn how to verify ownership, visit your %{link_start}domain details%{link_end}.').html_safe % { domain: domain.domain,
link_start: details_link_start,
link_end: details_link_end }
- if domain.show_auto_ssl_failed_warning?
.gl-mt-3
- details_link_start = "<a href='#{project_pages_domain_path(@project, domain)}'>".html_safe
- details_link_end = '</a>'.html_safe
= render Pajamas::AlertComponent.new(dismissible: false,
variant: :warning) do |c|
- c.with_body do
= s_("GitLabPages|Something went wrong while obtaining the Let's Encrypt certificate for %{domain}. To retry visit your %{link_start}domain details%{link_end}.").html_safe % { domain: domain.domain,
link_start: details_link_start,
link_end: details_link_end }
- else
%span.gl-text-subtle= s_("You currently have no custom domains.")
|