diff --git a/.editorconfig b/.editorconfig index 5b3a4ff79fd..6059fa100b7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,3 +23,6 @@ indent_size = 2 [Makefile] indent_style = tab + +[*.svg] +insert_final_newline = false diff --git a/assets/svg/gitea-lock-cog.svg b/assets/svg/gitea-lock-cog.svg new file mode 100644 index 00000000000..13e374a9d1c --- /dev/null +++ b/assets/svg/gitea-lock-cog.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/assets/svg/gitea-lock.svg b/assets/svg/gitea-lock.svg new file mode 100644 index 00000000000..2511b943311 --- /dev/null +++ b/assets/svg/gitea-lock.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/assets/svg/gitea-unlock.svg b/assets/svg/gitea-unlock.svg new file mode 100644 index 00000000000..afaa9f03deb --- /dev/null +++ b/assets/svg/gitea-unlock.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 51f56574c11..f9e8c4acb9a 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -90,7 +90,7 @@
{{if .Verification.Verified }} {{if ne .Verification.SigningUser.ID 0}} - + {{svg "gitea-lock" 16}} {{if eq .Verification.TrustStatus "trusted"}} {{.i18n.Tr "repo.commits.signed_by"}}: {{else if eq .Verification.TrustStatus "untrusted"}} @@ -102,17 +102,14 @@ {{.Verification.SigningUser.Name}} <{{.Verification.SigningEmail}}> {{.i18n.Tr "repo.commits.gpg_key_id"}}: {{.Verification.SigningKey.KeyID}} {{else}} - - - - + {{svg "gitea-lock-cog" 16}} {{.i18n.Tr "repo.commits.signed_by"}}: {{.Verification.SigningUser.Name}} <{{.Verification.SigningEmail}}> {{.i18n.Tr "repo.commits.gpg_key_id"}}: {{.Verification.SigningKey.KeyID}} {{end}} {{else if .Verification.Warning}} - + {{svg "gitea-unlock" 16}} {{.i18n.Tr .Verification.Reason}} {{.i18n.Tr "repo.commits.gpg_key_id"}}: {{.Verification.SigningKey.KeyID}} {{else}} diff --git a/templates/repo/shabox_badge.tmpl b/templates/repo/shabox_badge.tmpl index f4bd30fdb14..f46b52004e4 100644 --- a/templates/repo/shabox_badge.tmpl +++ b/templates/repo/shabox_badge.tmpl @@ -2,17 +2,14 @@ {{if .verification.Verified}}
{{if ne .verification.SigningUser.ID 0}} - + {{svg "gitea-lock" 16}} {{else}} - - - - + {{svg "gitea-lock-cog" 16}} {{end}}
{{else}} - + {{svg "gitea-unlock" 16}} {{end}}
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 2fd67b66fe0..b26f0fa8803 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1484,8 +1484,12 @@ margin-right: 0; } + .svg { + margin: 0 .25em 0 0; + } + > div { - display: inline-flex; + display: flex; align-items: center; } } diff --git a/webpack.config.js b/webpack.config.js index fa96f42e913..7b917cbdc10 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -50,7 +50,10 @@ module.exports = { serviceworker: [ resolve(__dirname, 'web_src/js/serviceworker.js'), ], - icons: glob('node_modules/@primer/octicons/build/svg/**/*.svg'), + icons: [ + ...glob('node_modules/@primer/octicons/build/svg/**/*.svg'), + ...glob('assets/svg/*.svg'), + ], ...themes, }, devtool: false,