diff options
author | Florian Schmaus <flow@gentoo.org> | 2024-06-05 23:41:56 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-06-05 23:42:29 +0300 |
commit | 81dd95416fcb6c242731933082be1cd447366f73 (patch) | |
tree | 5f4131e2173d3b3a37efbc03233e7ea67bd74504 /pkg/app | |
parent | package/QA report: fix shown values and order (diff) | |
download | soko-81dd95416fcb6c242731933082be1cd447366f73.tar.gz soko-81dd95416fcb6c242731933082be1cd447366f73.tar.bz2 soko-81dd95416fcb6c242731933082be1cd447366f73.zip |
about: add link to commit when showing soko's current commit id
Based-on: Florian Schmaus <flow@gentoo.org>
Resolves: https://github.com/gentoo/soko/pull/26
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'pkg/app')
-rw-r--r-- | pkg/app/handler/about/index.templ | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/pkg/app/handler/about/index.templ b/pkg/app/handler/about/index.templ index 7d4311d..16a0b5f 100644 --- a/pkg/app/handler/about/index.templ +++ b/pkg/app/handler/about/index.templ @@ -9,22 +9,13 @@ func getCommitId() string { if info, ok := debug.ReadBuildInfo(); ok { for _, setting := range info.Settings { if setting.Key == "vcs.revision" { - return setting.Value[:8] + return setting.Value } } } return "" } -func versionText() string { - commitId := getCommitId() - version := config.Version() - if commitId == "" { - return "Currently " + version + " is running." - } - return "Currently " + version + " is running, based on commit " + commitId + "." -} - templ index() { <div class="container mb-5"> <div class="row"> @@ -40,7 +31,13 @@ templ index() { <h2>FAQ</h2> <dl> <dt>Which version is currently running?</dt> - <dd>{ versionText() }</dd> + <dd> + if commitId := getCommitId(); commitId == "" { + Currently { config.Version() } is running. + } else { + Currently { config.Version() } is running, based on commit <a href={ templ.URL("https://gitweb.gentoo.org/sites/soko.git/commit/?id=" + commitId) }>{ commitId[:8] }</a>. + } + </dd> <br/> <dt>How often is the site updated?</dt> <dd> |