File: _signature_badge.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (36 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download
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
- signature = local_assigns.fetch(:signature)
- title = local_assigns.fetch(:title)
- description = local_assigns.fetch(:description, nil)
- label = local_assigns.fetch(:label)
- variant = local_assigns.fetch(:variant)
- icon = local_assigns.fetch(:icon, nil)

- title = capture do
  .signature-popover
    %div
      %strong
        = title

      %p.gl-my-3
        = description

- content = capture do
  - if signature.nil?
    = _('Unsupported signature')
  - elsif 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/signed_commits/x509.md'), class: 'gl-link gl-block')
  - elsif 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/signed_commits/ssh.md'), class: 'gl-link gl-block gl-mt-3')
  - else
    = _('GPG Key ID:')
    %span.gl-font-monospace= signature.gpg_key_primary_keyid

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

%a.signature-badge.gl-inline-flex.gl-ml-4.gl-align-middle{ role: 'button', tabindex: 0, data: { toggle: 'popover', html: 'true', placement: 'bottom', title: title, content: content } }
  = gl_badge_tag label, variant: variant, icon: icon