toggle_notes.html 1.26 KB
Newer Older
1
<%page args="course" expression_filter="h"/>
2 3 4
<%!
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
5
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
6
%>
cahrens committed
7
<%namespace name='static' file='/static_content.html'/>
8 9 10 11 12 13 14

<%
  edxnotes_visibility = course.edxnotes_visibility
  edxnotes_visibility_url = reverse("edxnotes_visibility", kwargs={"course_id": course.id})
%>
<div class="wrapper-utility edx-notes-visibility">
  <span class="action-toggle-message" aria-live="polite"></span>
15
  <button class="utility-control utility-control-button action-toggle-notes is-disabled ${"is-active" if edxnotes_visibility else ""}">
16
    <span class="icon fa fa-pencil" aria-hidden="true"></span>
17 18 19 20 21 22 23
    % if edxnotes_visibility:
    <span class="utility-control-label sr">${_("Hide notes")}</span>
    % else:
    <span class="utility-control-label sr">${_("Show notes")}</span>
    % endif
  </button>
</div>
cahrens committed
24

25
<%static:require_module_async module_name="js/edxnotes/views/notes_visibility_factory" class_name="NotesVisibilityFactory">
26 27 28 29
    NotesVisibilityFactory.ToggleVisibilityView(
        ${edxnotes_visibility | n, dump_js_escaped_json},
        '${edxnotes_visibility_url | n, js_escaped_string}'
    );
30
</%static:require_module_async>