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),
|
challengeDescription=(T.pack $ description),
|
||||||
challengeStamp=time,
|
challengeStamp=time,
|
||||||
challengeImage=mImage,
|
challengeImage=mImage,
|
||||||
challengeStarred=Just False}
|
challengeStarred=False}
|
||||||
updateTests challengeId chan
|
updateTests challengeId chan
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ getHomeR = do
|
|||||||
maybeUser <- maybeAuth
|
maybeUser <- maybeAuth
|
||||||
master <- getYesod
|
master <- getYesod
|
||||||
|
|
||||||
starredChallenges <- runDB $ selectList [ChallengeStarred ==. Just True] [Asc ChallengeStarred, Desc ChallengeStamp]
|
starredChallenges <- runDB $ selectList [ChallengeStarred ==. True] [Desc ChallengeStamp]
|
||||||
|
|
||||||
let maybeLocalId = case maybeUser of
|
let maybeLocalId = case maybeUser of
|
||||||
Just user -> userLocalId $ entityVal user
|
Just user -> userLocalId $ entityVal user
|
||||||
|
@ -4,7 +4,7 @@ import Import
|
|||||||
|
|
||||||
getListChallengesR :: Handler Html
|
getListChallengesR :: Handler Html
|
||||||
getListChallengesR = do
|
getListChallengesR = do
|
||||||
challenges <- runDB $ selectList [] [Asc ChallengeStarred, Desc ChallengeStamp]
|
challenges <- runDB $ selectList [] [Desc ChallengeStarred, Desc ChallengeStamp]
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle "List challenges"
|
setTitle "List challenges"
|
||||||
$(widgetFile "list-challenges")
|
$(widgetFile "list-challenges")
|
||||||
|
@ -37,7 +37,7 @@ Challenge
|
|||||||
description Text
|
description Text
|
||||||
stamp UTCTime default=now()
|
stamp UTCTime default=now()
|
||||||
image ByteString Maybe
|
image ByteString Maybe
|
||||||
starred Bool Maybe
|
starred Bool
|
||||||
Test
|
Test
|
||||||
challenge ChallengeId
|
challenge ChallengeId
|
||||||
metric Metric
|
metric Metric
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
$forall (Entity challengeId challenge) <- challenges
|
$forall (Entity challengeId challenge) <- challenges
|
||||||
<div class="panel panel-success">
|
<div class="panel panel-success">
|
||||||
<div class="panel-heading"><a .challenge-link href="@{ShowChallengeR (challengeName challenge)}">#{challengeTitle challenge}</a>
|
<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>
|
\ <span class="glyphicon glyphicon-star-empty"></span>
|
||||||
$if isJust (challengeImage challenge)
|
$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}
|
<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