Files
edx-platform/cms/templates/js/publish-xblock.underscore
Eric Fischer 35ae67b530 New CMS visibility settings (#12940)
TNL-4906 Subsections now use radio buttons, to allow for "hide after due" as a
visibility option. Also, all tabs have been consolidated to "Basic" and
"Advanced", and visibility options have moved there.

Documentation links are updated to assist course authors with the new
visibility options. Tests have also been updated, and the changes suggested
in TNL-4951 are included.
2016-07-20 19:58:51 -04:00

124 lines
5.3 KiB
Plaintext

<%
var title = gettext("Draft (Never published)");
if (visibilityState === 'staff_only') {
title = gettext("Visible to Staff Only");
} else if (visibilityState === 'live') {
title = gettext("Published and Live");
} else if (published && !hasChanges) {
title = gettext("Published (not yet released)");
} else if (published && hasChanges) {
title = gettext("Draft (Unpublished changes)");
}
var releaseLabel = gettext("Release:");
if (visibilityState === 'live') {
releaseLabel = gettext("Released:");
} else if (visibilityState === 'ready') {
releaseLabel = gettext("Scheduled:");
}
var visibleToStaffOnly = visibilityState === 'staff_only';
%>
<div class="bit-publishing <%- visibilityClass %> <% if (releaseDate) { %>is-scheduled<% } %>">
<h3 class="bar-mod-title pub-status"><span class="sr"><%- gettext("Publishing Status") %></span>
<%- title %>
</h3>
<div class="wrapper-last-draft bar-mod-content">
<p class="copy meta">
<% if (hasChanges && editedOn && editedBy) {
var message = gettext("Draft saved on %(last_saved_date)s by %(edit_username)s") %>
<%= interpolate(_.escape(message), {
last_saved_date: '<span class="date">' + _.escape(editedOn) + '</span>',
edit_username: '<span class="user">' + _.escape(editedBy) + '</span>' }, true) %>
<% } else if (publishedOn && publishedBy) {
var message = gettext("Last published %(last_published_date)s by %(publish_username)s"); %>
<%= interpolate(_.escape(message), {
last_published_date: '<span class="date">' + _.escape(publishedOn) + '</span>',
publish_username: '<span class="user">' + _.escape(publishedBy) + '</span>' }, true) %>
<% } else { %>
<%- gettext("Previously published") %>
<% } %>
</p>
</div>
<% if (!course.get('self_paced')) { %>
<div class="wrapper-release bar-mod-content">
<h5 class="title"><%- releaseLabel %></h5>
<p class="copy">
<% if (releaseDate) { %>
<span class="release-date"><%- releaseDate %></span>
<span class="release-with">
<%- interpolate(
gettext('with %(release_date_from)s'), { release_date_from: releaseDateFrom }, true
) %>
</span>
<% } else { %>
<%- gettext("Unscheduled") %>
<% } %>
</p>
</div>
<% } %>
<div class="wrapper-visibility bar-mod-content">
<h5 class="title">
<% if (released && published && !hasChanges) { %>
<%- gettext("Is Visible To:") %>
<% } else { %>
<%- gettext("Will Be Visible To:") %>
<% } %>
</h5>
<% if (visibleToStaffOnly) { %>
<p class="visbility-copy copy">
<%- gettext("Staff Only") %>
<% if (!hasExplicitStaffLock) { %>
<span class="inherited-from">
<%- interpolate(
gettext("with %(section_or_subsection)s"),{ section_or_subsection: staffLockFrom }, true
) %>
</span>
<% } %>
</p>
<% } else { %>
<p class="visbility-copy copy"><%- gettext("Staff and Learners") %></p>
<% } %>
<% if (hasContentGroupComponents) { %>
<p class="note-visibility">
<span class="icon fa fa-eye" aria-hidden="true"></span>
<span class="note-copy"><%- gettext("Some content in this unit is visible only to particular content groups") %></span>
</p>
<% } %>
<ul class="actions-inline">
<li class="action-inline">
<a href="" class="action-staff-lock" role="button" aria-pressed="<%- hasExplicitStaffLock %>">
<% if (hasExplicitStaffLock) { %>
<span class="icon fa fa-check-square-o" aria-hidden="true"></span>
<% } else { %>
<span class="icon fa fa-square-o" aria-hidden="true"></span>
<% } %>
<%- gettext('Hide from learners') %>
</a>
</li>
</ul>
<p>
<%- gettext("Note: Do not hide graded assignments after they have been released.") %>
</p>
</div>
<div class="wrapper-pub-actions bar-mod-actions">
<ul class="action-list">
<li class="action-item">
<a class="action-publish action-primary <% if (published && !hasChanges) { %>is-disabled<% } %>"
href="" aria-disabled="<% if (published && !hasChanges) { %>true<% } else { %>false<% } %>" ><%- gettext("Publish") %>
</a>
</li>
<li class="action-item">
<a class="action-discard action-secondary <% if (!published || !hasChanges) { %>is-disabled<% } %>"
href="" aria-disabled="<% if (!published || !hasChanges) { %>true<% } else { %>false<% } %>"><%- gettext("Discard Changes") %>
</a>
</li>
</ul>
</div>
</div>