diff --git a/Foundation.hs b/Foundation.hs index 592b478..9af1df8 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -121,7 +121,8 @@ instance Yesod App where -- default-layout-wrapper is the entire page. Since the final -- value passed to hamletToRepHtml cannot be a widget, this allows -- you to use normal widget features in default-layout. - + copyrightWidget <- widgetToPageContent $ + $(widgetFile "copyright") pc <- widgetToPageContent $ do $(combineStylesheets 'StaticR [ css_bootstrap_css diff --git a/Settings.hs b/Settings.hs index f0c89f6..1995bbf 100644 --- a/Settings.hs +++ b/Settings.hs @@ -67,12 +67,15 @@ data AppSettings = AppSettings -- ^ Copyright text to appear in the footer of the page , appAnalytics :: Maybe Text -- ^ Google Analytics code - , appEmail :: Text + , appEmail :: Text -- ^ notification address , appCurrency :: Text -- ^ Currency character , appCashCharge :: Int -- ^ Extra charge for paying in cash in cents + , appCopyright :: Text + , appCopyrightLink :: Text + -- ^ Text and link to source } instance FromJSON AppSettings where @@ -96,11 +99,12 @@ instance FromJSON AppSettings where appMutableStatic <- o .:? "mutable-static" .!= defaultDev appSkipCombining <- o .:? "skip-combining" .!= defaultDev - -- appCopyright <- o .: "copyright" appAnalytics <- o .:? "analytics" appEmail <- o .: "email" appCurrency <- o .: "currency" appCashCharge <- o .: "cash_charge" + appCopyright <- o .: "copyright" + appCopyrightLink <- o .: "copyright_link" return AppSettings {..} diff --git a/config/settings.yml b/config/settings.yml index 5f7ed13..0bfe998 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -29,3 +29,6 @@ database: email: "nek0@momen" currency: "€" cash_charge: 50 + +copyright: "Powered by YAMMAT" +copyright_link: "https://github.com/nek0/yammat" diff --git a/static/css/main.css b/static/css/main.css index 6e75796..5a2851d 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -27,7 +27,7 @@ .right { display: inline-block; - /*float: right;*/ + float: right; padding: 2em; } @@ -131,7 +131,7 @@ footer { margin-top: 1em; } -footer a { +footer span a { margin-top: 1em; display: inline-block; position: relative; diff --git a/templates/copyright.hamlet b/templates/copyright.hamlet new file mode 100644 index 0000000..b29efed --- /dev/null +++ b/templates/copyright.hamlet @@ -0,0 +1 @@ +#{appCopyright $ appSettings master} diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index 89a7732..67821a3 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -30,3 +30,5 @@ _{MsgSummary} _{MsgAvatars} +
+ ^{pageBody copyrightWidget}