LMS: fixing skip links and adding a11y tests

This commit is contained in:
Chris Rodriguez
2015-09-24 12:55:32 -04:00
parent b9ccff7549
commit 2a4e141e0e
24 changed files with 42 additions and 39 deletions

View File

@@ -490,7 +490,7 @@ define([
'<div class="courseware-results"></div>' +
'<section id="course-content"></section>' +
'<section id="dashboard-search-results"></section>' +
'<section id="my-courses"></section>'
'<section id="my-courses" tabindex="-1"></section>'
);
TemplateHelpers.installTemplates([
@@ -705,7 +705,7 @@ define([
loadFixtures('js/fixtures/search/dashboard_search_form.html');
appendSetFixtures(
'<section id="dashboard-search-results"></section>' +
'<section id="my-courses"></section>'
'<section id="my-courses" tabindex="-1"></section>'
);
loadTemplates.call(this);
DashboardSearchFactory();
@@ -753,4 +753,4 @@ define([
});
});
});
});

View File

@@ -336,20 +336,21 @@ mark {
.nav-skip {
@extend %ui-print-excluded;
display: block;
display: inline-block;
position: absolute;
left: 0;
top: -($baseline*30);
width: 1px;
height: 1px;
overflow: hidden;
background: $white;
border-bottom: 1px solid $border-color-4;
padding: ($baseline*0.75) ($baseline/2);
&:focus, &:active {
position: static;
&:focus,
&:active {
position: relative;
top: auto;
width: auto;
height: auto;
margin: 0;
}
}

View File

@@ -1712,7 +1712,7 @@ input[name="subject"] {
height: 40px;
border-radius: 3px;
}
#coupon-content, #course-content, #registration-content, #regcode-content {
#coupon-content, #course-content, #content, #registration-content, #regcode-content {
padding: $baseline;
header {
margin: 0;

View File

@@ -316,6 +316,10 @@
// ====================
.dashboard .my-courses {
&:focus {
outline: none;
}
// UI: individual course item
.course {
@include box-sizing(box);

View File

@@ -37,7 +37,7 @@ ${static.get_page_title_breadcrumbs(course_name())}
<%static:css group='style-student-notes'/>
% endif
<%block name="nav_skip">${"#seq_content" if section_title else "#course-content"}</%block>
<%block name="nav_skip">${"#content" if section_title else "#content"}</%block>
<%include file="../discussion/_js_head_dependencies.html" />
${fragment.head_html()}

View File

@@ -62,7 +62,7 @@ ${static.get_page_title_breadcrumbs(course_name())}
<%static:css group='style-student-notes'/>
% endif
<%block name="nav_skip">${"#seq_content" if section_title else "#course-content"}</%block>
<%block name="nav_skip">${"#content" if section_title else "#content"}</%block>
<%include file="../discussion/_js_head_dependencies.html" />
${fragment.head_html()}

View File

@@ -18,7 +18,7 @@ from django.utils.http import urlquote_plus
<%namespace name="progress_graph" file="/courseware/progress_graph.js"/>
<%block name="pagetitle">${_("{course_number} Progress").format(course_number=course.display_number_with_default) | h}</%block>
<%block name="nav_skip">#course-info-progress</%block>
<%block name="nav_skip">#content</%block>
<%block name="js_extra">
<script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.js') | h}"></script>

View File

@@ -74,7 +74,7 @@ import json
</div>
<section class="container dashboard" id="dashboard-main">
<section class="my-courses" id="my-courses" role="main" aria-label="Content">
<section class="my-courses" id="my-courses" role="main" tabindex="-1">
<header class="wrapper-header-courses">
<h2 class="header-courses">${_("My Courses")}</h2>
</header>

View File

@@ -39,7 +39,8 @@ from django.core.urlresolvers import reverse
data-sort-preference="${sort_preference | h}"
data-flag-moderator="${flag_moderator | h}"
data-user-cohort-id="${user_cohort | h}"
data-course-settings="${course_settings | h}">
data-course-settings="${course_settings | h}"
tabindex="-1">
<div class="discussion-body">
<div class="forum-nav" role="complementary" aria-label="${_("Discussion thread list")}"></div>
<div class="discussion-column" role="main" aria-label="Discussion" id="discussion-column">

View File

@@ -20,7 +20,7 @@ from django.core.urlresolvers import reverse
## 6. And tests go in lms/djangoapps/instructor/tests/
<%block name="pagetitle">${_("Instructor Dashboard")}</%block>
<%block name="nav_skip">#instructor-dashboard-content</%block>
<%block name="nav_skip">#content</%block>
<%block name="headextra">
<%static:css group='style-course-vendor'/>

View File

@@ -124,7 +124,7 @@ from branding import api as branding_api
<%include file="${static.get_template_path('header.html')}" />
% endif
<div class="content-wrapper" id="content">
<div role="main" class="content-wrapper" id="content" tabindex="-1">
${self.body()}
<%block name="bodyextra"/>
</div>

View File

@@ -30,7 +30,7 @@
{% with course=request.course %}
{% include "header.html"|microsite_template_path %}
{% endwith %}
<div class="content-wrapper" id="content">
<div role="main" class="content-wrapper" id="content" tabindex="-1">
{% block body %}{% endblock %}
{% block bodyextra %}{% endblock %}
</div>

View File

@@ -95,7 +95,7 @@ Teams | Course name
<%block name="headextra">
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
<%block name="nav_skip">${"#seq_content" if section_title else "#course-content"}</%block>
<%block name="nav_skip">${"#content" if section_title else "#content"}</%block>
</%block>
<%block name="js_extra">

View File

@@ -94,7 +94,7 @@ Create New Team | [Course name]
<%block name="headextra">
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
<%block name="nav_skip">${"#seq_content" if section_title else "#course-content"}</%block>
<%block name="nav_skip">${"#content" if section_title else "#content"}</%block>
</%block>
<%block name="js_extra">

View File

@@ -13,7 +13,7 @@
<div class="article-wrapper">
<article class="main-article" id="main-article">
<article class="main-article" id="main-article" tabindex="-1">
{% if selected_tab != "edit" %}
<h1>{{ article.current_revision.title }}</h1>