building about page
This commit is contained in:
parent
3a57a4996d
commit
ae9688b00f
8 changed files with 64 additions and 20 deletions
27
Handler/About.hs
Normal file
27
Handler/About.hs
Normal file
|
@ -0,0 +1,27 @@
|
|||
-- eidolon -- A simple gallery in Haskell and Yesod
|
||||
-- Copyright (C) 2015 Amedeo Molnár
|
||||
--
|
||||
-- This program is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU Affero General Public License as published
|
||||
-- by the Free Software Foundation, either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU Affero General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU Affero General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import Import
|
||||
|
||||
getAboutR :: Handler Html
|
||||
getAboutR =
|
||||
defaultLayout $
|
||||
$(widgetFile "about")
|
||||
|
||||
getThreatR :: Handler Html
|
||||
getThreatR =
|
||||
defaultLayout $
|
||||
$(widgetFile "threat")
|
|
@ -84,8 +84,3 @@ postSignupR = do
|
|||
validateLen :: Text -> Bool
|
||||
validateLen a =
|
||||
(T.length a) > 2
|
||||
|
||||
getThreatR :: Handler Html
|
||||
getThreatR =
|
||||
defaultLayout $
|
||||
$(widgetFile "threat")
|
||||
|
|
|
@ -50,3 +50,6 @@ infixr 5 <>
|
|||
(<>) :: Monoid m => m -> m -> m
|
||||
(<>) = mappend
|
||||
#endif
|
||||
|
||||
version :: Text
|
||||
version = ""
|
||||
|
|
15
Settings.hs
15
Settings.hs
|
@ -64,10 +64,8 @@ data AppSettings = AppSettings
|
|||
-- ^ Perform no stylesheet/script combining
|
||||
|
||||
-- Example app-specific configuration values.
|
||||
, appCopyright :: Text
|
||||
-- ^ Copyright text to appear in the footer of the page
|
||||
, appCopyrightLink :: Text
|
||||
-- ^ Link to Copyright
|
||||
, appAfferoLink :: Text
|
||||
-- ^ Link to source code
|
||||
, appAnalytics :: Maybe Text
|
||||
-- ^ Google Analytics code
|
||||
, appSignupBlocked :: Bool
|
||||
|
@ -75,10 +73,7 @@ data AppSettings = AppSettings
|
|||
, appTos1 :: Text
|
||||
, appTos2 :: Text
|
||||
-- ^ Terms of Service
|
||||
, appSearchHost :: Text
|
||||
, appShards :: Int
|
||||
, appReplicas :: Int
|
||||
-- ^ Settings for Elasticsearch
|
||||
, appContactEmail :: Maybe Text
|
||||
}
|
||||
|
||||
instance FromJSON AppSettings where
|
||||
|
@ -110,9 +105,7 @@ instance FromJSON AppSettings where
|
|||
appTos1 <- o .: "tos1"
|
||||
appTos2 <- o .: "tos2"
|
||||
|
||||
appSearchHost <- o .: "searchhost"
|
||||
appShards <- o .: "shards"
|
||||
appReplicas <- o .: "replicas"
|
||||
appContact <- o .:? "contactEmail"
|
||||
|
||||
return AppSettings {..}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
/ HomeR GET
|
||||
/page/#Int PageR GET
|
||||
/signup SignupR GET POST
|
||||
/threat ThreatR GET
|
||||
/login LoginR GET POST
|
||||
/logout LogoutR GET
|
||||
/activate/#T.Text ActivateR GET POST
|
||||
|
@ -74,3 +73,6 @@
|
|||
!/feed/user/#T.Text/rss.xml NameFeedRssR GET
|
||||
|
||||
-- /search SearchR GET
|
||||
|
||||
/about AboutR GET
|
||||
/about/threat ThreatR GET
|
||||
|
|
|
@ -41,10 +41,11 @@ database:
|
|||
database: "_env:PGDATABASE:eidolon"
|
||||
poolsize: "_env:PGPOOLSIZE:10"
|
||||
|
||||
copyright: Powered by Eidolon
|
||||
copyrightLink: https://github.com/nek0/eidolon
|
||||
afferoLink: https://github.com/nek0/eidolon
|
||||
#analytics: UA-YOURCODE
|
||||
|
||||
contactEmail: your@email.here
|
||||
|
||||
# block signup process
|
||||
signupBlocked: "_env:SIGNUP_BLOCK:false"
|
||||
|
||||
|
|
23
templates/about.hamlet
Normal file
23
templates/about.hamlet
Normal file
|
@ -0,0 +1,23 @@
|
|||
$newline always
|
||||
|
||||
<div .medium>
|
||||
<h1>About this Eidolon
|
||||
<p> Build version: #{version}
|
||||
<p>
|
||||
This software is licenced under the
|
||||
<a href="http://www.gnu.org/licenses/agpl-3.0">
|
||||
GNU Affero General Public License 3.0
|
||||
.
|
||||
<p>
|
||||
The source code for this instance canbe found at
|
||||
<a href="#{appAfferoLink $ appSettings master} target=_blank>
|
||||
#{appAfferoLink $ appSettings master}
|
||||
.
|
||||
$maybe contact <- appContactEmail $ appSettings master
|
||||
<p>
|
||||
if you wish to contact the maintaner of this Eidolon, you can do it by
|
||||
<a href="mailto:#{appContactEmail $ appSettings master}">
|
||||
email
|
||||
.
|
||||
<a href=@{ThreatR}>
|
||||
Data and threat analysis
|
|
@ -1 +1 @@
|
|||
<a href=#{appCopyrightLink $ appSettings master} target=_blank>#{appCopyright $ appSettings master}
|
||||
<a href=@{AboutR} target=_blank>About Eidolon
|
||||
|
|
Loading…
Reference in a new issue