From e27766b0a6ec25914db9678e81eb718cfa697742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Grali=C5=84ski?= Date: Mon, 16 Dec 2019 16:51:52 +0100 Subject: [PATCH] Improve alternative leaderboard --- Handler/Tables.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Handler/Tables.hs b/Handler/Tables.hs index b1e1162..874b56f 100644 --- a/Handler/Tables.hs +++ b/Handler/Tables.hs @@ -135,7 +135,7 @@ leaderboardTable mauthId challengeName repoScheme challengeRepo tests = mempty altLeaderboardTable :: Maybe UserId -> Text -> RepoScheme -> Repo -> [Entity Test] -> Table App (Int, LeaderboardEntry) altLeaderboardTable mauthId challengeName repoScheme challengeRepo tests = mempty ++ Table.int "#" fst - ++ leaderboardDescriptionCell mauthId + ++ leaderboardOnlyTagsCell mauthId ++ mconcat (map (\e@(Entity _ t) -> resultCell t (extractScoreFromLeaderboardEntry (getTestReference e) . snd)) tests) ++ statusCell challengeName repoScheme challengeRepo (\(_, e) -> (leaderboardBestSubmissionId e, leaderboardBestSubmission e, @@ -159,6 +159,14 @@ leaderboardDescriptionCell mauthId = Table.widget "description" ( (leaderboardTags entry) ) +leaderboardOnlyTagsCell :: Maybe UserId -> Table App (a, LeaderboardEntry) +leaderboardOnlyTagsCell mauthId = Table.widget "tags" ( + \(_,entry) -> fragmentWithSubmissionTags ("" :: Text) + (getInfoLink (leaderboardBestSubmission entry) + (leaderboardUserId entry) + mauthId) + (leaderboardTags entry) + ) hoverTextCell :: Text -> (a -> Text) -> (a -> Text) -> Table site a