refactor param graphs
This commit is contained in:
parent
3388971ed6
commit
abef15c905
@ -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
|
||||
|
||||
|
@ -11,16 +11,4 @@ $if not (null params)
|
||||
<script src="/static/js/sigma.min.js">
|
||||
<script src="/static/js/sigma.parsers.json.min.js">
|
||||
|
||||
$if not (null params)
|
||||
<h3>Graphs by parameters
|
||||
|
||||
$forall param <- params
|
||||
<h4>
|
||||
<tt>#{param}
|
||||
$forall test <- selectedTests
|
||||
<a name="link-chart-#{param}-#{toPathPiece $ entityKey test}">
|
||||
<div id="chart-#{param}-#{toPathPiece $ entityKey test}">
|
||||
[<a href="#link-chart-#{param}-#{toPathPiece $ entityKey test}">direct link</a>]
|
||||
|
||||
<script src="/static/js/d3.min.js" charset="utf-8"></script>
|
||||
<script src="/static/js/c3.min.js"></script>
|
||||
^{paramGraphsWidget challenge tests params}
|
||||
|
@ -10,5 +10,3 @@
|
||||
'pageLength': 50,
|
||||
'order': [[1, 'desc']]});
|
||||
} );
|
||||
|
||||
^{chartJSs}
|
||||
|
13
templates/param-graphs.hamlet
Normal file
13
templates/param-graphs.hamlet
Normal file
@ -0,0 +1,13 @@
|
||||
$if not (null params)
|
||||
<h3>Graphs by parameters
|
||||
|
||||
$forall param <- params
|
||||
<h4>
|
||||
<tt>#{param}
|
||||
$forall test <- selectedTests
|
||||
<a name="link-chart-#{param}-#{toPathPiece $ entityKey test}">
|
||||
<div id="chart-#{param}-#{toPathPiece $ entityKey test}">
|
||||
[<a href="#link-chart-#{param}-#{toPathPiece $ entityKey test}">direct link</a>]
|
||||
|
||||
<script src="/static/js/d3.min.js" charset="utf-8"></script>
|
||||
<script src="/static/js/c3.min.js"></script>
|
1
templates/param-graphs.julius
Normal file
1
templates/param-graphs.julius
Normal file
@ -0,0 +1 @@
|
||||
^{chartJSs}
|
Loading…
Reference in New Issue
Block a user