Change copy and design on WF Updates page

- Tweak the copy
- Include link to download latest release
- Change the version status design a bit
- Restyle some text
admin-dashboard-redesign
Matt Baer 5 years ago
parent 48ca695c46
commit a06bb457de
  1. 2
      admin.go
  2. 5
      less/core.less
  3. 20
      templates/user/admin/app-updates.tmpl
  4. 4
      updates.go

@ -586,6 +586,7 @@ func handleViewAdminUpdates(app *App, u *User, w http.ResponseWriter, r *http.Re
LastChecked string LastChecked string
LastChecked8601 string LastChecked8601 string
LatestVersion string LatestVersion string
LatestReleaseURL string
LatestReleaseNotesURL string LatestReleaseNotesURL string
UpdateAvailable bool UpdateAvailable bool
}{ }{
@ -595,6 +596,7 @@ func handleViewAdminUpdates(app *App, u *User, w http.ResponseWriter, r *http.Re
p.LastChecked = app.updates.lastCheck.Format("January 2, 2006, 3:04 PM") p.LastChecked = app.updates.lastCheck.Format("January 2, 2006, 3:04 PM")
p.LastChecked8601 = app.updates.lastCheck.Format("2006-01-02T15:04:05Z") p.LastChecked8601 = app.updates.lastCheck.Format("2006-01-02T15:04:05Z")
p.LatestVersion = app.updates.LatestVersion() p.LatestVersion = app.updates.LatestVersion()
p.LatestReleaseURL = app.updates.ReleaseURL()
p.LatestReleaseNotesURL = app.updates.ReleaseNotesURL() p.LatestReleaseNotesURL = app.updates.ReleaseNotesURL()
p.UpdateAvailable = app.updates.AreAvailable() p.UpdateAvailable = app.updates.AreAvailable()
} }

@ -1345,6 +1345,11 @@ div.row {
} }
} }
.check {
font-size: 1.125em;
color: #71D571;
}
@media all and (max-width: 450px) { @media all and (max-width: 450px) {
body#post { body#post {
header { header {

@ -2,20 +2,24 @@
{{template "header" .}} {{template "header" .}}
<style type="text/css"> <style type="text/css">
p.intro {
text-align: left;
}
</style> </style>
<div class="content-container snug"> <div class="content-container snug">
{{template "admin-header" .}} {{template "admin-header" .}}
{{if not .UpdateAvailable}} {{if not .UpdateAvailable}}
<p class="alert info">WriteFreely is up to date.</p> <p class="intro"><span class="check">&check;</span> WriteFreely is <strong>up to date</strong>.</p>
{{else}} <p>Installed version: <strong>{{.Version}}</strong> (<a href="{{.LatestReleaseNotesURL}}" target="changelog-wf">release notes</a>).</p>
<p class="alert info">WriteFreely {{.LatestVersion}} is available.</p> {{else}}
<section class="changelog"> <p class="intro">A new version of WriteFreely is available! <a href="{{.LatestReleaseURL}}" target="download-wf" style="font-weight: bold;">Get {{.LatestVersion}}</a></p>
For details on features, bug fixes or notes on upgrading, <a href="{{.LatestReleaseNotesURL}}">read the release notes</a>. <p class="changelog">
</section> <a href="{{.LatestReleaseNotesURL}}" target="changelog-wf">Read the release notes</a> for details on features, bug fixes, and notes on upgrading from your current version, <strong>{{.Version}}</strong>.
{{end}} </p>
<p>Last checked at: <time class="dt-published" datetime="{{.LastChecked8601}}">{{.LastChecked}}</time>. <a href="/admin/updates?check=now">Check now</a>.</p> {{end}}
<p style="font-size: 0.86em;"><em>Last checked</em>: <time class="dt-published" datetime="{{.LastChecked8601}}">{{.LastChecked}}</time>. <a href="/admin/updates?check=now">Check now</a>.</p>
<script> <script>
// Code modified from /js/localdate.js // Code modified from /js/localdate.js

@ -63,6 +63,10 @@ func (uc updatesCache) LatestVersion() string {
return uc.latestVersion return uc.latestVersion
} }
func (uc updatesCache) ReleaseURL() string {
return "https://writefreely.org/releases/" + uc.latestVersion
}
// ReleaseNotesURL returns the full URL to the blog.writefreely.org release notes // ReleaseNotesURL returns the full URL to the blog.writefreely.org release notes
// for the latest version as stored in the cache. // for the latest version as stored in the cache.
func (uc updatesCache) ReleaseNotesURL() string { func (uc updatesCache) ReleaseNotesURL() string {

Loading…
Cancel
Save