diff --git a/Handler/CreateChallenge.hs b/Handler/CreateChallenge.hs index 9f6002f..4e0e070 100644 --- a/Handler/CreateChallenge.hs +++ b/Handler/CreateChallenge.hs @@ -93,7 +93,7 @@ addChallenge name publicRepoId privateRepoId chan = do challengeDescription=(T.pack $ description), challengeStamp=time, challengeImage=mImage, - challengeStarred=Just False} + challengeStarred=False} updateTests challengeId chan return () diff --git a/Handler/Home.hs b/Handler/Home.hs index 9e19e1a..a15fbe8 100644 --- a/Handler/Home.hs +++ b/Handler/Home.hs @@ -17,7 +17,7 @@ getHomeR = do maybeUser <- maybeAuth master <- getYesod - starredChallenges <- runDB $ selectList [ChallengeStarred ==. Just True] [Asc ChallengeStarred, Desc ChallengeStamp] + starredChallenges <- runDB $ selectList [ChallengeStarred ==. True] [Desc ChallengeStamp] let maybeLocalId = case maybeUser of Just user -> userLocalId $ entityVal user diff --git a/Handler/ListChallenges.hs b/Handler/ListChallenges.hs index 7edb161..3ef1b60 100644 --- a/Handler/ListChallenges.hs +++ b/Handler/ListChallenges.hs @@ -4,7 +4,7 @@ import Import getListChallengesR :: Handler Html getListChallengesR = do - challenges <- runDB $ selectList [] [Asc ChallengeStarred, Desc ChallengeStamp] + challenges <- runDB $ selectList [] [Desc ChallengeStarred, Desc ChallengeStamp] defaultLayout $ do setTitle "List challenges" $(widgetFile "list-challenges") diff --git a/config/models b/config/models index 410948a..9da1e08 100644 --- a/config/models +++ b/config/models @@ -37,7 +37,7 @@ Challenge description Text stamp UTCTime default=now() image ByteString Maybe - starred Bool Maybe + starred Bool Test challenge ChallengeId metric Metric diff --git a/templates/list-challenges-core.hamlet b/templates/list-challenges-core.hamlet index c3b5f9c..04d322c 100644 --- a/templates/list-challenges-core.hamlet +++ b/templates/list-challenges-core.hamlet @@ -1,7 +1,7 @@ $forall (Entity challengeId challenge) <- challenges
#{challengeTitle challenge} - $if challengeStarred challenge == Just True + $if challengeStarred challenge \ $if isJust (challengeImage challenge)
#{challengeDescription challenge}