Skip to content

Commit

Permalink
refactor: address PR reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Feb 28, 2024
1 parent 7168594 commit 5a2199f
Showing 1 changed file with 20 additions and 35 deletions.
55 changes: 20 additions & 35 deletions cms/templates/js/staff-lock-editor.underscore
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@
<span> <%- gettext('Visible to learners') %> </span>
</label>
<p class='field-message' id='staff-lock-description'> <%- gettext('It is visible to learners, ensuring that all learners can view its contents.') %> </p>
</div>
<div class="modal-section-content staff-lock">
<label class="label">
<input type="radio" id="staff_lock" name="content-visibility" class="input input-radio" />
<span> <%- gettext('Hide from learners') %> </span>
</label>
<p class='field-message' id='staff-lock-description'> <%- gettext('It is intentionally hidden from learners, ensuring that only the course staff can view its contents.') %> </p>
<% if (hasExplicitStaffLock && !ancestorLocked) { %>
<p class="tip tip-warning">
<% if (xblockInfo.isVertical()) { %>
<p> <%- gettext('If the unit was previously published and released to learners, any changes you made to the unit when it was hidden will now be visible to learners.') %> </p>
<% } else { %>
<% var message = gettext('If you make this %(xblockType)s visible to learners, learners will be able to see its content after the release date has passed and you have published the unit. Only units that are explicitly hidden from learners will remain hidden after you clear this option for the %(xblockType)s.') %>
<%- interpolate(message, { xblockType: xblockType }, true) %>
<% } %>
</p>
<% } %>
</div>
<div class="modal-section-content hide-from-toc">
<% if (!xblockInfo.isVertical()) { %>
<label class="label">
Expand All @@ -47,22 +29,25 @@
<% } %>
</div>
</div>
<% } else { %>
<div class="modal-section-content staff-lock">
<label class="label">
<input type="checkbox" id="staff_lock" name="staff_lock" class="input input-checkbox" />
<%- gettext('Hide from learners') %>
</label>
<% if (hasExplicitStaffLock && !ancestorLocked) { %>
<p class="tip tip-warning">
<% if (xblockInfo.isVertical()) { %>
<%- gettext('If the unit was previously published and released to learners, any changes you made to the unit when it was hidden will now be visible to learners.') %>
<% } else { %>
<% var message = gettext('If you make this %(xblockType)s visible to learners, learners will be able to see its content after the release date has passed and you have published the unit. Only units that are explicitly hidden from learners will remain hidden after you clear this option for the %(xblockType)s.') %>
<%- interpolate(message, { xblockType: xblockType }, true) %>
<% } %>
</p>
<% } %>
</div>
<% } %>
<div class="modal-section-content staff-lock">
<label class="label">
<% var inputType = enableHideFromTOCUI ? 'radio' : 'checkbox'; %>
<input type="<%- inputType %>" id="staff_lock" name="content-visibility" class="<%- inputType === 'radio' ? 'input input-radio' : 'input input-checkbox' %>" />
<%- gettext('Hide from learners') %>
</label>
<% if (enableHideFromTOCUI) { %>
<p class='field-message' id='staff-lock-description'> <%- gettext('It is intentionally hidden from learners, ensuring that only the course staff can view its contents.') %> </p>
<% } %>
<% if (hasExplicitStaffLock && !ancestorLocked) { %>
<p class="tip tip-warning">
<% if (xblockInfo.isVertical()) { %>
<%- gettext('If the unit was previously published and released to learners, any changes you made to the unit when it was hidden will now be visible to learners.') %>
<% } else { %>
<% var message = gettext('If you make this %(xblockType)s visible to learners, learners will be able to see its content after the release date has passed and you have published the unit. Only units that are explicitly hidden from learners will remain hidden after you clear this option for the %(xblockType)s.') %>
<%- interpolate(message, { xblockType: xblockType }, true) %>
<% } %>
</p>
<% } %>
</div>
</form>

0 comments on commit 5a2199f

Please sign in to comment.