Files
pa11y-dashboard/view/partial/result.html
Sangita Mane 5202f59008 A11y fixes for pa11y dashboard pages. (#306)
* First draft of a11y fixes.

* Amended results title

* Amended results title (again)

* Back to top keyboard operation

Removed the 'data-role="top"' attribute, which implemented a cool animation to scroll to top but prevented the default behaviour, resulting in the keyboard focus not going back to top.

* Options Button

Fix to have a working options button, but using the mouse only. This is not a good solution because it cannot be operated via the keyboard.

* Fixed options menu css.

* Results view layout changes

* Undoing layout changes

* Graph layout fixes.

* Skip Rules Link

Added a link to skip the list of rules, which can get very long and annoying for any keyboard user not interested in selecting a rule. Most probably, implementing a collapsible list of rules would be a better solution here.

Co-authored-by: Carlos Muncharaz <carlos@muncharaz.eu>
2022-10-11 14:17:43 +02:00

327 lines
13 KiB
HTML

{{!
This file is part of Pa11y Dashboard.
Pa11y Dashboard is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Pa11y Dashboard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}}
<div class="col-md-3 aside">
<div class="row">
<div class="action-buttons col-md-12 col-sm-6">
<div class="row">
<div class="col-md-12 col-sm-6 col-xs-12">
<a href="{{mainResult.hrefCsv}}" class="btn-full-width btn btn-default" data-test="download-csv">
Download CSV <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
</a>
</div>
<div class="col-md-12 col-sm-6 col-xs-12">
<a href="{{mainResult.hrefJson}}" class="btn-full-width btn btn-default" data-test="download-json">
Download JSON <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
</a>
</div>
</div>
</div>
</div>
<div class="row date-selector-row">
<div class="col-md-12 col-sm-12 clearfix">
<div class="well dark-well">
<div class="date-selector">
<div class="btn-group block-level clearfix">
<h2 class="h3" id="dates-navigation">Select a date to show stats for: <span class="glyphicon glyphicon-calendar"></span></h2>
<nav aria-labelledby="dates-navigation">
<ul class="dates-list">
{{#results}}
<li><a class="" href="{{href}}">{{date-format date format="DD MMM YYYY"}}</a></li>
{{/results}}
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 clearfix">
<div class="well">
<h2 class="crunch-top h3">View results in browser</h2>
<p class="crunch-bottom">Pa11y uses HTML_CodeSniffer to find accessibility issues. <a href="http://squizlabs.github.io/HTML_CodeSniffer/">Use their bookmarklet</a> to view results on the page you are testing.</p>
</div>
</div>
</div>
</div>
<section class="col-md-9" id="top">
<h2 id="tabSectionHeading" class="crunch-top">Results</h2>
<ul class="nav nav-tabs category-list" aria-labelledby="tabSectionHeading" role="tablist">
<li class="category-list__item category-list__item_type_error active" aria-selected="true" role="presentation">
<a class="category-list__link" id="errors" href="#errors-list" aria-controls="errors-list" role="tab" data-toggle="tab" data-test="task-errors">
Errors ( {{mainResult.count.error}} )
</a>
</li>
<li class="category-list__item category-list__item_type_warning" aria-selected="false" role="presentation">
<a class="category-list__link" id="warnings" href="#warnings-list" aria-controls="warnings-list" role="tab" data-toggle="tab" data-test="task-warnings">
Warnings ( {{mainResult.count.warning}} )
</a>
</li>
<li class="category-list__item category-list__item_type_notice" aria-selected="false" role="presentation">
<a class="category-list__link" id="notices" href="#notices-list" aria-controls="notices-list" role="tab" data-toggle="tab" data-test="task-notices">
Notices ( {{mainResult.count.notice}} )
</a>
</li>
<li class="category-list__item category-list__item_type_ignore" aria-selected="false" role="presentation">
<a class="category-list__link" id="ignore" href="#ignore-list" aria-controls="ignore-list" role="tab" data-toggle="tab">
Ignored rules ( {{mainResult.ignore.length}} )
</a>
</li>
</ul>
<div class="tab-content">
<div id="errors-list" role="tabpanel" class="tab-pane tasks-list fade in active" aria-labelledby="errors">
{{#if mainResult.count.error}}
{{#mainResult.errors}}
<div class="panel panel-default task task_type_error">
<div class="panel-heading">
<div class="row">
<div class="col-md-9 col-sm-9 col-xs-8">
<span class="rule-name">{{code}}&ensp;
<span class="badge" title="{{count}} selector(s)" data-toggle="tooltip" data-role="rule-tooltip">{{count}}</span>
</span>
</div>
<div class="col-md-3 col-sm-3 col-xs-4 task-actions">
{{#unless readonly}}
{{#if ../../isTaskPage}}
<form class="ignore-form" action="{{../../../task.hrefIgnore}}" method="post">
<input type="hidden" name="rule" value="{{code}}"/>
<input type="submit" role="link" class="btn btn-link btn-sm link" value="Ignore rule"/>
</form>
{{/if}}
{{/unless}}
</div>
</div>
</div>
<div class="panel-body">
<span class="text">{{message}}</span>
<span class="btn btn-xs btn-link link btn-details" data-role="details-collapse" data-toggle="collapse" data-target="#error-index-{{@index}}" aria-expanded="false" aria-controls="error-index-{{@index}}">details</span>
<div class="task-details collapse" id="error-index-{{@index}}">
{{#if solutions.length}}
<div class="subtitle">Solutions:</div>
<ul class="list-unstyled solutions-list">
{{#each solutions}}
<li class="list-unstyled__item">
<a class="link" href="{{url}}" target="_blank">
<span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}}
</a>
</li>
{{/each}}
</ul>
{{/if}}
{{#if items.length}}
<div class="subtitle">Selectors:</div>
<ul class="list-unstyled selectors-list">
{{#each items}}
<li class="list-unstyled__item">
<span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}">
<code class="code">{{selector}}</code>
</span>
</li>
{{/each}}
</ul>
{{/if}}
</div>
</div>
</div>
{{/mainResult.errors}}
<div class="to-top">
<a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div>
{{else}}
<div class="text">Well done! You have 0 errors. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div>
{{/if}}
</div>
<div id="warnings-list" role="tabpanel" class="tab-pane tasks-list fade" aria-labelledby="warning">
{{#if mainResult.count.warning}}
{{#mainResult.warnings}}
<div class="panel panel-default task task_type_warning">
<div class="panel-heading">
<div class="row">
<div class="col-md-9 col-sm-9 col-xs-8">
<span class="rule-name">{{code}}&ensp;
<span class="badge" title="{{count}} selector(s)" data-toggle="tooltip" data-role="rule-tooltip">{{count}}</span>
</span>
</div>
<div class="col-md-3 col-sm-3 col-xs-4 task-actions">
{{#unless readonly}}
{{#if ../../isTaskPage}}
<form class="ignore-form" action="{{../../../task.hrefIgnore}}" method="post">
<input type="hidden" name="rule" value="{{code}}"/>
<input type="submit" role="link" class="btn btn-link btn-sm link" value="Ignore rule"/>
</form>
{{/if}}
{{/unless}}
</div>
</div>
</div>
<div class="panel-body">
<span class="text">{{message}}</span>
<span class="btn btn-xs btn-link link btn-details" data-role="details-collapse" data-toggle="collapse" data-target="#warning-index-{{@index}}" aria-expanded="false" aria-controls="warning-index-{{@index}}">details</span>
<div class="task-details collapse" id="warning-index-{{@index}}">
{{#if solutions.length}}
<div class="subtitle">Solutions:</div>
<ul class="list-unstyled solutions-list">
{{#each solutions}}
<li class="list-unstyled__item">
<a class="link" href="{{url}}" target="_blank">
<span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}}
</a>
</li>
{{/each}}
</ul>
{{/if}}
{{#if items.length}}
<div class="subtitle">Selectors:</div>
<ul class="list-unstyled selectors-list">
{{#each items}}
<li class="list-unstyled__item">
<span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}">
<code class="code">{{selector}}</code>
</span>
</li>
{{/each}}
</ul>
{{/if}}
</div>
</div>
</div>
{{/mainResult.warnings}}
<div class="to-top">
<a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div>
{{else}}
<div class="text">Well done! You have 0 warnings. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div>
{{/if}}
</div>
<div id="notices-list" role="tabpanel" class="tab-pane tasks-list fade" aria-labelledby="notices">
{{#if mainResult.count.notice}}
{{#mainResult.notices}}
<div class="panel panel-default task task_type_notice">
<div class="panel-heading">
<div class="row">
<div class="col-md-9 col-sm-9 col-xs-8">
<span class="rule-name">{{code}}&ensp;
<span class="badge" title="{{count}} selector(s)" data-toggle="tooltip" data-role="rule-tooltip">{{count}}</span>
</span>
</div>
<div class="col-md-3 col-sm-3 col-xs-4 task-actions">
{{#unless readonly}}
{{#if ../../isTaskPage}}
<form class="ignore-form" action="{{../../../task.hrefIgnore}}" method="post">
<input type="hidden" name="rule" value="{{code}}"/>
<input type="submit" role="link" class="btn btn-link btn-sm link" value="Ignore rule"/>
</form>
{{/if}}
{{/unless}}
</div>
</div>
</div>
<div class="panel-body">
<span class="text">{{message}}</span>
<span class="btn btn-xs btn-link link btn-details" data-role="details-collapse" data-toggle="collapse" data-target="#notice-index-{{@index}}" aria-expanded="false" aria-controls="notice-index-{{@index}}">details</span>
<div class="task-details collapse" id="notice-index-{{@index}}">
{{#if solutions.length}}
<div class="subtitle">Solutions:</div>
<ul class="list-unstyled solutions-list">
{{#each solutions}}
<li class="list-unstyled__item">
<a class="link" href="{{url}}" target="_blank">
<span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}}
</a>
</li>
{{/each}}
</ul>
{{/if}}
{{#if items.length}}
<div class="subtitle">Selectors:</div>
<ul class="list-unstyled selectors-list">
{{#each items}}
<li class="list-unstyled__item">
<span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}">
<code class="code">{{selector}}</code>
</span>
</li>
{{/each}}
</ul>
{{/if}}
</div>
</div>
</div>
{{/mainResult.notices}}
<div class="to-top">
<a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div>
{{else}}
<div class="text">Well done! You have 0 notices. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div>
{{/if}}
</div>
<div id="ignore-list" role="tabpanel" class="tab-pane tasks-list fade" aria-labelledby="ignore">
{{#if mainResult.ignore.length}}
{{#mainResult.ignore}}
<div class="panel panel-default task task_type_ignore">
<div class="panel-heading">
<div class="row">
<div class="col-md-9 col-sm-9 col-xs-8">
<span class="rule-name">{{name}}</span>
</div>
<div class="col-md-3 col-sm-3 col-xs-4 task-actions">
{{#unless readonly}}
{{#if ../../isTaskPage}}
<form class="ignore-form" action="{{../../../task.hrefUnignore}}" method="post">
<input type="hidden" name="rule" value="{{name}}"/>
<input type="submit" role="link" class="btn btn-link btn-sm link" value="Unignore rule"/>
</form>
{{/if}}
{{/unless}}
</div>
</div>
</div>
<div class="panel-body">
{{#if description}}
<span class="text">{{description}}</span>
{{/if}}
</div>
</div>
{{/mainResult.ignore}}
<div class="to-top">
<a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div>
{{else}}
<div class="text">You have no ignored rules.</div>
{{/if}}
</div>
</div>
</section>