We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 3c2c776b authored by wolftune's avatar wolftune

settings for a siteproject instead of hardcoding "snowdrift" as the project

parent 58889ffa
...@@ -233,6 +233,18 @@ instance YesodPersist App where ...@@ -233,6 +233,18 @@ instance YesodPersist App where
instance YesodPersistRunner App where instance YesodPersistRunner App where
getDBRunner = defaultGetDBRunner connPool getDBRunner = defaultGetDBRunner connPool
-- set which project in the site runs the site itself
getSiteProject :: Handler (Entity Project)
getSiteProject = do
handle <- getSiteProjectHandle
project <- runDB $ getBy $ UniqueProjectHandle handle
case project of
Nothing -> error "The site project defined for this website doesn't exist."
Just a -> return a
getSiteProjectHandle :: Handler Text
getSiteProjectHandle = extraSiteProject . appExtra . settings <$> getYesod
authBrowserIdFixed :: AuthPlugin App authBrowserIdFixed :: AuthPlugin App
authBrowserIdFixed = authBrowserIdFixed =
let complete = PluginR "browserid" [] let complete = PluginR "browserid" []
......
...@@ -67,6 +67,7 @@ data Extra = Extra ...@@ -67,6 +67,7 @@ data Extra = Extra
{ extraCopyright :: Text { extraCopyright :: Text
, extraSourceRepo :: Text , extraSourceRepo :: Text
, extraGithubRepo :: Maybe Text , extraGithubRepo :: Maybe Text
, extraSiteProject :: Text
, extraAnalytics :: Maybe Text -- ^ Google Analytics , extraAnalytics :: Maybe Text -- ^ Google Analytics
} deriving Show } deriving Show
...@@ -75,4 +76,5 @@ parseExtra _ o = Extra ...@@ -75,4 +76,5 @@ parseExtra _ o = Extra
<$> o .: "copyright" <$> o .: "copyright"
<*> o .: "source" <*> o .: "source"
<*> o .:? "githubrepo" <*> o .:? "githubrepo"
<*> o .: "siteproject"
<*> o .:? "analytics" <*> o .:? "analytics"
...@@ -5,6 +5,7 @@ Default: &defaults ...@@ -5,6 +5,7 @@ Default: &defaults
copyright: "2012-2014 Snowdrift.coop" copyright: "2012-2014 Snowdrift.coop"
source: "https://gitorious.org/snowdrift/snowdrift" source: "https://gitorious.org/snowdrift/snowdrift"
githubrepo: "dlthomas/snowdrift" githubrepo: "dlthomas/snowdrift"
siteproject: "snowdrift"
#analytics: UA-YOURCODE #analytics: UA-YOURCODE
Development: Development:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment