toggle_notes.html 1.07 KB
Newer Older
1 2 3 4 5
<%!
import json
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
%>
6 7 8 9 10 11 12 13
<%page args="course"/>

<%
  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>
14
  <button class="utility-control utility-control-button action-toggle-notes is-disabled ${"is-active" if edxnotes_visibility else ""}">
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
    <i class="icon fa fa-pencil"></i>
    % 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>
<script type="text/javascript">
  (function (require) {
      require(['js/edxnotes/views/toggle_notes_factory'], function(ToggleNotesFactory) {
          ToggleNotesFactory(${json.dumps(edxnotes_visibility)}, '${edxnotes_visibility_url}');
      });
  }).call(this, require || RequireJS.require);
</script>