manage_users_lib.html 4.67 KB
Newer Older
1 2 3 4
<%! import json %>
<%! from django.utils.translation import ugettext as _ %>
<%! from django.core.urlresolvers import reverse %>
<%inherit file="base.html" />
5
<%def name="online_help_token()"><% return "team_library" %></%def>
6 7
<%block name="title">${_("Library User Access")}</%block>
<%block name="bodyclass">is-signedin course users view-team</%block>
8 9 10 11 12 13 14
<%namespace name='static' file='static_content.html'/>

<%block name="header_extras">
<script type="text/template" id="team-member-tpl">
    <%static:include path="js/team-member.underscore" />
</script>
</%block>
15 16 17 18 19 20 21 22 23 24

<%block name="content">

<div class="wrapper-mast wrapper">
  <header class="mast has-actions has-subtitle">
    <h1 class="page-header">
      <small class="subtitle">${_("Settings")}</small>
      <span class="sr">&gt; </span>${_("User Access")}
    </h1>

25
    <nav class="nav-actions" aria-label="${_('Page Actions')}">
26 27 28 29
      <h3 class="sr">${_("Page Actions")}</h3>
      <ul>
        %if allow_actions:
        <li class="nav-item">
30
          <a href="#" class="button new-button create-user-button"><i class="icon fa fa-plus"></i> ${_("New Team Member")}</a>
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
        </li>
        %endif
      </ul>
    </nav>
  </header>
</div>

<div class="wrapper-content wrapper">
  <section class="content">
    <article class="content-primary" role="main">
      %if allow_actions:
      <div class="wrapper-create-element animate wrapper-create-user">
        <form class="form-create create-user" id="create-user-form" name="create-user-form">
          <div class="wrapper-form">
            <h3 class="title">${_("Grant Access to This Library")}</h3>

            <fieldset class="form-fields">
              <legend class="sr">${_("New Team Member Information")}</legend>

                <ol class="list-input">
                  <li class="field text required create-user-email">
                    <label for="user-email-input">${_("User's Email Address")}</label>
                    <input id="user-email-input" class="user-email-input" name="user-email" type="text" placeholder="${_('example: username@domain.com')}" value="">
54
                    <span class="tip tip-stacked">${_("Provide the email address of the user you want to add")}</span>
55 56 57 58 59 60 61 62 63 64 65 66 67
                  </li>
                </ol>
            </fieldset>
          </div>

          <div class="actions">
            <button class="action action-primary" type="submit">${_("Add User")}</button>
            <button class="action action-secondary action-cancel">${_("Cancel")}</button>
          </div>
        </form>
      </div>
      %endif

68 69 70 71
      <ol class="user-list" id="user-list">
        <div class="ui-loading">
          <p><span class="spin"><i class="icon fa fa-refresh"></i></span> <span class="copy">Loading</span></p>
        </div>
72 73
      </ol>

74
      % if allow_actions and len(users) == 1:
75 76 77 78
      <div class="notice notice-incontext notice-create has-actions">
        <div class="msg">
          <h3 class="title">${_('Add More Users to This Library')}</h3>
          <div class="copy">
79
            <p>${_('Grant other members of your course team access to this library. New library users must have an active {studio_name} account.').format(studio_name=settings.STUDIO_SHORT_NAME)}</p>
80 81 82 83 84
          </div>
        </div>

        <ul class="list-actions">
          <li class="action-item">
85
            <a href="#" class="action action-primary button new-button create-user-button"><i class="icon fa fa-plus icon-inline"></i> ${_('Add a New User')}</a>
86 87 88 89 90 91
          </li>
        </ul>
      </div>
      %endif
    </article>

92
    <aside class="content-supplementary" role="complementary">
93 94
      <div class="bit">
        <h3 class="title-3">${_("Library Access Roles")}</h3>
95 96 97 98
        <p>${_("There are three access roles for libraries: User, Staff, and Admin.")}</p>
        <p>${_("Users can view library content and can reference or use library components in their courses, but they cannot edit the contents of a library.")}</p>
        <p>${_("Staff are content co-authors. They have full editing privileges on the contents of a library.")}</p>
        <p>${_("Admins have full editing privileges and can also add and remove other team members. There must be at least one user with Admin privileges in a library.")}</p>
99 100 101 102 103 104 105
      </div>
    </aside>
  </section>
</div>
</%block>

<%block name="requirejs">
106 107
  require(["js/factories/manage_users_lib"], function(ManageLibraryUsersFactory) {
      ManageLibraryUsersFactory(
108
        "${context_library.display_name_with_default | h}",
109 110 111 112
        ${json.dumps(users)},
        "${reverse('contentstore.views.course_team_handler', kwargs={'course_key_string': library_key, 'email': '@@EMAIL@@'})}",
        ${ request.user.id },
        ${str(allow_actions).lower()}
113 114 115
      );
  });
</%block>