Commit 447f5c2b by Brian Jacobel Committed by GitHub

Merge pull request #14859 from edx/bjacobel/outline-details

Implement minor UI/A11Y fixes for outline
parents 792d134d 89fc9fb3
...@@ -54,7 +54,7 @@ class CourseOutlinePage(PageObject): ...@@ -54,7 +54,7 @@ class CourseOutlinePage(PageObject):
url = None url = None
SECTION_SELECTOR = '.outline-item.section:nth-of-type({0})' SECTION_SELECTOR = '.outline-item.section:nth-of-type({0})'
SECTION_TITLES_SELECTOR = '.section-name span' SECTION_TITLES_SELECTOR = '.section-name h3'
SUBSECTION_SELECTOR = SECTION_SELECTOR + ' .subsection:nth-of-type({1}) .outline-item' SUBSECTION_SELECTOR = SECTION_SELECTOR + ' .subsection:nth-of-type({1}) .outline-item'
SUBSECTION_TITLES_SELECTOR = SECTION_SELECTOR + ' .subsection .subsection-title' SUBSECTION_TITLES_SELECTOR = SECTION_SELECTOR + ' .subsection .subsection-title'
OUTLINE_RESUME_COURSE_SELECTOR = '.outline-item .resume-right' OUTLINE_RESUME_COURSE_SELECTOR = '.outline-item .resume-right'
......
...@@ -21,7 +21,11 @@ ...@@ -21,7 +21,11 @@
.section-name { .section-name {
@include margin(0, 0, ($baseline / 2), ($baseline / 2)); @include margin(0, 0, ($baseline / 2), ($baseline / 2));
padding: 0; padding: 0;
h3 {
font-weight: bold; font-weight: bold;
margin: 0;
}
} }
.outline-item { .outline-item {
...@@ -37,10 +41,16 @@ ...@@ -37,10 +41,16 @@
a.outline-item { a.outline-item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
padding: ($baseline / 2); padding: ($baseline / 2);
.subsection-title {
margin: 0;
}
&:hover { &:hover {
background-color: palette(primary, x-back); background-color: palette(primary, x-back);
border-radius: $btn-border-radius;
} }
.subsection-text { .subsection-text {
...@@ -61,6 +71,11 @@ ...@@ -61,6 +71,11 @@
&.current { &.current {
border: 1px solid $lms-active-color; border: 1px solid $lms-active-color;
border-radius: $btn-border-radius;
.resume-right {
@include float(right);
}
} }
} }
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<%! <%!
import json import json
from django.conf import settings
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs from django.template.defaultfilters import escapejs
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
...@@ -17,19 +18,25 @@ from openedx.core.djangolib.markup import HTML ...@@ -17,19 +18,25 @@ from openedx.core.djangolib.markup import HTML
<%block name="content"> <%block name="content">
<div class="course-view container" id="course-container"> <div class="course-view container" id="course-container">
<header class="page-header has-secondary"> <header class="page-header has-secondary">
<div class="page-header-main">
<nav aria-label="${_('Course Outline')}" class="sr-is-focusable" tabindex="-1">
<h2 class="hd hd-2 page-title">${_('Course Outline')}</h2>
</nav>
</div>
<div class="page-header-secondary"> <div class="page-header-secondary">
<div class="form-actions"> <div class="form-actions">
<a class="btn action-resume-course" href="${reverse('courseware', kwargs={'course_id': unicode(course.id.to_deprecated_string())})}"> <a class="btn action-show-bookmarks" href="${reverse('openedx.course_bookmarks.home', args=[course.id])}">
${_("Bookmarks")}
</a>
<a class="btn btn-brand action-resume-course" href="${reverse('courseware', kwargs={'course_id': unicode(course.id.to_deprecated_string())})}">
% if has_visited_course: % if has_visited_course:
${_("Resume Course")} ${_("Resume Course")}
% else: % else:
${_("Start Course")} ${_("Start Course")}
% endif % endif
</a> </a>
<a class="btn action-show-bookmarks" href="${reverse('openedx.course_bookmarks.home', args=[course.id])}">
${_("Bookmarks")}
</a>
</div> </div>
% if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'):
<div class="page-header-search"> <div class="page-header-search">
<form class="search-form" role="search"> <form class="search-form" role="search">
<label class="field-label sr-only" for="search" id="search-hint">${_('Search the course')}</label> <label class="field-label sr-only" for="search" id="search-hint">${_('Search the course')}</label>
...@@ -38,11 +45,12 @@ from openedx.core.djangolib.markup import HTML ...@@ -38,11 +45,12 @@ from openedx.core.djangolib.markup import HTML
type="search" type="search"
name="search" name="search"
id="search" id="search"
placeholder="${_('Search the course')}'" placeholder="${_('Search the course')}"
/> />
<button class="btn btn-small search-btn" type="button">${_('Search')}</button> <button class="btn btn-small search-btn" type="button">${_('Search')}</button>
</form> </form>
</div> </div>
% endif
</div> </div>
</header> </header>
<div class="page-content"> <div class="page-content">
......
...@@ -12,7 +12,7 @@ from django.utils.translation import ugettext as _ ...@@ -12,7 +12,7 @@ from django.utils.translation import ugettext as _
CourseOutlineFactory('.block-tree'); CourseOutlineFactory('.block-tree');
</%static:require_module_async> </%static:require_module_async>
<div class="course-outline" id="main" tabindex="-1"> <main role="main" class="course-outline" id="main" tabindex="-1">
<ol class="block-tree" role="tree"> <ol class="block-tree" role="tree">
% for section in blocks.get('children') or []: % for section in blocks.get('children') or []:
<li <li
...@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _ ...@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _
tabindex="0" tabindex="0"
> >
<div class="section-name"> <div class="section-name">
<span>${ section['display_name'] }</span> <h3>${ section['display_name'] }</h3>
</div> </div>
<ol class="outline-item focusable" role="group" tabindex="0"> <ol class="outline-item focusable" role="group" tabindex="0">
% for subsection in section.get('children') or []: % for subsection in section.get('children') or []:
...@@ -120,7 +120,7 @@ from django.utils.translation import ugettext as _ ...@@ -120,7 +120,7 @@ from django.utils.translation import ugettext as _
</li> </li>
% endfor % endfor
</ol> </ol>
</div> </main>
<%static:require_module_async module_name="js/dateutil_factory" class_name="DateUtilFactory"> <%static:require_module_async module_name="js/dateutil_factory" class_name="DateUtilFactory">
DateUtilFactory.transform('.localized-datetime'); DateUtilFactory.transform('.localized-datetime');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment