diff --git a/Handler/Presentation.hs b/Handler/Presentation.hs index 62d5620..ab2be71 100644 --- a/Handler/Presentation.hs +++ b/Handler/Presentation.hs @@ -13,17 +13,39 @@ import Text.Hamlet (hamletFile) sampleChallengeName :: Text sampleChallengeName = "petite-difference-challenge" +sampleChallengeName' :: Text +sampleChallengeName' = "retroc" + + +sampleUserIdent :: Text +sampleUserIdent = "ptlen@ceti.pl" + getPresentation4RealR :: Handler Html getPresentation4RealR = do readme <- challengeReadme sampleChallengeName - (Entity challengeId challenge) <- runDB $ getBy404 $ UniqueName sampleChallengeName - Just repo <- runDB $ get $ challengePublicRepo challenge - (test, leaderboard) <- getLeaderboardEntries challengeId - let leaderboardWithRanks = zip [1..] leaderboard + challengeEnt@(Entity challengeId challenge) <- runDB $ getBy404 $ UniqueName sampleChallengeName + + (Just (Entity sampleUserId _)) <- runDB $ getBy $ UniqueUser sampleUserIdent + let condition = (\(Entity _ submission) -> (submissionSubmitter submission == sampleUserId)) + (evaluationMaps', tests) <- getChallengeSubmissionInfos condition challengeId + let evaluationMaps = take 10 evaluationMaps' + + sampleLeaderboard <- getSampleLeaderboard sampleChallengeName + sampleLeaderboard' <- getSampleLeaderboard sampleChallengeName' presentationLayout $(widgetFile "presentation-4real") + +getSampleLeaderboard name = do + challengeEnt@(Entity challengeId challenge) <- runDB $ getBy404 $ UniqueName sampleChallengeName + + Just repo <- runDB $ get $ challengePublicRepo challenge + (test, leaderboard) <- getLeaderboardEntries challengeId + let leaderboardWithRanks = zip [1..] (take 10 leaderboard) + + return $ Table.buildBootstrap (leaderboardTable Nothing (challengeName challenge) test) leaderboardWithRanks + presentationLayout widget = do master <- getYesod mmsg <- getMessage diff --git a/static/css/impress-demo.css b/static/css/impress-demo.css index 7164183..fa1ce10 100644 --- a/static/css/impress-demo.css +++ b/static/css/impress-demo.css @@ -59,6 +59,10 @@ h2 { font-weight: bold; } +ul { + padding-bottom: 10px; +} + /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { @@ -704,3 +708,7 @@ a:focus { Thanks for reading. I hope you enjoyed it at least as much as I enjoyed writing it for you. */ + +.readme { + line-height: 130%; +} diff --git a/templates/presentation-4real.hamlet b/templates/presentation-4real.hamlet index 160d2b9..e8ae998 100644 --- a/templates/presentation-4real.hamlet +++ b/templates/presentation-4real.hamlet @@ -1,20 +1,23 @@ -
-

Gonito.net -

open platform for research competition, cooperation and reproducibility -

Filip Graliński, Rafał Jaworski, Łukasz Borchmann, Piotr Wierzchoń -

LREC 2016 / 4REAL Workshop +