diff --git a/Handler/ShowChallenge.hs b/Handler/ShowChallenge.hs index d20db23..f7a2f28 100644 --- a/Handler/ShowChallenge.hs +++ b/Handler/ShowChallenge.hs @@ -87,7 +87,6 @@ showChallengeWidget muserId challenge scheme challengeRepo test repo leaderboard where leaderboardWithRanks = zip [1..] leaderboard maybeRepoLink = getRepoLink repo - getRepoLink :: Repo -> Maybe Text getRepoLink repo | sitePrefix `isPrefixOf` url = Just $ (browsableGitRepo bareRepoName) ++ "/" ++ (repoBranch repo) @@ -540,6 +539,9 @@ challengeAllSubmissionsWidget :: Maybe UserId -> WidgetFor App () challengeAllSubmissionsWidget muserId challenge scheme challengeRepo submissions tests params = $(widgetFile "challenge-all-submissions") + +paramGraphsWidget :: Challenge -> [Entity Test] -> [Text] -> WidgetFor App () +paramGraphsWidget challenge tests params = $(widgetFile "param-graphs") where chartJSs = getCharsJss challenge selectedTests params selectedTests = getMainTests tests diff --git a/templates/challenge-all-submissions.hamlet b/templates/challenge-all-submissions.hamlet index d76071a..5eac2f2 100644 --- a/templates/challenge-all-submissions.hamlet +++ b/templates/challenge-all-submissions.hamlet @@ -11,16 +11,4 @@ $if not (null params) - +^{paramGraphsWidget challenge tests params} diff --git a/templates/challenge-all-submissions.julius b/templates/challenge-all-submissions.julius index a03db21..ddbdfe7 100644 --- a/templates/challenge-all-submissions.julius +++ b/templates/challenge-all-submissions.julius @@ -10,5 +10,3 @@ 'pageLength': 50, 'order': [[1, 'desc']]}); } ); - -^{chartJSs} diff --git a/templates/param-graphs.hamlet b/templates/param-graphs.hamlet new file mode 100644 index 0000000..bbd0793 --- /dev/null +++ b/templates/param-graphs.hamlet @@ -0,0 +1,13 @@ +$if not (null params) +