Compare commits

...

21 Commits

Author SHA1 Message Date
Rowan Manning
a853d329c0 Version 1.0.0 2013-11-19 11:20:07 +00:00
Rowan Manning
3237e87f4a Use the npm version of the webservice client 2013-11-19 11:14:43 +00:00
Rowan Manning
22958bdf1b Merge pull request #58 from nature/demo-mode-style-tweaks
Amend positon of date in task-header when site is in demo mode
2013-11-19 01:08:05 -08:00
perryharlock
44726558f1 Renamed demo-mode to readonly-mode 2013-11-19 09:04:24 +00:00
perryharlock
15ae109eac Amend positon of date in task-header when site is in demo mode 2013-11-19 08:23:40 +00:00
Jude Robinson
a609f0cd62 pa11y-dashboard works in more than just GUI user agents, so removing the reference to it being a "visual" interface 2013-11-18 23:09:27 +00:00
perryharlock
1dcac7be72 Make copyright and license info a small tag 2013-11-18 11:47:16 +00:00
perryharlock
9b67e8298b Styling for site message 2013-11-18 09:12:19 +00:00
Rowan Manning
b996f2694b Fix tabs/spaces inconsistencies 2013-11-15 16:31:24 +00:00
Rowan Manning
7a1160b257 Add the ability to have a site-wide message 2013-11-15 16:28:37 +00:00
Rowan Manning
98bd9ed208 Add a readonly mode for demo/public-facing sites 2013-11-15 16:19:12 +00:00
Rowan Manning
55d44685e9 Disable search engine indexing by default 2013-11-15 15:58:49 +00:00
perryharlock
85b70c5679 Merge branch 'master' of github.com:nature/pa11y-dashboard 2013-11-15 15:12:06 +00:00
perryharlock
9b1079eea3 Small amendments to task-header for smaller devices 2013-11-15 15:11:37 +00:00
Rowan Manning
15bbc2e774 Update description 2013-11-15 14:01:10 +00:00
Perry Harlock
66fb1e68af Update screen shots..again 2013-11-15 11:28:18 +00:00
Perry Harlock
2ccb7784e0 Update screen shots 2013-11-15 11:22:57 +00:00
perryharlock
802634d0ad Make checkboxes on graph WCAG2AA compliant 2013-11-14 16:35:30 +00:00
perryharlock
d016ebfdce Make checkbox inputs and labels WCAG2AA compliant on new URL page 2013-11-14 16:19:22 +00:00
perryharlock
c249a542bf Colour changes to make contrast 0 errors at WCAG2AA 2013-11-14 15:30:42 +00:00
Rowan Manning
6b6ce57e48 Make use of task name consistent (in titles etc) 2013-11-12 10:57:05 +00:00
21 changed files with 147 additions and 48 deletions

View File

