From c557157ae3103b65ce126f404694c0bcae67d01f Mon Sep 17 00:00:00 2001 From: perryharlock Date: Tue, 17 Sep 2013 15:30:02 +0100 Subject: [PATCH] Add markup and stying for task page --- public/css/site.css | 4 ++ route/task.js | 1 + view/index.html | 5 +- view/partial/results-table.html | 21 +++++++ view/task.html | 107 +++++++++++++++++++++++++++++--- 5 files changed, 126 insertions(+), 12 deletions(-) create mode 100644 view/partial/results-table.html diff --git a/public/css/site.css b/public/css/site.css index 04571bf..b8bcedb 100644 --- a/public/css/site.css +++ b/public/css/site.css @@ -147,6 +147,10 @@ ul { color:#cacaca; } +.other-tasks .ruled { + margin-bottom:1.5rem; +} + /* Task details page */ .badge-danger { diff --git a/route/task.js b/route/task.js index efc885b..18895f1 100644 --- a/route/task.js +++ b/route/task.js @@ -25,6 +25,7 @@ function route (app) { res.render('task', { task: task, results: results, + lastResult: results[0] || null, added: (typeof req.query.added !== 'undefined') }); }); diff --git a/view/index.html b/view/index.html index 83e3791..47f6dd1 100644 --- a/view/index.html +++ b/view/index.html @@ -1,6 +1,3 @@ - -{{#content "title"}} - Tasks -{{/content}} +{{#content "title"}}Tasks{{/content}} {{> tasks}} diff --git a/view/partial/results-table.html b/view/partial/results-table.html new file mode 100644 index 0000000..93ec048 --- /dev/null +++ b/view/partial/results-table.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + {{#results}} + + + + + + + {{/results}} + +
pa11y results for this url
DateErrorsWarningsNotifications
{{date-format date format="DD MMM YYYY"}}{{count.error}}{{count.warning}}{{count.notice}}
\ No newline at end of file diff --git a/view/task.html b/view/task.html index 6216509..abb4e99 100644 --- a/view/task.html +++ b/view/task.html @@ -3,18 +3,109 @@ Task: {{task.url}} ({{task.standard}}) {{/content}} -

Task: {{task.url}} ({{task.standard}})

- {{#added}} -
-

Task added!

+
+
+ + Whoop whoop! +

Your new url has been added.

+
{{/added}} -

Here are the results:

+
+
+
+
+

{{simplify-url task.url}}

+

({{task.standard}})

+
+
+ + + {{#if lastResult}} +
Last run : {{date-format lastResult.date format="DD MMM YYYY"}}
+ {{else}} +
Not yet run
+ {{/if}} +
+
+
+
-{{> results}} +{{#if results}} +
+
+
+
    + +
    +
    -

    Here are the full results:

    + +{{/if}} + +
    + {{#if results}} +
    + + +
    + + + + +
    + + + +
    + {{/if}} + + +
    +

    Your other tracked URLs

    +

    No other urls

    + + + +
    +
    + + +
    + {{#if results}} +
    +
      + {{#lastResult.messages}} +
    • +

      {{type}} : {{code}} {{count}}

      + {{message}}

      +
    • + {{/lastResult.messages}} +
    +
    + {{else}} +
    +

    No results to show

    +

    pa11y has not been run against this URL yet so there are no results to show.

    +

    To run pa11y for this url now click here

    +
    + {{/if}} +
    -{{> full-results}}