From 8ccce9d54541de5cbc8e5ce4a33fcefd402bdda4 Mon Sep 17 00:00:00 2001 From: Alexis Reigel Date: Thu, 6 Jul 2017 16:36:57 +0200 Subject: [PATCH] use existing status-box css class for gpg badge --- app/assets/stylesheets/pages/commits.scss | 16 +++++++++------- .../commit/_invalid_signature_badge.html.haml | 2 +- .../projects/commit/_signature_badge.html.haml | 6 +++--- .../commit/_valid_signature_badge.html.haml | 8 ++++---- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss index b6e9053fbce..16a8c399bc6 100644 --- a/app/assets/stylesheets/pages/commits.scss +++ b/app/assets/stylesheets/pages/commits.scss @@ -284,22 +284,24 @@ } } -.gpg-badge { +.gpg-status-box { &.valid { color: $brand-success; + border: 1px solid $brand-success; } &.invalid { color: $gray; + border: 1px solid $gray; } } -.gpg-badge-popover-title { +.gpg-popover-title { display: inline; font-weight: normal; } -.gpg-badge-popover-icon { +.gpg-popover-icon { float: left; font-size: 35px; line-height: 35px; @@ -315,12 +317,12 @@ } } -.gpg-badge-popover-user-link { +.gpg-popover-user-link { text-decoration: none; color: $gl-text-color; } -.gpg-badge-popover-avatar { +.gpg-popover-avatar { float: left; margin-bottom: $gl-padding; @@ -329,11 +331,11 @@ } } -.gpg-badge-popover-username { +.gpg-popover-username { font-weight: bold; } -.commit .gpg-badge-popover-help-link { +.commit .gpg-popover-help-link { display: block; color: $link-color; } diff --git a/app/views/projects/commit/_invalid_signature_badge.html.haml b/app/views/projects/commit/_invalid_signature_badge.html.haml index 29c787bd324..24b6040dcbb 100644 --- a/app/views/projects/commit/_invalid_signature_badge.html.haml +++ b/app/views/projects/commit/_invalid_signature_badge.html.haml @@ -1,5 +1,5 @@ - title = capture do - %i{ class: 'fa fa-question-circle gpg-badge-popover-icon invalid', 'aria-hidden' => 'true' } + %i{ class: 'fa fa-question-circle gpg-popover-icon invalid', 'aria-hidden' => 'true' } This commit was signed with an unverified signature. - locals = { signature: signature, title: title, label: 'Unverified', css_classes: ['invalid'] } diff --git a/app/views/projects/commit/_signature_badge.html.haml b/app/views/projects/commit/_signature_badge.html.haml index 2e046c1f684..88eb0505424 100644 --- a/app/views/projects/commit/_signature_badge.html.haml +++ b/app/views/projects/commit/_signature_badge.html.haml @@ -1,7 +1,7 @@ -- css_classes = %w(btn btn-xs gpg-badge) + css_classes +- css_classes = %w(btn status-box gpg-status-box) + css_classes - title = capture do - .gpg-badge-popover-title + .gpg-popover-title = title - content = capture do @@ -11,7 +11,7 @@ GPG key ID: = signature.gpg_key_primary_keyid - = link_to('Learn about signing commits', help_page_path('workflow/gpg_signed_commits/index.md'), class: 'gpg-badge-popover-help-link') + = link_to('Learn about signing commits', help_page_path('workflow/gpg_signed_commits/index.md'), class: 'gpg-popover-help-link') %button{ class: css_classes, data: { toggle: 'popover', html: 'true', placement: 'auto bottom', title: title, content: content } } = label diff --git a/app/views/projects/commit/_valid_signature_badge.html.haml b/app/views/projects/commit/_valid_signature_badge.html.haml index 47226466b85..a94fe9ef9a1 100644 --- a/app/views/projects/commit/_valid_signature_badge.html.haml +++ b/app/views/projects/commit/_valid_signature_badge.html.haml @@ -1,15 +1,15 @@ - title = capture do - %i{ class: 'fa fa-check-circle gpg-badge-popover-icon valid', 'aria-hidden' => 'true' } + %i{ class: 'fa fa-check-circle gpg-popover-icon valid', 'aria-hidden' => 'true' } This commit was signed with a verified signature. - content = capture do - gpg_key = signature.gpg_key - = link_to user_path(gpg_key.user), class: 'gpg-badge-popover-user-link' do - .gpg-badge-popover-avatar + = link_to user_path(gpg_key.user), class: 'gpg-popover-user-link' do + .gpg-popover-avatar = user_avatar_without_link(user: signature.gpg_key.user, size: 32) - .gpg-badge-popover-username + .gpg-popover-username = gpg_key.user.username %div= gpg_key.user.name