@@ -1,14 +1,14 @@
pa11y-dashboard pa11y-dashboard
=============== ===============
pa11y-dashboard is a visual web interface to the [pa11y][pa11y] accessibility reporter. pa11y-dashboard is a web interface to the [pa11y][pa11y] accessibility reporter; allowing you to focus on *fixing* issues rather than hunting them down.
**Current Version:** *1.0.0-beta.3* **Current Version:** *1.0.0*
**Node Version Support:** *0.10* **Node Version Support:** *0.10*
![The Dashboard Page](https://f.cloud.github.com/assets/1225142/1269563/2fc6e4e0-2cfb-11e3-8f49-e74a9d49bb32.jpg) ![dashboard](https://f.cloud.github.com/assets/1225142/1549567/f0361e72-4de8-11e3-8d14-3fe6900cc15d.jpg)
![The URL Page](https://f.cloud.github.com/assets/1225142/1297247/f749f3a0-30dd-11e3-9920-583f86f3c8f9.jpg) ![results-page](https://f.cloud.github.com/assets/1225142/1549568/f225aa54-4de8-11e3-8b25-ef2f405997a3.jpg)
Setup Setup
@@ -34,7 +34,7 @@ $ NODE_ENV=production node . # Run in production
$ NODE_ENV=development node . # Run in development $ NODE_ENV=development node . # Run in development
``` ```
See [development instructions](#development) for more information about running locally (and restarting automatically when files change). Check the [development instructions](#development) for more information about running locally (and restarting automatically when files change).
Configurations Configurations
@@ -48,6 +48,15 @@ The boot configurations for pa11y-dashboard are as follows. Look at the sample J
### port ### port
*(number)* The port to run the application on. *(number)* The port to run the application on.
### noindex
*(boolean)* If set to `true` (default), the dashboard will not be indexed by search engines. Set to `false` to allow indexing.
### readonly
*(boolean)* If set to `true`, users will not be able to add, delete or run URLs (defaults to `false`).
### siteMessage
*(string)* A message to display prominently on the site home page. Defaults to `null`.
Development Development
----------- -----------

26
app.js
View File

@@ -11,6 +11,7 @@ module.exports = initApp;
// Initialise the application // Initialise the application
function initApp (config, callback) { function initApp (config, callback) {
config = defaultConfig(config);
var app = new EventEmitter(); var app = new EventEmitter();
app.address = null; app.address = null;
@@ -51,8 +52,12 @@ function initApp (config, callback) {
year: (new Date()).getFullYear(), year: (new Date()).getFullYear(),
version: pkg.version, version: pkg.version,
repo: pkg.homepage, repo: pkg.homepage,
bugtracker: pkg.bugs bugtracker: pkg.bugs,
noindex: config.noindex,
readonly: config.readonly,
siteMessage: config.siteMessage
}); });
app.express.use(function (req, res, next) { app.express.use(function (req, res, next) {
res.locals.isHomePage = (req.path === '/'); res.locals.isHomePage = (req.path === '/');
res.locals.host = req.host; res.locals.host = req.host;
@@ -61,12 +66,14 @@ function initApp (config, callback) {
// Load routes // Load routes
require('./route/index')(app); require('./route/index')(app);
require('./route/new')(app);
require('./route/task/index')(app); require('./route/task/index')(app);
require('./route/task/delete')(app);
require('./route/task/run')(app);
require('./route/result/index')(app); require('./route/result/index')(app);
require('./route/result/download')(app); require('./route/result/download')(app);
if (!config.readonly) {
require('./route/new')(app);
require('./route/task/delete')(app);
require('./route/task/run')(app);
}
// Error handling // Error handling
app.express.get('*', function (req, res) { app.express.get('*', function (req, res) {
@@ -93,3 +100,14 @@ function initApp (config, callback) {
}); });
} }
// Get default configurations
function defaultConfig (config) {
if (typeof config.noindex !== 'boolean') {
config.noindex = true;
}
if (typeof config.readonly !== 'boolean') {
config.readonly = false;
}
return config;
}

View File

@@ -1,4 +1,6 @@
{ {
"webservice": "http://localhost:3000/", "webservice": "http://localhost:3000/",
"port": 4000 "port": 4000,
"noindex": true,
"readonly": false
} }

View File

@@ -1,4 +1,6 @@
{ {
"webservice": "http://localhost:3000/", "webservice": "http://localhost:3000/",
"port": 4000 "port": 4000,
"noindex": true,
"readonly": false
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "pa11y-dashboard", "name": "pa11y-dashboard",
"version": "1.0.0-beta.3", "version": "1.0.0",
"private": true, "private": true,
"description": "pa11y-dashboard is a visual web interface to the pa11y accessibility reporter", "description": "pa11y-dashboard is a visual web interface to the pa11y accessibility reporter",
@@ -25,7 +25,7 @@
"express": "~3.4", "express": "~3.4",
"express-hbs": "~0.2", "express-hbs": "~0.2",
"moment": "~2.2", "moment": "~2.2",
"pa11y-webservice-client-node": "git+ssh://git@github.com:nature/pa11y-webservice-client-node.git#1.0.0-beta.7", "pa11y-webservice-client-node": "~1.0",
"underscore": "~1.5" "underscore": "~1.5"
}, },
"devDependencies": { "devDependencies": {

File diff suppressed because one or more lines are too long

View File

@@ -132,9 +132,9 @@ $(document).ready(function(){
function getData() { function getData() {
return [ return [
{ color: 'rgb(231, 76, 60)', label: 'Errors', data: data.error }, { color: 'rgb(216, 61, 45)', label: 'Errors', data: data.error },
{ color: 'rgb(243, 156, 18)', label: 'Warnings', data: data.warning }, { color: 'rgb(168, 103, 0)', label: 'Warnings', data: data.warning },
{ color: 'rgb(52, 152, 219)', label: 'Notices', data: data.notice } { color: 'rgb(23, 123, 190)', label: 'Notices', data: data.notice }
]; ];
} }
@@ -168,11 +168,11 @@ $(document).ready(function(){
$.each(datasets, function(key, val) { $.each(datasets, function(key, val) {
var lowerCaseValue = (val.label.substring(0, val.label.length - 1)).toLowerCase(); var lowerCaseValue = (val.label.substring(0, val.label.length - 1)).toLowerCase();
choiceContainer.append('<li class="text-center '+ choiceContainer.append('<li class="text-center '+
lowerCaseValue +'"><label for="id' + key + lowerCaseValue +'"><div class="series-checkbox-container"><input type="checkbox" name="' + key +
'"><input type="checkbox" name="' + key +
'" checked="checked" id="id' + key + '" checked="checked" id="id' + key +
'"/><span class="stat-type">' + val.label + '"/><label for="id' + key +
'</span></label></li>'); '"><span class="stat-type">' + val.label +
'</span></label></div></li>');
}); });
choiceContainer.find('input').click(plotAccordingToChoices); choiceContainer.find('input').click(plotAccordingToChoices);

File diff suppressed because one or more lines are too long

View File

@@ -32,7 +32,6 @@
.date { .date {
margin-top:10px; margin-top:10px;
float:right; float:right;
font-size:;
} }
.other-tasks { .other-tasks {
.sr-only(); .sr-only();
@@ -65,6 +64,11 @@
margin-top:0; margin-top:0;
margin-bottom:25px; margin-bottom:25px;
} }
.readonly-mode .date {
margin-top:0;
margin-bottom:5px;
float:none;
}
.graph-spacer { .graph-spacer {
padding-bottom:20px; padding-bottom:20px;
margin-bottom:15px; margin-bottom:15px;
@@ -131,6 +135,15 @@
.series-checkboxes li { .series-checkboxes li {
font-size:floor(@font-size-base * 0.8); // ~12px; font-size:floor(@font-size-base * 0.8); // ~12px;
} }
.task-header .h3 {
float:none !important;
text-align:center;
margin-bottom:15px !important;
padding:10px;
}
.task-header h1 {
margin-bottom:3px;
}
} }
@media (max-width:360px) { @media (max-width:360px) {
.delete-button { .delete-button {

View File

@@ -96,6 +96,19 @@
.delete-button:hover { .delete-button:hover {
color:lighten(@brand-danger, 8%); color:lighten(@brand-danger, 8%);
} }
.footer a, .breadcrumb a {
text-decoration:underline;
}
.breadcrumb a {
&:hover, &:active, &:focus {
text-decoration: none;
}
}
.site-message {
.glyphicon {
margin-right:6px;
}
}
/* Type */ /* Type */
.h1 { .h1 {
@@ -219,6 +232,10 @@
.task-header { .task-header {
margin-bottom:30px; margin-bottom:30px;
h1 {
margin-bottom:6px;
}
h2 { h2 {
word-wrap:break-word; word-wrap:break-word;
} }
@@ -226,6 +243,9 @@
.date { .date {
margin-top:5px; margin-top:5px;
} }
.readonly-mode .date {
margin-top:40px;
}
.tasks-list { .tasks-list {
padding:15px; padding:15px;
margin-bottom:30px; margin-bottom:30px;
@@ -334,12 +354,20 @@ ul.date-links {
border-radius: @border-radius-base; border-radius: @border-radius-base;
label { label {
padding:2px 4px;
margin-bottom:0; margin-bottom:0;
} }
.series-checkbox-container {
padding:2px 4px 3px 4px;
}
input {
margin:5px auto 3px auto;
}
input, label { input, label {
cursor: pointer; cursor: pointer;
display:block;
} }
&:last-child { &:last-child {

View File

@@ -13,16 +13,16 @@
@gray-dark: #616D6E; @gray-dark: #616D6E;
@gray: #6C7878; @gray: #6C7878;
@gray-light: #7C8C8D; @gray-light: #7C8C8D;
@gray-lighter: #ecf0f1; @gray-lighter: #eaeff1;
// Brand colors // Brand colors
// ------------------------- // -------------------------
@brand-primary: #2C3E50; @brand-primary: #2C3E50;
@brand-success: #00A18C; @brand-success: #00806F;
@brand-warning: #F39C12; @brand-warning: #A86700;
@brand-danger: #E74C3C; @brand-danger: #D83D2D;
@brand-info: #3498DB; @brand-info: #177BBE;
// Scaffolding // Scaffolding
// ------------------------- // -------------------------
@@ -551,7 +551,7 @@
// Breadcrumbs // Breadcrumbs
// ------------------------- // -------------------------
@breadcrumb-bg: lighten(@gray-lighter, 4%); @breadcrumb-bg: lighten(@gray-lighter, 4%);
@breadcrumb-color: lighten(@gray-dark, 3%); @breadcrumb-color: @gray-dark;
@breadcrumb-active-color: @breadcrumb-color; @breadcrumb-active-color: @breadcrumb-color;

View File

@@ -1,5 +1,14 @@
{{#content "title"}}pa11y-dashboard{{/content}} {{#content "title"}}pa11y-dashboard{{/content}}
{{#if siteMessage}}
<div class="col-md-12 clearfix">
<div class="alert alert-info site-message">
<h3 class="crunch-top"><span class="pull-left glyphicon glyphicon-exclamation-sign"></span> Important</h3>
<p class="h5">{{siteMessage}}</p>
</div>
</div>
{{/if}}
{{#deleted}} {{#deleted}}
<div class="col-md-12 clearfix"> <div class="col-md-12 clearfix">
<div class="alert alert-info"> <div class="alert alert-info">

View File

@@ -9,6 +9,8 @@
<title>{{block "title"}}</title> <title>{{block "title"}}</title>
<meta name="description" content="{{block "description"}}"/> <meta name="description" content="{{block "description"}}"/>
{{#if noindex}}<meta name="robots" content="noindex"/>{{/if}}
<link rel="icon" type="image/png" href="favicon.png" /> <link rel="icon" type="image/png" href="favicon.png" />
<!-- For mobile devices. --> <!-- For mobile devices. -->
@@ -30,7 +32,11 @@
{{> breadcrumb}} {{> breadcrumb}}
<div class="container"> <div class="container">
<div class="row"> {{#if readonly}}
<div class="row readonly-mode">
{{else}}
<div class="row">
{{/if}}
<section> <section>
<div class="section" role="main"> <div class="section" role="main">
{{{body}}} {{{body}}}

View File

@@ -58,8 +58,8 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
{{#rules}} {{#rules}}
<li> <li>
<label title="{{description}}" data-role="rules-tooltip" class="checkbox"> <input class="pull-left" id="{{name}}" type="checkbox" name="ignore[]" value="{{name}}" {{#ignored}}checked{{/ignored}}/>
<input type="checkbox" name="ignore[]" value="{{name}}" {{#ignored}}checked{{/ignored}}/> <label for="{{name}}" title="{{description}}" data-role="rules-tooltip" class="checkbox">
{{name}} {{name}}
</label> </label>
</li> </li>

View File

@@ -8,10 +8,10 @@
<li class="active">Add URL</li> <li class="active">Add URL</li>
{{/if}} {{/if}}
{{#if isTaskPage}} {{#if isTaskPage}}
<li class="active">{{simplify-url task.url}}</li> <li class="active">{{task.name}}</li>
{{/if}} {{/if}}
{{#if isResultPage}} {{#if isResultPage}}
<li><a href="{{task.href}}">{{simplify-url task.url}}</a></li> <li><a href="{{task.href}}">{{task.name}}</a></li>
<li class="active">Results for {{date-format mainResult.date format="DD MMM YYYY"}}</li> <li class="active">Results for {{date-format mainResult.date format="DD MMM YYYY"}}</li>
{{/if}} {{/if}}
</ol> </ol>

View File

@@ -2,7 +2,7 @@
<div class="footer" role="contentinfo"> <div class="footer" role="contentinfo">
<div class="container"> <div class="container">
<div class="col-md-7"> <div class="col-md-7">
<p>&copy; {{year}} Nature Publishing Group.<br/>pa11y dashboard is licensed under the GNU General Public License 3.0.<br/>Version {{version}}</p> <small>&copy; {{year}} Nature Publishing Group.<br/>pa11y dashboard is licensed under the GNU General Public License 3.0.<br/>Version {{version}}</small>
</div> </div>
<div class="col-md-5 clearfix"> <div class="col-md-5 clearfix">
<ul class="crunch-bottom floated-list nav"> <ul class="crunch-bottom floated-list nav">

View File

@@ -4,7 +4,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="h3 crunch well-med well pull-right"><span class="glyphicon glyphicon-calendar"></span>&nbsp;{{date-format mainResult.date format="DD MMM YYYY"}}</div> <div class="h3 crunch well-med well pull-right"><span class="glyphicon glyphicon-calendar"></span>&nbsp;{{date-format mainResult.date format="DD MMM YYYY"}}</div>
<h1 class="h2 crunch-top">{{task.name}}</h1> <h1 class="h2 crunch-top">{{task.name}}</h1>
<p class="h4">{{simplify-url task.url}}<span class="h5"> - ({{task.standard}})</span></p> <p class="h4">{{simplify-url task.url}}<span class="h5"> ({{task.standard}})</span></p>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -3,10 +3,12 @@
<div class="row clearfix"> <div class="row clearfix">
<div class="col-md-9 col-sm-9"> <div class="col-md-9 col-sm-9">
<h1 class="h2 crunch-top">{{task.name}}</h1> <h1 class="h2 crunch-top">{{task.name}}</h1>
<p class="h4">{{simplify-url task.url}}<span class="h5"> - ({{task.standard}})</span></p> <p class="h4">{{simplify-url task.url}}<span class="h5"> ({{task.standard}})</span></p>
</div> </div>
<div class="col-md-3 col-sm-3 text-right run-details"> <div class="col-md-3 col-sm-3 text-right run-details">
<a href="{{task.hrefRun}}" class="btn btn-success">Run <span class="glyphicon glyphicon-play"></span></a> {{#unless readonly}}
<a href="{{task.hrefRun}}" class="btn btn-success">Run <span class="glyphicon glyphicon-play"></span></a>
{{/unless}}
{{#if mainResult}} {{#if mainResult}}
<div class="date">Last run : {{date-format mainResult.date format="DD MMM YYYY"}}</div> <div class="date">Last run : {{date-format mainResult.date format="DD MMM YYYY"}}</div>
{{else}} {{else}}

View File

@@ -1,12 +1,20 @@
<ul class="list-unstyled clearfix crunch-bottom"> <ul class="list-unstyled clearfix crunch-bottom">
<li class="col-md-4 col-sm-6 task-card add-task"> <li class="col-md-4 col-sm-6 task-card add-task">
<a class="well task-card-link crunch-bottom" data-role="add-task" href="/new"> {{#if readonly}}
<p class="h3 crunch">Add new URL</p> {{! TODO PERRY: make this look disabled }}
<p class="supersize-me crunch">+</p> <span class="well task-card-link crunch-bottom">
</a> <p class="h3 crunch">Add new URL</p>
<p class="supersize-me crunch">+</p>
</span>
{{else}}
<a class="well task-card-link crunch-bottom" data-role="add-task" href="/new">
<p class="h3 crunch">Add new URL</p>
<p class="supersize-me crunch">+</p>
</a>
{{/if}}
</li> </li>
{{#tasks}} {{#each tasks}}
<li class="col-md-4 col-sm-6 task-card"> <li class="col-md-4 col-sm-6 task-card">
<a class="well task-card-link crunch-bottom" title="Details for URL {{simplify-url url}}" href="{{href}}"> <a class="well task-card-link crunch-bottom" title="Details for URL {{simplify-url url}}" href="{{href}}">
<p class="h3">{{name}}</p> <p class="h3">{{name}}</p>
@@ -24,7 +32,9 @@
<p class="no-results">No results</p> <p class="no-results">No results</p>
{{/if}} {{/if}}
</a> </a>
<a title="Delete this URL" class="delete-button" href="{{hrefDelete}}"><span class="sr-only">Delete </span><span class="glyphicon glyphicon-remove"></span></a> {{#unless ../readonly}}
<a title="Delete this URL" class="delete-button" href="{{hrefDelete}}"><span class="sr-only">Delete </span><span class="glyphicon glyphicon-remove"></span></a>
{{/unless}}
</li> </li>
{{/tasks}} {{/each}}
</ul> </ul>

View File

@@ -1,6 +1,6 @@
{{#content "title"}} {{#content "title"}}
{{task.url}} ({{task.standard}}) {{date-format mainResult.date format="DD MMM YYYY"}} {{task.name}} - {{simplify-url task.url}} ({{task.standard}}) - {{date-format mainResult.date format="DD MMM YYYY"}}
{{/content}} {{/content}}
{{> result-header}} {{> result-header}}

View File

@@ -1,6 +1,6 @@
{{#content "title"}} {{#content "title"}}
{{task.url}} ({{task.standard}}) {{task.name}} - {{simplify-url task.url}} ({{task.standard}})
{{/content}} {{/content}}
{{#added}} {{#added}}