Permalink
Browse files

A few fixes

  • Loading branch information...
1 parent 08f642b commit 9569a4c3b26f1f1f564293e42ee4649bfad3674d @snoyberg committed Feb 28, 2012
Showing with 35 additions and 6 deletions.
  1. +2 −2 Application.hs
  2. +1 −1 Foundation.hs
  3. +3 −2 Handler/Root.hs
  4. +26 −0 devel.hs
  5. +2 −1 hamlet/default-layout.hamlet
  6. +1 −0 haskellers.cabal
View
@@ -77,8 +77,8 @@ getApplication approot = do
where
s = static Settings.staticdir
-getApplicationDev :: IO Application
-getApplicationDev = getApplication "http://localhost:3000"
+getApplicationDev :: IO (Int, Application)
+getApplicationDev = ((,) 3000) `fmap` getApplication "http://localhost:3000"
getHomepageProfs :: ConnectionPool -> IO [Profile]
getHomepageProfs pool = flip runConnectionPool pool $ do
View
@@ -156,7 +156,7 @@ instance Yesod Haskellers where
where
corrected = filter (not . T.null) s
- approot = theApproot
+ approot = ApprootMaster theApproot
defaultLayout widget = do
mmsg <- getMessage
View
@@ -120,13 +120,14 @@ filterForm my = renderTable $ Filter
<$> aopt textField "Name" Nothing
<*> aopt (yearField 1980 my) "Started using Haskell no earlier than" Nothing
<*> aopt (yearField 1980 my) "Started using Haskell no later than" Nothing
- <*> areq boolField "Interested in full-time positions" Nothing
- <*> areq boolField "Interested in part-time positions" Nothing
+ <*> areq boolField "Must be interested in full-time positions" (Just False)
+ <*> areq boolField "Must be interested in part-time positions" (Just False)
yearField :: Int -> Int -> Field sub master Int
yearField minY maxY = Field
{ fieldParse = \ss -> return $
case ss of
+ [""] -> Right Nothing
[s] ->
case readIntegral $ T.unpack s of
Nothing -> Left "Invalid integer"
View
@@ -0,0 +1,26 @@
+{-# LANGUAGE PackageImports #-}
+import "haskellers" Application (getApplicationDev)
+import Network.Wai.Handler.Warp
+ (runSettings, defaultSettings, settingsPort)
+import Control.Concurrent (forkIO)
+import System.Directory (doesFileExist, removeFile)
+import System.Exit (exitSuccess)
+import Control.Concurrent (threadDelay)
+
+main :: IO ()
+main = do
+ putStrLn "Starting devel application"
+ (port, app) <- getApplicationDev
+ forkIO $ runSettings defaultSettings
+ { settingsPort = port
+ } app
+ loop
+
+loop :: IO ()
+loop = do
+ threadDelay 100000
+ e <- doesFileExist "dist/devel-terminate"
+ if e then terminateDevel else loop
+
+terminateDevel :: IO ()
+terminateDevel = exitSuccess
@@ -27,9 +27,10 @@
<div id="main_menu">
<a id="overview" href="@{RootR}">_{MsgOverview}
<a id="teams" href="@{TeamsR}">_{MsgGroups}
- <a id="find_haskeller" href="@{UsersR}">_{MsgFindAHaskeller}
+ <a id="find_haskeller" href="@{UsersR}">Find<br>a Haskeller
<a id="find_job" href="@{JobsR}">_{MsgFindAJob}
<div id="secondary_menu">
+ <a href=@{PollsR}>Polls
<a href=@{BlingR}>_{MsgBling}
<a href="@{FaqR}">_{MsgFAQ}
<a href="@{NewsR}">_{MsgNewsArchive}
View
@@ -42,6 +42,7 @@ library
Handler.Team
Handler.Topic
Handler.User
+ Handler.Poll
SESCreds
ghc-options: -Wall -Werror -O0

0 comments on commit 9569a4c

Please sign in to comment.