Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_signature_badge.html.haml « commit « projects « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ad6b524c01bed36db2b7f4999ba663b86f7e74ad (plain)
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
- signature = local_assigns.fetch(:signature)
- title = local_assigns.fetch(:title)
- label = local_assigns.fetch(:label)
- css_class = local_assigns.fetch(:css_class)
- icon = local_assigns.fetch(:icon)
- show_user = local_assigns.fetch(:show_user, false)

- css_classes = commit_signature_badge_classes(css_class)

- title = capture do
  .gpg-popover-status
    .gpg-popover-icon{ class: css_class }
      = sprite_icon(icon)
    %div
      = title

- content = capture do
  - if show_user
    .clearfix
      - uri_signature_badge_user = "projects/commit/#{'x509/' if signature.x509?}signature_badge_user"
      = render partial: "#{uri_signature_badge_user}", locals: { signature: signature }

  - if signature.x509?
    = render partial: "projects/commit/x509/certificate_details", locals: { signature: signature }

    = link_to(_('Learn more about X.509 signed commits'), help_page_path('user/project/repository/x509_signed_commits/index.md'), class: 'gl-link gl-display-block')
  - elsif ::Feature.enabled?(:ssh_commit_signatures, signature.project) && signature.ssh?
    = _('SSH key fingerprint:')
    %span.gl-font-monospace= signature.key&.fingerprint_sha256 || _('Unknown')

    = link_to(_('Learn about signing commits with SSH keys.'), help_page_path('user/project/repository/ssh_signed_commits/index.md'), class: 'gl-link gl-display-block')
  - else
    = _('GPG Key ID:')
    %span.gl-font-monospace= signature.gpg_key_primary_keyid

    = link_to(_('Learn more about signing commits'), help_page_path('user/project/repository/gpg_signed_commits/index.md'), class: 'gl-link gl-display-block')

%a{ role: 'button', tabindex: 0, class: css_classes, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } }
  = label