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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-07-05 21:59:17 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 16:43:37 +0300
commit36c05b311c830aef25ecb7ad4416ac77a5c98651 (patch)
tree15bac00cb6fbcfc589ca9bdbf01d9e7be61c7265 /app/helpers/commits_helper.rb
parent084cc718f759a37c8fc5535930daeee5e819c30f (diff)
convert gpg badge helper methods to partials
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r--app/helpers/commits_helper.rb86
1 files changed, 0 insertions, 86 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 60acc1e2f82..d08e346d605 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -212,90 +212,4 @@ module CommitsHelper
[commits, 0]
end
end
-
- def commit_gpg_signature_badge(signature)
- if signature.valid_signature?
- commit_gpg_valid_signature_badge(signature)
- else
- commit_gpg_invalid_signature_badge(signature)
- end
- end
-
- def commit_gpg_valid_signature_badge(signature)
- title = capture do
- concat content_tag('i', '', class: 'fa fa-check-circle gpg-badge-popover-icon valid', 'aria-hidden' => 'true')
- concat 'This commit was signed with a verified signature.'
- end
-
- content = capture do
- link_to user_path(signature.gpg_key.user), class: 'gpg-badge-popover-user-link' do
- concat(
- content_tag(:div, class: 'gpg-badge-popover-avatar') do
- user_avatar_without_link(user: signature.gpg_key.user, size: 32)
- end
- )
-
- concat(
- content_tag(:div, class: 'gpg-badge-popover-username') do
- signature.gpg_key.user.username
- end
- )
-
- concat(
- content_tag(:div) do
- signature.gpg_key.user.name
- end
- )
- end
- end
-
- commit_gpg_signature_badge_with(signature, label: 'Verified', title: title, content: content, css_classes: ['valid'])
- end
-
- def commit_gpg_invalid_signature_badge(signature)
- title = capture do
- concat content_tag('i', '', class: 'fa fa-question-circle gpg-badge-popover-icon invalid', 'aria-hidden' => 'true')
- concat 'This commit was signed with an unverified signature.'
- end
- commit_gpg_signature_badge_with(signature, label: 'Unverified', title: title, css_classes: ['invalid'])
- end
-
- def commit_gpg_signature_badge_with(signature, label:, title: '', content: '', css_classes: [])
- css_classes = %w(btn btn-xs gpg-badge) + css_classes
-
- content = capture do
- concat(
- content_tag(:div, class: 'clearfix') do
- content
- end
- )
-
- concat "GPG key ID: #{signature.gpg_key_primary_keyid}"
- concat(
- link_to(
- 'Learn about signing commits',
- help_page_path('workflow/gpg_signed_commits/index.md'),
- class: 'gpg-badge-popover-help-link'
- )
- )
- end
-
- title = capture do
- content_tag 'span', class: 'gpg-badge-popover-title' do
- title
- end
- end
-
- data = {
- toggle: 'popover',
- html: 'true',
- placement: 'auto bottom',
- title: title,
- content: content
- }
-
- content_tag :button, class: css_classes, data: data do
- label
- end
- end
end