Because xblock handlers normally get a block tree that already has inaccessible blocks stripped, they don't see FBE gated blocks at all. So the get_completion handler would return True for FBE units incorrectly. Leading to a visual bug as an audit user went through their units in the courseware. In order to let the handler know about the full tree, I've added a new attribute you can set on your xblock handlers: my_handler.will_recheck_access = True This will tell the top-level handler code get the full tree for you. As part of this, I've also changed the sequence xblock handler's into proper xblock handlers (not old-style xmodule handlers). This changes their URLs slightly. I've kept the old URLs for now as well, but they'll be removed after Maple. AA-409
147 lines
5.6 KiB
HTML
147 lines
5.6 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-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" role="note" 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
|
|
% if not gated_sequence_paywall:
|
|
<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="check-circle ${"is-hidden" if not item['complete'] else ""}">
|
|
<span
|
|
class="fa fa-check-circle"
|
|
style="color:green"
|
|
aria-hidden="true"
|
|
></span>
|
|
</span>
|
|
% if item['complete']:
|
|
<span class="sr">${_("Completed")}</span>
|
|
%endif
|
|
% endif
|
|
<span class="bookmark-icon ${"is-hidden" if not item['bookmarked'] else "bookmarked"}">
|
|
<span class="fa fa-fw fa-bookmark" aria-hidden="true"></span>
|
|
</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>
|
|
% endif
|
|
% 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']"/>
|
|
% elif gated_sequence_paywall:
|
|
<h2 class="hd hd-2 unit-title">
|
|
${sequence_name}<span class="sr">${_("Content Locked")}</span>
|
|
</h2>
|
|
${gated_sequence_paywall | n, decode.utf8}
|
|
% 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
|