From 34d2a8531c38d3a6f34755ff7cab6ed2e1c5d435 Mon Sep 17 00:00:00 2001 From: forgejo-backport-action Date: Fri, 7 Feb 2025 13:16:23 +0000 Subject: [PATCH] [v10.0/forgejo] fix(ui): display verified icon for default gpg key (#6833) **Backport:** https://codeberg.org/forgejo/forgejo/pulls/6803 ## Description Thank you for this amazing project! I recently noticed that the icon next to the GPG key reference appears to be incorrect for commits signed by the default GPG key: | Default GPG Key | User GPG Key | |---------|---------| | ![image](/attachments/ff27597a-d38c-48fc-8284-e16d4fd3ea2d) | ![image](/attachments/3c8c5540-dd29-45c9-a9f0-dc3b69677ef3) | Looking into the commit history of the template file, I noticed that Forgejo-signed commits originally had a distinct icon: [gitea-unlock-cog](https://codeberg.org/forgejo/forgejo/commit/b918609acc11d2deb1dd2182597c7cbb3624dbdb) --> [octicon-shield-lock](https://codeberg.org/forgejo/forgejo/commit/12ddc48c5c02123b1e6dab9d2d38b03f027d196e) --> octicon-unverified (current) Since `octicon-unverified` is also used when a commit cannot be verified (.Verification.Warning), I find it misleading for successfully signed commits. This PR changes the icon to the verified variant for better clarity. ### Tests 1. Set up automatic commit signing by Forgejo ([guide](https://forgejo.org/docs/latest/admin/signing/#automatic-signing)) 2. Trigger automatic commit signing in any of the following scenarios: - Repository Initialisation (should be the easiest) - Wiki Changes - CRUD actions using the editor or the API - Merges from Pull Requests 3. Open the commit signed by Forgejo 4. Verify that the icon next to the GPG key id is `octicon-verified`: ![image](/attachments/7b4eb81c-d33c-4daf-84dd-9f99ebb0b99d) ### Documentation - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [x] I want the title to show in the release notes with a link to this pull request. ## Release notes - User Interface bug fixes - [PR](https://codeberg.org/forgejo/forgejo/pulls/6803): fix(ui): display verified icon for default gpg key Co-authored-by: shgew Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6833 Reviewed-by: Gusted Reviewed-by: Beowulf Co-authored-by: forgejo-backport-action Co-committed-by: forgejo-backport-action --- templates/repo/commit_page.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 36de789dd1..7bc6dd1c97 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -217,8 +217,8 @@
{{if .Verification.Verified}} + {{svg "octicon-verified" 16 "tw-mr-2"}} {{if ne .Verification.SigningUser.ID 0}} - {{svg "octicon-verified" 16 "tw-mr-2"}} {{if .Verification.SigningSSHKey}} {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: {{.Verification.SigningSSHKey.Fingerprint}} @@ -227,7 +227,6 @@ {{.Verification.SigningKey.PaddedKeyID}} {{end}} {{else}} - {{svg "octicon-unverified" 16 "tw-mr-2"}} {{if .Verification.SigningSSHKey}} {{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}: {{.Verification.SigningSSHKey.Fingerprint}}