Improves navigation within Studio for Learning Sequences, speeding up authors who want to see how a learner progresses through content without needing to jump over to the LMS. This adds a dropdown section navigator to the breadcrumbs on the unit page and copies the sequence navigator from LMS to the studio unit page.
136 lines
5.3 KiB
HTML
136 lines
5.3 KiB
HTML
<%page expression_filter="h"/>
|
|
<%! from django.utils.translation import pgettext, ugettext as _ %>
|
|
|
|
<div id="sequence_${element_id}" class="sequence" data-id="${item_id}"
|
|
data-position="${position}" data-ajax-url="${ajax_url}"
|
|
data-next-url="${next_url}" data-prev-url="${prev_url}"
|
|
data-save-position="${'true' if save_position else 'false'}"
|
|
data-show-completion="${'true' if show_completion else 'false'}"
|
|
>
|
|
% if not exclude_units:
|
|
|
|
% if banner_text:
|
|
<div class="pattern-library-shim alert alert-information subsection-header" tabindex="-1">
|
|
<span class="pattern-library-shim icon alert-icon fa fa-info-circle" aria-hidden="true"></span>
|
|
<span class="sr">${_('Important!')} </span>
|
|
<div class="pattern-library-shim alert-message">
|
|
<p class="pattern-library-shim alert-copy">
|
|
${banner_text}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
% endif
|
|
<div class="sequence-nav">
|
|
<button class="sequence-nav-button button-previous">
|
|
<span class="icon fa fa-chevron-prev" aria-hidden="true"></span>
|
|
## Translators: A button for showing the Previous Unit
|
|
<span class="sequence-nav-button-label">${pgettext('unit', 'Previous')}</span>
|
|
</button>
|
|
<button class="sequence-nav-button button-next">
|
|
## Translators: A button for showing the Next Unit
|
|
<span class="sequence-nav-button-label">${pgettext('unit', 'Next')}</span>
|
|
<span class="icon fa fa-chevron-next" aria-hidden="true"></span>
|
|
</button>
|
|
<nav class="sequence-list-wrapper" aria-label="${_('Sequence')}">
|
|
<ol id="sequence-list" role="tablist">
|
|
% if gated_content['gated']:
|
|
<li>
|
|
<button class="active nav-item tab" title="${_('Content Locked')}" id="tab_0" role="tab" tabindex="-1" aria-selected="true" aria-expanded="true" aria-controls="content_locked" disabled>
|
|
<span class="icon fa fa-lock" aria-hidden="true"></span>
|
|
</button>
|
|
</li>
|
|
% else:
|
|
% for idx, item in enumerate(items):
|
|
<li role="presentation">
|
|
<button class="seq_${item['type']} inactive nav-item tab"
|
|
role="tab"
|
|
tabindex="-1"
|
|
aria-selected="false"
|
|
aria-expanded="false"
|
|
aria-controls="seq_content"
|
|
data-index="${idx}"
|
|
data-id="${item['id']}"
|
|
data-element="${idx+1}"
|
|
data-page-title="${item['page_title']}"
|
|
data-path="${item['path']}"
|
|
data-graded="${item['graded']}"
|
|
% if item.get('href'):
|
|
data-href="${item['href']}"
|
|
% endif
|
|
id="tab_${idx}">
|
|
<span class="icon fa seq_${item['type']}" aria-hidden="true"></span>
|
|
% if 'complete' in item:
|
|
<span
|
|
class="fa fa-check-circle check-circle ${"is-hidden" if not item['complete'] else ""}"
|
|
style="color:green"
|
|
aria-hidden="true"
|
|
></span>
|
|
% if item['complete']:
|
|
<span class="sr">${_("Completed")}</span>
|
|
%endif
|
|
% endif
|
|
<span class="fa fa-fw fa-bookmark bookmark-icon ${"is-hidden" if not item['bookmarked'] else "bookmarked"}" aria-hidden="true"></span>
|
|
<div class="sequence-tooltip sr"><span class="sr">${item['type']} </span>${item['page_title']}<span class="sr bookmark-icon-sr"> ${_("Bookmarked") if item['bookmarked'] else ""}</span></div>
|
|
</button>
|
|
</li>
|
|
% endfor
|
|
% endif
|
|
% if exclude_units:
|
|
<li role="presentation">
|
|
<button class="seq_new_button inactive xnav-item tab"
|
|
role="tab"
|
|
tabindex="-1"
|
|
aria-selected="false"
|
|
aria-expanded="false"
|
|
aria-controls="seq_content"
|
|
data-parent="${item_id}"
|
|
data-category="vertical"
|
|
data-default-name="${_('Unit')}"
|
|
>
|
|
<span
|
|
class="fa fa-plus"
|
|
aria-hidden="true"
|
|
></span> New Unit
|
|
</button>
|
|
</li>
|
|
% endif
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
% if not exclude_units:
|
|
% if gated_content['gated']:
|
|
<%include file="_gated_content.html" args="prereq_url=gated_content['prereq_url'], prereq_section_name=gated_content['prereq_section_name'], gated_section_name=gated_content['gated_section_name']"/>
|
|
% else:
|
|
<div class="sr-is-focusable" tabindex="-1"></div>
|
|
|
|
% for idx, item in enumerate(items):
|
|
<div id="seq_contents_${idx}"
|
|
aria-labelledby="tab_${idx}"
|
|
aria-hidden="true"
|
|
class="seq_contents tex2jax_ignore asciimath2jax_ignore">
|
|
${item['content']}
|
|
</div>
|
|
% endfor
|
|
<div id="seq_content" role="tabpanel"></div>
|
|
% endif
|
|
% else:
|
|
<div id="seq_content" role="tabpanel"></div>
|
|
% endif
|
|
|
|
% if not exclude_units:
|
|
<nav class="sequence-bottom" aria-label="${_('Section')}">
|
|
<button class="sequence-nav-button button-previous">
|
|
<span class="icon fa fa-chevron-prev" aria-hidden="true"></span>
|
|
## Translators: A button for showing the Previous Unit
|
|
<span>${pgettext('unit', 'Previous')}</span>
|
|
</button>
|
|
<button class="sequence-nav-button button-next">
|
|
## Translators: A button for showing the Next Unit
|
|
<span>${pgettext('unit', 'Next')}</span>
|
|
<span class="icon fa fa-chevron-next" aria-hidden="true"></span>
|
|
</button>
|
|
</nav>
|
|
</div>
|
|
% endif
|