Add full results to the task page

This commit is contained in:
Rowan Manning
2013-09-16 15:47:16 +01:00
parent e54a011a9d
commit 000200ac57
3 changed files with 29 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
'use strict';
var _ = require('underscore');
module.exports = route;
// Route definition
@@ -13,6 +15,13 @@ function route (app) {
if (err) {
return next(err);
}
results.forEach(function (result) {
var grouped = _.groupBy(result.results, 'code');
result.messages = _.keys(grouped).map(function (group) {
grouped[group][0].count = grouped[group].length;
return grouped[group][0];
});
});
res.render('task', {
task: task,
results: results,