Files
edx-platform/cms/templates/js/unit-access-editor.underscore
Kshitij Sobti 8fa962b1c8 feat: Add Studio UI to edit discussions toggle [TNL-7349] (#29720)
Adds a UI in studio to toggle discussions for a units if a course is using a discussion provider that supports it and per-unit discussion control is enabled.

Co-authored-by: Kshitij Sobti <kshitij@opencraft.com

Co-authored-by: Agrendalath <piotr@surowiec.it>
2022-01-19 11:21:32 +05:00

47 lines
2.8 KiB
Plaintext

<%
var userPartitionInfo = xblockInfo.get('user_partition_info');
var selectablePartitions = userPartitionInfo['selectable_partitions'];
%>
<form>
<% if (selectablePartitions && selectablePartitions.length > 0) { %>
<h3 class="modal-section-title access-change">
<%- gettext('Unit Access') %>
</h3>
<div class="modal-section-content access-change">
<label class="group-select-title"><%- gettext('Restrict access to:') %>
<select class="user-partition-select" id="partition-select">
<option value="-1" selected ="selected"><%- gettext('Select a group type') %></option>
<% for (var i=0; i < selectablePartitions.length; i++) { %>
<option id="<%- selectablePartitions[i].id %>-option" value="<%- selectablePartitions[i].id %>"><%- selectablePartitions[i].name %></option>
<% } %>
</select>
</label>
<br>
<div class="user-partition-group-checkboxes">
<% for (var i=0; i < selectablePartitions.length; i++) { %>
<div role="group" aria-labelledby="partition-group-directions-<%- selectablePartitions[i].id %>" id="<%- selectablePartitions[i].id %>-checkboxes">
<div class="partition-group-directions" id="partition-group-directions-<%- selectablePartitions[i].id %>">
<%- gettext('Select one or more groups:') %>
<% for (var j = 0; j < selectablePartitions[i].groups.length; j++) { %>
<div class="field partition-group-control">
<input type="checkbox" id="content-group-<%- selectablePartitions[i].groups[j].id %>" value="<%- selectablePartitions[i].groups[j].id %>" class="input input-checkbox"
<% if (selectablePartitions[i].groups[j].selected) { %> checked="checked" <% } %> />
<% if (selectablePartitions[i].groups[j].deleted) { %>
<label for="content-group-<%- selectablePartitions[i].groups[j].id %>" class="label deleted">
<%- gettext('Deleted Group') %>
<span class="deleted-group-message"><%- gettext('This group no longer exists. Choose another group or do not restrict access to this unit.') %></span>
<% } else { %>
<label for="content-group-<%-selectablePartitions[i].groups[j].id %>" class="label">
<%- selectablePartitions[i].groups[j].name %>
</label>
<% } %>
</div>
<% } %>
</div>
</div>
<% } %>
</div>
</div>
<% } %>
</form>