Commit 4185c11b by Chris Rodriguez

Updating markup and styles

parent b32d2205
...@@ -2,7 +2,7 @@ class @Navigation ...@@ -2,7 +2,7 @@ class @Navigation
constructor: -> constructor: ->
if $('#accordion').length if $('#accordion').length
# First look for an active section # First look for an active section
active = $('#accordion div div ol:has(li.active)').index('#accordion div div ol') active = $('#accordion div div:has(a.active)').index('#accordion div div')
# if we didn't find one, look for an active chapter # if we didn't find one, look for an active chapter
if active < 0 if active < 0
active = $('#accordion h3.active').index('#accordion h3') active = $('#accordion h3.active').index('#accordion h3')
...@@ -40,8 +40,7 @@ class @Navigation ...@@ -40,8 +40,7 @@ class @Navigation
$('.ui-accordion-content-active').parent().hide() $('.ui-accordion-content-active').parent().hide()
$('#accordion .ui-accordion-content-active').removeClass('ui-accordion-content-active') $('#accordion .ui-accordion-content-active').removeClass('ui-accordion-content-active')
$(this).closest('.chapter').next('div').children('div').addClass('ui-accordion-content-active') $(this).closest('.chapter').next('div').children('div').addClass('ui-accordion-content-active')
$('.ui-accordion-content-active').parent().show() $('.ui-accordion-content-active').parent().show().focus()
$('.ui-accordion-content-active').show() $('.ui-accordion-content-active').show()
$('.ui-accordion-content-active li:first-child a').focus()
$('.ui-accordion-content-active').attr('aria-hidden', 'false') $('.ui-accordion-content-active').attr('aria-hidden', 'false')
...@@ -6,44 +6,39 @@ ...@@ -6,44 +6,39 @@
%> %>
<%def name="make_chapter(chapter)"> <%def name="make_chapter(chapter)">
<button class="chapter" id="${chapter['display_id']}-parent" aria-controls="${chapter['display_id']}-child" aria-expanded="false" aria-pressed="false"> <button class="button-chapter chapter" id="${chapter['display_id']}-parent" aria-controls="${chapter['display_id']}-child" aria-expanded="false" aria-pressed="false">
<% <%
if chapter.get('active'): if chapter.get('active'):
aria_label = _('{chapter}, current chapter').format(chapter=chapter['display_name']) aria_label = _('{chapter}, current chapter').format(chapter=chapter['display_name'])
active_class = ' class="active"' active_class = 'active"'
else: else:
aria_label = chapter['display_name'] aria_label = chapter['display_name']
active_class = '' active_class = ''
%> %>
<h3 ${active_class} aria-label="${aria_label}"> <h3 class="group-heading ${active_class}" aria-label="${aria_label}">
${chapter['display_name']} ${chapter['display_name']}
</h3> </h3>
</button> </button>
<div class="chapter-content-container"> <div class="chapter-content-container" tabindex="-1">
<div id="${chapter['display_id']}-child" role="region" aria-labelledby="${chapter['display_id']}-parent" aria-hidden="false"> <div class="chapter-menu" id="${chapter['display_id']}-child" role="region" aria-labelledby="${chapter['display_id']}-parent" aria-hidden="false">
<ol> % for section in chapter['sections']:
% for section in chapter['sections']: <a class="${'active' if 'active' in section and section['active'] else ''} ${'graded' if 'graded' in section and section['graded'] else ''}" href="${reverse('courseware_section', args=[course_id, chapter['url_name'], section['url_name']])}">
<li class="${'active' if 'active' in section and section['active'] else ''} ${'graded' if 'graded' in section and section['graded'] else ''}"> <p>${section['display_name']} ${'<span class="sr">, current section</span>' if 'active' in section and section['active'] else ''}</p>
<a href="${reverse('courseware_section', args=[course_id, chapter['url_name'], section['url_name']])}"> <%
<p>${section['display_name']} ${'<span class="sr">, current section</span>' if 'active' in section and section['active'] else ''}</p> if section.get('due') is None:
<% due_date = ''
if section.get('due') is None: else:
due_date = '' formatted_string = get_time_display(section['due'], due_date_display_format, coerce_tz=settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES)
else: due_date = '' if len(formatted_string)==0 else _('due {date}').format(date=formatted_string)
formatted_string = get_time_display(section['due'], due_date_display_format, coerce_tz=settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES) %>
due_date = '' if len(formatted_string)==0 else _('due {date}').format(date=formatted_string) <p class="subtitle">${section['format']} ${due_date}</p>
%> % if 'graded' in section and section['graded']:
<p class="subtitle">${section['format']} ${due_date}</p> <img src="/static/images/graded.png" alt="Graded Section">
% endif
% if 'graded' in section and section['graded']: </a>
<img src="/static/images/graded.png" alt="Graded Section"> % endfor
% endif
</a>
</li>
% endfor
</ol>
</div>
</div> </div>
</div>
</%def> </%def>
% for chapter in toc: % for chapter in toc:
......
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