diff --git a/package.json b/package.json index c21f656..f0323a5 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "express": "~3.4", "express-hbs": "~0.2", "moment": "~2.2", - "pa11y-webservice": "~1.2", + "pa11y-webservice": "~1.3", "pa11y-webservice-client-node": "~1.1", "underscore": "~1.5" }, @@ -46,4 +46,4 @@ "scripts": { "start": "node ." } -} \ No newline at end of file +} diff --git a/view/partial/result.html b/view/partial/result.html index eb5ef29..2d7695e 100644 --- a/view/partial/result.html +++ b/view/partial/result.html @@ -33,7 +33,7 @@ Errors ( {{mainResult.count.error}} )
- +
\ No newline at end of file + diff --git a/view/presenter/result.js b/view/presenter/result.js index fe08868..838e7dc 100644 --- a/view/presenter/result.js +++ b/view/presenter/result.js @@ -1,6 +1,8 @@ 'use strict'; var _ = require('underscore'); +var standardsArray = require('../../data/standards')(); +var rules = createStandardDescriptionMap(standardsArray); module.exports = presentResult; @@ -14,6 +16,14 @@ function presentResult (result) { // Parse date result.date = new Date(result.date); + // Enhance the ignored rules + result.ignore = result.ignore.map(function (name) { + return { + name: name, + description: rules[name] + }; + }); + // Split out message types if (result.results) { var groupedByType = _.groupBy(result.results, 'type'); @@ -31,3 +41,13 @@ function presentResult (result) { return result; } + +function createStandardDescriptionMap (standards) { + var map = {}; + standards.forEach(function (standard) { + standard.rules.forEach(function (rule) { + map[rule.name] = rule.description; + }); + }); + return map; +}