diff --git a/app.js b/app.js index ea76d5e..f3a97d7 100644 --- a/app.js +++ b/app.js @@ -69,6 +69,7 @@ function initApp (config, callback) { require('./route/new')(app); require('./route/task/index')(app); require('./route/task/delete')(app); + require('./route/task/run')(app); require('./route/result/index')(app); require('./route/result/download')(app); diff --git a/public/less/site.less b/public/less/site.less index 0a357fc..8e596f5 100644 --- a/public/less/site.less +++ b/public/less/site.less @@ -216,7 +216,7 @@ } } .date { - margin-top:45px; + margin-top:5px; } .tasks-list { padding:15px; diff --git a/route/task/index.js b/route/task/index.js index eff1d3a..92ce0d6 100644 --- a/route/task/index.js +++ b/route/task/index.js @@ -23,6 +23,7 @@ function route (app) { results: presentResultList(results.map(presentResult)), mainResult: task.lastResult || null, added: (typeof req.query.added !== 'undefined'), + running: (typeof req.query.running !== 'undefined'), isTaskPage: true }); }); diff --git a/route/task/run.js b/route/task/run.js new file mode 100644 index 0000000..6c713f1 --- /dev/null +++ b/route/task/run.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = route; + +// Route definition +function route (app) { + + app.express.get('/:id/run', function (req, res, next) { + app.webservice.task(req.params.id).run(function (err, task) { + if (err) { + return next(); + } + res.redirect('/' + req.params.id + '?running'); + }); + }); + +} diff --git a/view/partial/task-header.html b/view/partial/task-header.html index ab897c9..c7fe978 100644 --- a/view/partial/task-header.html +++ b/view/partial/task-header.html @@ -6,7 +6,7 @@
({{task.standard}})
+ New results are being generated for this URL in the background. + This can take up to a minute to complete. + Click here to refresh this page. +
+pa11y has not been run against this URL yet so there are no results to show.
- +