diff --git a/cms/static/js/base.js b/cms/static/js/base.js
index 4b813caf8d..50fd5918c2 100644
--- a/cms/static/js/base.js
+++ b/cms/static/js/base.js
@@ -54,10 +54,8 @@ domReady(function() {
});
// general link management - new window/tab
- $('a[rel="external"]').attr({
- title: gettext('This link will open in a new browser window/tab'),
- target: '_blank'
- });
+ $('a[rel="external"]:not([title])').attr('title', gettext('This link will open in a new browser window/tab'));
+ $('a[rel="external"]').attr('target', '_blank');
// general link management - lean modal window
$('a[rel="modal"]').attr('title', gettext('This link will open in a modal window')).leanModal({
diff --git a/cms/static/js/spec/views/pages/container_subviews_spec.js b/cms/static/js/spec/views/pages/container_subviews_spec.js
index a4c5ef1762..040e0089ea 100644
--- a/cms/static/js/spec/views/pages/container_subviews_spec.js
+++ b/cms/static/js/spec/views/pages/container_subviews_spec.js
@@ -182,7 +182,7 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
published: true, has_changes: false, visibility_state: VisibilityState.ready,
release_date: "Jul 02, 2030 at 14:20 UTC"
});
- expect(containerPage.$(headerCss).text()).toContain('Published');
+ expect(containerPage.$(headerCss).text()).toContain('Published (not yet released)');
expect(containerPage.$(publishButtonCss)).toHaveClass(disabledCss);
expect(containerPage.$(discardChangesButtonCss)).toHaveClass(disabledCss);
expect(containerPage.$(bitPublishingCss)).toHaveClass(readyClass);
@@ -210,7 +210,7 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
fetch({published: true, has_changes: false, visibility_state: VisibilityState.unscheduled,
release_date: null
});
- expect(containerPage.$(headerCss).text()).toContain('Published');
+ expect(containerPage.$(headerCss).text()).toContain('Published (not yet released)');
expect(containerPage.$(publishButtonCss)).toHaveClass(disabledCss);
expect(containerPage.$(discardChangesButtonCss)).toHaveClass(disabledCss);
verifyPublishingBitUnscheduled();
@@ -381,7 +381,8 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
});
describe("Content Visibility", function () {
- var requestStaffOnly, verifyStaffOnly, promptSpy;
+ var requestStaffOnly, verifyStaffOnly, promptSpy,
+ visibilityTitleCss = '.wrapper-visibility .title';
requestStaffOnly = function(isStaffOnly) {
containerPage.$('.action-staff-lock').click();
@@ -428,6 +429,24 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
verifyStaffOnly(false);
});
+ it("displays 'Is Visible To' when released and published", function() {
+ renderContainerPage(this, mockContainerXBlockHtml, {
+ released_to_students: true,
+ published: true,
+ has_changes: false
+ });
+ expect(containerPage.$(visibilityTitleCss).text()).toContain('Is Visible To');
+ });
+
+ it("displays 'Will Be Visible To' when not released or fully published", function() {
+ renderContainerPage(this, mockContainerXBlockHtml, {
+ released_to_students: false,
+ published: true,
+ has_changes: true
+ });
+ expect(containerPage.$(visibilityTitleCss).text()).toContain('Will Be Visible To')
+ });
+
it("can be set to staff only", function() {
renderContainerPage(this, mockContainerXBlockHtml);
requestStaffOnly(true);
@@ -500,25 +519,37 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
describe("Message Area", function() {
var messageSelector = '.container-message .warning',
- warningMessage = 'This content is live for students. Edit with caution.';
+ unchangedWarningMessage = 'This unit is visible to students. If you edit the unit, you must re-publish it for students to see your changes.',
+ hasChangesWarningMessage = 'Caution: The last published version of this unit is live. By publishing changes you will change the student experience.';
it('is empty for a unit that is not currently visible to students', function() {
renderContainerPage(this, mockContainerXBlockHtml, {
- currently_visible_to_students: false
+ currently_visible_to_students: false,
+ has_changes: false
});
expect(containerPage.$(messageSelector).text().trim()).toBe('');
});
- it('shows a message for a unit that is currently visible to students', function() {
+ it('shows a message for a unit that is currently visible to students and is unchanged', function() {
renderContainerPage(this, mockContainerXBlockHtml, {
- currently_visible_to_students: true
+ currently_visible_to_students: true,
+ has_changes: false
});
- expect(containerPage.$(messageSelector).text().trim()).toBe(warningMessage);
+ expect(containerPage.$(messageSelector).text().trim()).toBe(unchangedWarningMessage);
+ });
+
+ it('shows a message for a unit that is currently visible to students and has changes', function() {
+ renderContainerPage(this, mockContainerXBlockHtml, {
+ currently_visible_to_students: true,
+ has_changes: true
+ });
+ expect(containerPage.$(messageSelector).text().trim()).toBe(hasChangesWarningMessage);
});
it('hides the message when the unit is hidden from students', function() {
renderContainerPage(this, mockContainerXBlockHtml, {
- currently_visible_to_students: true
+ currently_visible_to_students: true,
+ has_changes: false
});
fetch({ currently_visible_to_students: false });
expect(containerPage.$(messageSelector).text().trim()).toBe('');
@@ -526,10 +557,11 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
it('shows a message when a unit is made visible', function() {
renderContainerPage(this, mockContainerXBlockHtml, {
- currently_visible_to_students: false
+ currently_visible_to_students: false,
+ has_changes: false
});
fetch({ currently_visible_to_students: true });
- expect(containerPage.$(messageSelector).text().trim()).toBe(warningMessage);
+ expect(containerPage.$(messageSelector).text().trim()).toBe(unchangedWarningMessage);
});
});
});
diff --git a/cms/static/js/views/pages/container_subviews.js b/cms/static/js/views/pages/container_subviews.js
index 21c0ccd76a..587952b2c0 100644
--- a/cms/static/js/views/pages/container_subviews.js
+++ b/cms/static/js/views/pages/container_subviews.js
@@ -38,12 +38,13 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
},
shouldRefresh: function(model) {
- return ViewUtils.hasChangedAttributes(model, ['currently_visible_to_students']);
+ return ViewUtils.hasChangedAttributes(model, ['currently_visible_to_students', 'has_changes']);
},
render: function() {
this.$el.html(this.template({
- currentlyVisibleToStudents: this.model.get('currently_visible_to_students')
+ currentlyVisibleToStudents: this.model.get('currently_visible_to_students'),
+ hasChanges: this.model.get('has_changes')
}));
return this;
}
@@ -116,6 +117,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
published: this.model.get('published'),
publishedOn: this.model.get('published_on'),
publishedBy: this.model.get('published_by'),
+ released: this.model.get('released_to_students'),
releaseDate: this.model.get('release_date'),
releaseDateFrom: this.model.get('release_date_from')
}));
@@ -144,7 +146,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
e.preventDefault();
}
ViewUtils.confirmThenRunOperation(gettext("Discard Changes"),
- gettext("Are you sure you want to discard changes and revert to the last published version?"),
+ gettext("Are you sure you want to revert to the last published version of the unit? You cannot undo this action."),
gettext("Discard Changes"),
function () {
ViewUtils.runOperationShowingMessage(gettext('Discarding Changes…'),
@@ -187,14 +189,14 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
this.checkStaffLock(enableStaffLock);
if (enableStaffLock) {
- ViewUtils.runOperationShowingMessage(gettext('Setting Staff Lock…'),
+ ViewUtils.runOperationShowingMessage(gettext('Hiding Unit from Students…'),
_.bind(saveAndPublishStaffLock, self));
} else {
- ViewUtils.confirmThenRunOperation(gettext("Remove Staff Lock"),
- gettext("Are you sure you want to remove the staff lock? Once you publish this unit, it will be released to students on the release date."),
- gettext("Remove Staff Lock"),
+ ViewUtils.confirmThenRunOperation(gettext("Make Visible to Students"),
+ gettext("If you make this unit visible to students, students will be able to see its content after the release date has passed and you have published the unit. Do you want to proceed?"),
+ gettext("Make Visible to Students"),
function() {
- ViewUtils.runOperationShowingMessage(gettext('Removing Staff Lock…'),
+ ViewUtils.runOperationShowingMessage(gettext('Making Visible to Students…'),
_.bind(saveAndPublishStaffLock, self));
},
function() {
diff --git a/cms/static/js/views/xblock_outline.js b/cms/static/js/views/xblock_outline.js
index c63eb3d66b..7f0a86b827 100644
--- a/cms/static/js/views/xblock_outline.js
+++ b/cms/static/js/views/xblock_outline.js
@@ -55,6 +55,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
childInfo = xblockInfo.get('child_info'),
parentInfo = this.parentInfo,
xblockType = this.getXBlockType(this.model.get('category'), this.parentInfo),
+ xblockTypeDisplayName = this.getXBlockType(this.model.get('category'), this.parentInfo, true),
parentType = parentInfo ? this.getXBlockType(parentInfo.get('category')) : null,
addChildName = null,
defaultNewChildName = null,
@@ -72,6 +73,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
typeListClass: XBlockViewUtils.getXBlockListTypeClass(xblockType),
parentInfo: this.parentInfo,
xblockType: xblockType,
+ xblockTypeDisplayName: xblockTypeDisplayName,
parentType: parentType,
childType: childInfo ? this.getXBlockType(childInfo.category, xblockInfo) : null,
childCategory: childInfo ? childInfo.category : null,
diff --git a/cms/templates/container.html b/cms/templates/container.html
index 3cc167da39..d6825fa1aa 100644
--- a/cms/templates/container.html
+++ b/cms/templates/container.html
@@ -88,7 +88,7 @@ templates = ["basic-modal", "modal-button", "edit-xblock-modal",
% if is_unit_page:
- ${_("View Published Version")}
+ ${_("View Live Version")}
@@ -139,7 +139,7 @@ templates = ["basic-modal", "modal-button", "edit-xblock-modal",
${_("Location ID")}
${unit.location.name}
- Tip: ${_("Use this ID to link to this unit from other places in your course")}
+ Tip: ${_("Use this ID when you create links to this unit from other course content. You enter the ID in the URL field.")}
diff --git a/cms/templates/course_outline.html b/cms/templates/course_outline.html
index e7c7b0c26a..8940d18bcf 100644
--- a/cms/templates/course_outline.html
+++ b/cms/templates/course_outline.html
@@ -48,7 +48,7 @@ from contentstore.utils import reverse_usage_url
${_("Page Actions")}
diff --git a/cms/templates/js/container-message.underscore b/cms/templates/js/container-message.underscore
index b47fa39578..508bde2a11 100644
--- a/cms/templates/js/container-message.underscore
+++ b/cms/templates/js/container-message.underscore
@@ -2,7 +2,11 @@
- <%= gettext("This content is live for students. Edit with caution.") %>
+ <% if (hasChanges) { %>
+ <%= gettext("Caution: The last published version of this unit is live. By publishing changes you will change the student experience.") %>
+ <% } else { %>
+ <%= gettext("This unit is visible to students. If you edit the unit, you must re-publish it for students to see your changes.") %>
+ <% } %>
<% } %>
diff --git a/cms/templates/js/course-outline.underscore b/cms/templates/js/course-outline.underscore
index ea2166880c..e2f9e771cd 100644
--- a/cms/templates/js/course-outline.underscore
+++ b/cms/templates/js/course-outline.underscore
@@ -39,7 +39,8 @@ if (statusType === 'warning') {