From adfae66dd7f00ffd0cb3b37660d78554a11111af Mon Sep 17 00:00:00 2001 From: Kaixhin Date: Wed, 28 Oct 2015 18:56:32 +0000 Subject: [PATCH] perf: list options and sort filenames --- views/experiment.jade | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/views/experiment.jade b/views/experiment.jade index 63b25e7..845ffb0 100644 --- a/views/experiment.jade +++ b/views/experiment.jade @@ -25,7 +25,10 @@ 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} @@ -33,9 +36,7 @@ block content - 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} @@ -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("
  • " + experiment._files[i].filename + "
  • "); + } + if (experiment._charts) { // Creates a linear scale var linScale = function(numEls, step, start) {