Display lebd version info in the footer next to the license info

This commit is contained in:
Danielle McLean 2017-10-05 09:58:32 +11:00
parent 8c3a562c7d
commit 062dd10b99
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
7 changed files with 23 additions and 2 deletions

View file

@ -32,4 +32,6 @@ database:
poolsize: "_env:MYSQL_POOLSIZE:10"
title: 00dani.me
app-name: lebd
repository: https://gitlab.com/00dani/lebd
#analytics: UA-YOURCODE

View file

@ -46,6 +46,7 @@ dependencies:
- time
- case-insensitive
- wai
- gitrev >= 1.3 && <1.4
- libravatar >=0.4 && <0.5
- yesod-sitemap >=1.4 && <1.5

View file

@ -20,6 +20,11 @@ import Yesod.Default.Util (addStaticContentExternal)
import Yesod.Core.Types (Logger)
import qualified Yesod.Core.Unsafe as Unsafe
import Development.GitRev (gitBranch)
appVersion :: Text
appVersion = $(gitBranch)
-- | The foundation datatype for your application. This can be a good place to
-- keep settings and values requiring initialization before your application
-- starts running, such as database connections. Every handler will have

View file

@ -64,6 +64,10 @@ data AppSettings = AppSettings
-- ^ Google Analytics code
, appTitle :: Maybe Text
-- ^ Site-wide title.
, appName :: Text
-- ^ Name of application used to generate site.
, appRepository :: Text
-- ^ URL of repository for application source.
, appAuthDummyLogin :: Bool
-- ^ Indicate if auth dummy login should be enabled.
@ -94,6 +98,8 @@ instance FromJSON AppSettings where
appAnalytics <- o .:? "analytics"
appTitle <- o .:? "title"
appName <- o .: "app-name"
appRepository <- o .: "repository"
-- This code enables MySQL's strict mode, without which MySQL will truncate data.
-- See https://github.com/yesodweb/persistent/wiki/Database-Configuration#strict-mode for details

View file

@ -7,6 +7,7 @@ $doctype 5
<title>#{pageTitle pc}
<meta name="description" content="">
<meta name="author" content="">
<meta name="generator" content="#{appName $ appSettings master} #{appVersion}">
$maybe route <- mcurrentRoute
<link rel="canonical" href=@{route}>

View file

@ -13,3 +13,5 @@ body
> footer
text-align: center
padding-bottom: 1em
display: flex
justify-content: space-evenly

View file

@ -28,5 +28,9 @@
^{widget}
<footer>
All content on this site is licensed under
a <a rel="license" href="//creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
<p>
all content licensed under
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">cc by-sa 4.0
<p>
powered by
<a href="#{appRepository $ appSettings master}/tree/#{appVersion}">#{appName $ appSettings master} #{appVersion}