Improve notification for a new version, show release notes

This commit is contained in:
2022-07-03 12:12:32 +09:30
parent 451335e17d
commit da970239a5
7 changed files with 82 additions and 41 deletions

View File

@@ -34,13 +34,12 @@
</div>
<div class="top-bar-right">
<ul class="menu">
{{ if newVersion }}
<li>
<div><a href="https://github.com/tardisx/linkwallet/releases/tag/{{ newVersion }}">{{ newVersion }} available</a></div>
</li>
{{ end }}
<li class="menu-text">
{{ version }}
<a href="/releaseinfo">{{ version.Local.Tag }}
{{ if version.UpgradeAvailable }}
{{ end }}
</a>
</li>
<li>
<a href="https://github.com/tardisx/linkwallet">
@@ -64,6 +63,8 @@
{{ template "config.html" . }}
{{ else if eq .page "edit" }}
{{ template "edit.html" . }}
{{ else if eq .page "releaseinfo" }}
{{ template "release_info.html" . }}
{{ end }}
{{/* template "foundation_sample.html" . */}}
</div>

View File

@@ -0,0 +1,23 @@
<div class="grid-x grid-padding-x">
<div class="large-12 cell">
<h5>Release info</h5>
{{ if not version.Remote.Valid }}
<p>GitHub version information not yet fetched.</p>
{{ else }}
{{ if version.UpgradeAvailable }}
<p>
A new version is available:
<a href="https://github.com/tardisx/linkwallet/releases/tag/{{ version.Remote.Tag }}">
{{ version.Remote.Tag }}
</a>
(you have {{ version.Local.Tag }}).
</p>
{{ markdown version.UpgradeReleaseNotes }}
{{ else }}
<p>You are currently running the most recent version.</p>
{{ end }}
{{ end }}
</div>