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 :: Text -> Bool
|
||||||
validateLen a =
|
validateLen a =
|
||||||
(T.length a) > 2
|
(T.length a) > 2
|
||||||
|
|
||||||
getThreatR :: Handler Html
|
|
||||||
getThreatR =
|
|
||||||
defaultLayout $
|
|
||||||
$(widgetFile "threat")
|
|
||||||
|
|
|
@ -50,3 +50,6 @@ infixr 5 <>
|
||||||
(<>) :: Monoid m => m -> m -> m
|
(<>) :: Monoid m => m -> m -> m
|
||||||
(<>) = mappend
|
(<>) = mappend
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
version :: Text
|
||||||
|
version = ""
|
||||||
|
|
15
Settings.hs
15
Settings.hs
|
@ -64,10 +64,8 @@ data AppSettings = AppSettings
|
||||||
-- ^ Perform no stylesheet/script combining
|
-- ^ Perform no stylesheet/script combining
|
||||||
|
|
||||||
-- Example app-specific configuration values.
|
-- Example app-specific configuration values.
|
||||||
, appCopyright :: Text
|
, appAfferoLink :: Text
|
||||||
-- ^ Copyright text to appear in the footer of the page
|
-- ^ Link to source code
|
||||||
, appCopyrightLink :: Text
|
|
||||||
-- ^ Link to Copyright
|
|
||||||
, appAnalytics :: Maybe Text
|
, appAnalytics :: Maybe Text
|
||||||
-- ^ Google Analytics code
|
-- ^ Google Analytics code
|
||||||
, appSignupBlocked :: Bool
|
, appSignupBlocked :: Bool
|
||||||
|
@ -75,10 +73,7 @@ data AppSettings = AppSettings
|
||||||
, appTos1 :: Text
|
, appTos1 :: Text
|
||||||
, appTos2 :: Text
|
, appTos2 :: Text
|
||||||
-- ^ Terms of Service
|
-- ^ Terms of Service
|
||||||
, appSearchHost :: Text
|
, appContactEmail :: Maybe Text
|
||||||
, appShards :: Int
|
|
||||||
, appReplicas :: Int
|
|
||||||
-- ^ Settings for Elasticsearch
|
|
||||||
}
|
}
|
||||||
|
|
||||||
instance FromJSON AppSettings where
|
instance FromJSON AppSettings where
|
||||||
|
@ -110,9 +105,7 @@ instance FromJSON AppSettings where
|
||||||
appTos1 <- o .: "tos1"
|
appTos1 <- o .: "tos1"
|
||||||
appTos2 <- o .: "tos2"
|
appTos2 <- o .: "tos2"
|
||||||
|
|
||||||
appSearchHost <- o .: "searchhost"
|
appContact <- o .:? "contactEmail"
|
||||||
appShards <- o .: "shards"
|
|
||||||
appReplicas <- o .: "replicas"
|
|
||||||
|
|
||||||
return AppSettings {..}
|
return AppSettings {..}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
/ HomeR GET
|
/ HomeR GET
|
||||||
/page/#Int PageR GET
|
/page/#Int PageR GET
|
||||||
/signup SignupR GET POST
|
/signup SignupR GET POST
|
||||||
/threat ThreatR GET
|
|
||||||
/login LoginR GET POST
|
/login LoginR GET POST
|
||||||
/logout LogoutR GET
|
/logout LogoutR GET
|
||||||
/activate/#T.Text ActivateR GET POST
|
/activate/#T.Text ActivateR GET POST
|
||||||
|
@ -74,3 +73,6 @@
|
||||||
!/feed/user/#T.Text/rss.xml NameFeedRssR GET
|
!/feed/user/#T.Text/rss.xml NameFeedRssR GET
|
||||||
|
|
||||||
-- /search SearchR GET
|
-- /search SearchR GET
|
||||||
|
|
||||||
|
/about AboutR GET
|
||||||
|
/about/threat ThreatR GET
|
||||||
|
|
|
@ -41,10 +41,11 @@ database:
|
||||||
database: "_env:PGDATABASE:eidolon"
|
database: "_env:PGDATABASE:eidolon"
|
||||||
poolsize: "_env:PGPOOLSIZE:10"
|
poolsize: "_env:PGPOOLSIZE:10"
|
||||||
|
|
||||||
copyright: Powered by Eidolon
|
afferoLink: https://github.com/nek0/eidolon
|
||||||
copyrightLink: https://github.com/nek0/eidolon
|
|
||||||
#analytics: UA-YOURCODE
|
#analytics: UA-YOURCODE
|
||||||
|
|
||||||
|
contactEmail: your@email.here
|
||||||
|
|
||||||
# block signup process
|
# block signup process
|
||||||
signupBlocked: "_env:SIGNUP_BLOCK:false"
|
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