Skip to content

Commit

Permalink
perf: list options and sort filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaixhin committed Oct 28, 2015
1 parent ad77375 commit adfae66
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions views/experiment.jade
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ block content
dt.col-sm-3 Finished
dd#experiment-finished.col-sm-9
dt.col-sm-3 Options
dd.col-sm-9= JSON.stringify(experiment._options)
dd.col-sm-9
ul.list-unstyled(style="margin-bottom: 0;")
- each val, prop in experiment._options
li #[strong #{prop}:] #{val}
if experiment._scores
each val, prop in experiment._scores
dt.col-sm-3 #{prop}
dd.col-sm-9 #{val}
- if (experiment._files.length > 0)
dt.col-sm-3 Files
dd.col-sm-9
ul.list-unstyled(style="margin-bottom: 0;")
- each file in experiment._files
li #[a(href="/files/#{file._id}") #{file.filename}]
ul#files.list-unstyled(style="margin-bottom: 0;")
- for (var key in experiment)
if (key[0] !== "_")
dt.col-sm-3 #{key}
Expand Down Expand Up @@ -89,6 +90,14 @@ block scripts
$("#experiment-finished").html(moment().format(experiment._finished));
}

// Sort files by filename
experiment._files = _.sortBy(experiment._files, "filename");
// Add files
var $files = $("#files");
for (var i = 0; i < experiment._files.length; i++) {
$files.append("<li><a href='/files/'" + experiment._files[i]._id + "'>" + experiment._files[i].filename + "</a></li>");
}

if (experiment._charts) {
// Creates a linear scale
var linScale = function(numEls, step, start) {
Expand Down

0 comments on commit adfae66

Please sign in to comment.