forked from filipg/gonito
clean up starred
This commit is contained in:
parent
d38e14c07a
commit
f263913c6b
@ -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 ()
|
||||
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
@ -37,7 +37,7 @@ Challenge
|
||||
description Text
|
||||
stamp UTCTime default=now()
|
||||
image ByteString Maybe
|
||||
starred Bool Maybe
|
||||
starred Bool
|
||||
Test
|
||||
challenge ChallengeId
|
||||
metric Metric
|
||||
|
@ -1,7 +1,7 @@
|
||||
$forall (Entity challengeId challenge) <- challenges
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading"><a .challenge-link href="@{ShowChallengeR (challengeName challenge)}">#{challengeTitle challenge}</a>
|
||||
$if challengeStarred challenge == Just True
|
||||
$if challengeStarred challenge
|
||||
\ <span class="glyphicon glyphicon-star-empty"></span>
|
||||
$if isJust (challengeImage challenge)
|
||||
<div class="panel-body" style="background-image:url(@{ChallengeImageR challengeId}); background-color:lightgrey; background-blend-mode:screen;background-size: 100%;">#{challengeDescription challenge}
|
||||
|
Loading…
Reference in New Issue
Block a user