Add presenters for tasks and results

This commit is contained in:
Rowan Manning
2013-09-25 11:55:39 +01:00
parent ea79ca2825
commit 0cf06961a1
5 changed files with 45 additions and 5 deletions

16
view/presenter/result.js Normal file
View File

@@ -0,0 +1,16 @@
'use strict';
module.exports = presentResult;
function presentResult (result) {
// Add additional info
result.href = '/' + result.task + '/' + result.id;
result.hrefCsv = '/' + result.task + '/' + result.id + '.csv';
result.hrefJson = '/' + result.task + '/' + result.id + '.json';
// Parse date
result.date = new Date(result.date);
return result;
}