From 0d79057bae1dfb571ec0e7e55b04be57332da2af Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Fri, 14 Feb 2020 16:13:54 -0500 Subject: [PATCH] Rename ReleaseURL() to ReleaseNotesURL() --- admin.go | 10 +++++----- templates/user/admin/app-updates.tmpl | 2 +- updates.go | 6 +++--- updates_test.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/admin.go b/admin.go index 8d71aad..e3a1b33 100644 --- a/admin.go +++ b/admin.go @@ -583,17 +583,17 @@ func handleViewAdminUpdates(app *App, u *User, w http.ResponseWriter, r *http.Re p := struct { *UserPage - LastChecked string - LatestVersion string - LatestReleaseURL string - UpdateAvailable bool + LastChecked string + LatestVersion string + LatestReleaseNotesURL string + UpdateAvailable bool }{ UserPage: NewUserPage(app, r, u, "Updates", nil), } if app.cfg.App.UpdateChecks { p.LastChecked = app.updates.lastCheck.Format("January 2, 2006, 3:04 PM") p.LatestVersion = app.updates.LatestVersion() - p.LatestReleaseURL = app.updates.ReleaseURL() + p.LatestReleaseNotesURL = app.updates.ReleaseNotesURL() p.UpdateAvailable = app.updates.AreAvailable() } diff --git a/templates/user/admin/app-updates.tmpl b/templates/user/admin/app-updates.tmpl index 540fb7c..3988a50 100644 --- a/templates/user/admin/app-updates.tmpl +++ b/templates/user/admin/app-updates.tmpl @@ -12,7 +12,7 @@ {{else}}

WriteFreely {{.LatestVersion}} is available.

- For details on features, bug fixes or notes on upgrading, read the release notes. + For details on features, bug fixes or notes on upgrading, read the release notes.
{{end}}

Last checked at: {{.LastChecked}}. Check now.

diff --git a/updates.go b/updates.go index c33247b..3a14233 100644 --- a/updates.go +++ b/updates.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2019-2020 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -63,9 +63,9 @@ func (uc updatesCache) LatestVersion() string { return uc.latestVersion } -// ReleaseURL 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. -func (uc updatesCache) ReleaseURL() string { +func (uc updatesCache) ReleaseNotesURL() string { ver := strings.TrimPrefix(uc.latestVersion, "v") ver = strings.TrimSuffix(ver, ".0") // hack until go 1.12 in build/travis diff --git a/updates_test.go b/updates_test.go index 2cb9f92..1c63f30 100644 --- a/updates_test.go +++ b/updates_test.go @@ -24,7 +24,7 @@ func TestUpdatesRoundTrip(t *testing.T) { }) t.Run("Release URL", func(t *testing.T) { - url := cache.ReleaseURL() + url := cache.ReleaseNotesURL() reg, err := regexp.Compile(`^https:\/\/blog.writefreely.org\/version(-\d+){1,}$`) if err != nil {