182 lines
7.8 KiB
HTML
182 lines
7.8 KiB
HTML
<%! import json %>
|
|
<%! from django.utils.translation import ugettext as _ %>
|
|
<%! from django.core.urlresolvers import reverse %>
|
|
<%inherit file="base.html" />
|
|
<%def name="online_help_token()"><% return "team" %></%def>
|
|
<%block name="title">${_("Library User Access")}</%block>
|
|
<%block name="bodyclass">is-signedin course users view-team</%block>
|
|
|
|
<%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">> </span>${_("User Access")}
|
|
</h1>
|
|
|
|
<nav class="nav-actions">
|
|
<h3 class="sr">${_("Page Actions")}</h3>
|
|
<ul>
|
|
%if allow_actions:
|
|
<li class="nav-item">
|
|
<a href="#" class="button new-button create-user-button"><i class="icon-plus"></i> ${_("New Team Member")}</a>
|
|
</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="">
|
|
<span class="tip tip-stacked">${_("Please provide the email address of the user you'd like to add")}</span>
|
|
</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
|
|
|
|
<ol class="user-list">
|
|
% for user in all_users:
|
|
<%
|
|
is_instructor = user in instructors
|
|
is_staff = user in staff
|
|
role_id = 'admin' if is_instructor else ('staff' if is_staff else 'user')
|
|
role_desc = _("Admin") if is_instructor else (_("Staff") if is_staff else _("User"))
|
|
%>
|
|
|
|
<li class="user-item" data-email="${user.email}">
|
|
|
|
<span class="wrapper-ui-badge">
|
|
<span class="flag flag-role flag-role-${role_id} is-hanging">
|
|
<span class="label sr">${_("Current Role:")}</span>
|
|
<span class="value">
|
|
${role_desc}
|
|
% if request.user.id == user.id:
|
|
<span class="msg-you">${_("You!")}</span>
|
|
% endif
|
|
</span>
|
|
</span>
|
|
</span>
|
|
|
|
<div class="item-metadata">
|
|
<h3 class="user-name">
|
|
<span class="user-username">${user.username}</span>
|
|
<span class="user-email">
|
|
<a class="action action-email" href="mailto:${user.email}" title="${_("send an email message to {email}").format(email=user.email)}">${user.email}</a>
|
|
</span>
|
|
</h3>
|
|
</div>
|
|
|
|
% if allow_actions:
|
|
<ul class="item-actions user-actions">
|
|
% if is_instructor:
|
|
% if len(instructors) > 1:
|
|
<li class="action action-role">
|
|
<a href="#" class="make-staff admin-role remove-admin-role">${_("Remove Admin Access")}</span></a>
|
|
</li>
|
|
% else:
|
|
<li class="action action-role">
|
|
<span class="admin-role notoggleforyou">${_("Promote another member to Admin to remove admin rights")}</span>
|
|
</li>
|
|
% endif
|
|
% elif is_staff:
|
|
<li class="action action-role">
|
|
<a href="#" class="make-instructor admin-role add-admin-role">${_("Add Admin Access")}</span></a>
|
|
<a href="#" class="make-user admin-role remove-admin-role">${_("Remove Staff Access")}</span></a>
|
|
</li>
|
|
% else:
|
|
<li class="action action-role">
|
|
<a href="#" class="make-staff admin-role add-admin-role">${_("Add Staff Access")}</span></a>
|
|
</li>
|
|
% endif
|
|
<li class="action action-delete ${"is-disabled" if request.user.id == user.id and is_instructor and len(instructors) == 1 else ""}">
|
|
<a href="#" class="delete remove-user action-icon" data-tooltip="${_("Remove this user")}"><i class="icon-trash"></i><span class="sr">${_("Delete the user, {username}").format(username=user.username)}</span></a>
|
|
</li>
|
|
</ul>
|
|
% elif request.user.id == user.id:
|
|
<ul class="item-actions user-actions">
|
|
<li class="action action-delete">
|
|
<a href="#" class="delete remove-user action-icon" data-tooltip="${_("Remove me")}"><i class="icon-trash"></i><span class="sr">${_("Remove me from this library")}</span></a>
|
|
</li>
|
|
</ul>
|
|
% endif
|
|
|
|
</li>
|
|
% endfor
|
|
</ol>
|
|
|
|
% if allow_actions and len(all_users) == 1:
|
|
<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">
|
|
<p>${_('Adding team members makes content authoring collaborative. Users must be signed up for Studio and have an active account. ')}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="list-actions">
|
|
<li class="action-item">
|
|
<a href="#" class="action action-primary button new-button create-user-button"><i class="icon-plus icon-inline"></i> ${_('Add a New User')}</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
%endif
|
|
</article>
|
|
|
|
<aside class="content-supplementary" role="complimentary">
|
|
<div class="bit">
|
|
<h3 class="title-3">${_("Library Access Roles")}</h3>
|
|
<p>${_("Library staff are content co-authors. They have full writing and editing privileges on all content in the library.")}</p>
|
|
<p>${_("Admins are library team members who can also add and remove other team members.")}</p>
|
|
<p>${_("Library users cannot edit content in the library, but can view the content and are able to reference or use library elements in their own courses.")}</p>
|
|
</div>
|
|
|
|
<div class="bit">
|
|
<h3 class="title-3">${_("Organization-Wide Access")}</h3>
|
|
<p>${_("Users who have been granted admin, staff, or user access at the organization level may not be listed here but will still have access to this library.")}</p>
|
|
</div>
|
|
|
|
% if allow_actions:
|
|
<div class="bit">
|
|
<h3 class="title-3">${_("Transferring Ownership")}</h3>
|
|
<p>${_("Every library must have an Admin. If you're the Admin and you want transfer ownership of the library, click Add admin access to make another user the Admin, then ask that user to remove you from the library admin list.")}</p>
|
|
</div>
|
|
% endif
|
|
</aside>
|
|
</section>
|
|
</div>
|
|
</%block>
|
|
|
|
<%block name="requirejs">
|
|
require(["js/factories/manage_users_lib"], function(ManageUsersFactory) {
|
|
ManageUsersFactory(
|
|
"${context_library.display_name_with_default | h}",
|
|
${json.dumps([user.email for user in all_users])},
|
|
"${reverse('contentstore.views.course_team_handler', kwargs={'course_key_string': library_key, 'email': '@@EMAIL@@'})}"
|
|
);
|
|
});
|
|
</%block>
|