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
instance YesodPersistRunner App where
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 =
let complete = PluginR "browserid" []
......
......@@ -67,6 +67,7 @@ data Extra = Extra
{ extraCopyright :: Text
, extraSourceRepo :: Text
, extraGithubRepo :: Maybe Text
, extraSiteProject :: Text
, extraAnalytics :: Maybe Text -- ^ Google Analytics
} deriving Show
......@@ -75,4 +76,5 @@ parseExtra _ o = Extra
<$> o .: "copyright"
<*> o .: "source"
<*> o .:? "githubrepo"
<*> o .: "siteproject"
<*> o .:? "analytics"
......@@ -5,6 +5,7 @@ Default: &defaults
copyright: "2012-2014 Snowdrift.coop"
source: "https://gitorious.org/snowdrift/snowdrift"
githubrepo: "dlthomas/snowdrift"
siteproject: "snowdrift"
#analytics: UA-YOURCODE
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