Commit d514f363 by Ben McMorran Committed by cahrens

Integrate UI text strings from doc

STUD-1856

Display "IS VISIBLE TO" when released and published

Reword staff lock prompt and notifications

Change "View Published Version" to "View Live Version"

Change "Unit Tree Location" to "Unit Location in Course"

Switch live content warning based on unpublished changes

Reword discard changes confirmation prompt

Reword unit location tip

Add "Edit the name" popup text for sections and subsections

Fix popup text for section and subsection titles

Add popup text for new section, subsection, and unit buttons

Reword popup for View Live button and add tests

Reword notification when removing staff lock

Update MessageView when has_changes changed

Change "Published" to "Published (not yet released)"

Change "Unpublished (Staff only)" to "Visible to Staff Only"
parent d7f75778
......@@ -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({
......
......@@ -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,
has_changes: false
});
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
currently_visible_to_students: true,
has_changes: true
});
expect(containerPage.$(messageSelector).text().trim()).toBe(warningMessage);
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);
});
});
});
......
......@@ -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() {
......
......@@ -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,
......
......@@ -88,7 +88,7 @@ templates = ["basic-modal", "modal-button", "edit-xblock-modal",
% if is_unit_page:
<li class="action-item action-view nav-item">
<a href="${published_preview_link}" class="button button-view action-button is-disabled">
<span class="action-button-text">${_("View Published Version")}</span>
<span class="action-button-text">${_("View Live Version")}</span>
</a>
</li>
<li class="action-item action-preview nav-item">
......@@ -139,7 +139,7 @@ templates = ["basic-modal", "modal-button", "edit-xblock-modal",
<h5 class="title">${_("Location ID")}</h5>
<p class="unit-id">
<span class="unit-id-value" id="unit-location-id-input">${unit.location.name}</span>
<span class="tip"><span class="sr">Tip: </span>${_("Use this ID to link to this unit from other places in your course")}</span>
<span class="tip"><span class="sr">Tip: </span>${_("Use this ID when you create links to this unit from other course content. You enter the ID in the URL field.")}</span>
</p>
</div>
<div class="wrapper-unit-tree-location bar-mod-content">
......
......@@ -48,7 +48,7 @@ from contentstore.utils import reverse_usage_url
<h3 class="sr">${_("Page Actions")}</h3>
<ul>
<li class="nav-item">
<a href="#" class="button button-new" data-category="chapter" data-parent="${context_course.location}" data-default-name="${_('Section')}">
<a href="#" class="button button-new" data-category="chapter" data-parent="${context_course.location}" data-default-name="${_('Section')}" title="${_('Click to add a new section')}">
<i class="icon-plus"></i>${_('New Section')}
</a>
</li>
......@@ -59,7 +59,8 @@ from contentstore.utils import reverse_usage_url
</a>
</li>
<li class="nav-item">
<a href="${lms_link}" rel="external" class="button view-button view-live-button">${_("View Live")}</a>
<a href="${lms_link}" rel="external" class="button view-button view-live-button"
title="${_('Click to open the courseware in the LMS in a new tab')}">${_("View Live")}</a>
</li>
</ul>
</nav>
......
......@@ -2,7 +2,11 @@
<div class="message has-warnings">
<p class="warning">
<i class="icon-warning-sign"></i>
<%= 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.") %>
<% } %>
</p>
</div>
<% } %>
......@@ -39,7 +39,8 @@ if (statusType === 'warning') {
<div class="<%= xblockType %>-header">
<% if (includesChildren) { %>
<h3 class="<%= xblockType %>-header-details expand-collapse <%= isCollapsed ? 'expand' : 'collapse' %> ui-toggle-expansion" title="<%= gettext('Collapse/Expand this Checklist') %>">
<h3 class="<%= xblockType %>-header-details expand-collapse <%= isCollapsed ? 'expand' : 'collapse' %> ui-toggle-expansion"
title="<%= interpolate(gettext('Collapse/Expand this %(xblock_type)s'), { xblock_type: xblockTypeDisplayName }, true) %>">
<i class="icon-caret-down icon"></i>
<% } else { %>
<h3 class="<%= xblockType %>-header-details">
......@@ -129,7 +130,8 @@ if (statusType === 'warning') {
<div class="no-content add-section">
<p><%= gettext("You haven't added any content to this course yet.") %>
<a href="#" class="button button-new" data-category="<%= childCategory %>"
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>">
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>"
title="<%= interpolate(gettext('Click to add a new %(xblock_type)s'), { xblock_type: defaultNewChildName }, true) %>" >
<i class="icon-plus"></i><%= addChildLabel %>
</a>
</p>
......@@ -145,7 +147,8 @@ if (statusType === 'warning') {
<% if (childType) { %>
<div class="add-<%= childType %> add-item">
<a href="#" class="button button-new" data-category="<%= childCategory %>"
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>">
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>"
title="<%= interpolate(gettext('Click to add a new %(xblock_type)s'), { xblock_type: defaultNewChildName }, true) %>" >
<i class="icon icon-plus"></i><%= addChildLabel %>
</a>
</div>
......
......@@ -17,7 +17,7 @@
% if is_unit_page:
<li class="action-item action-view nav-item">
<a href="${published_preview_link}" class="button button-view action-button is-disabled">
<span class="action-button-text">${_("View Published Version")}</span>
<span class="action-button-text">${_("View Live Version")}</span>
</a>
</li>
<li class="action-item action-preview nav-item">
......@@ -60,11 +60,11 @@
<h5 class="title">Unit Location ID</h5>
<p class="unit-id">
<span class="unit-id-value" id="unit-location-id-input">${unit.location.name}</span>
<span class="tip"><span class="sr">Tip: </span>${_("Use this ID to link to this unit from other places in your course")}</span>
<span class="tip"><span class="sr">Tip: </span>${_("Use this ID when you create links to this unit from other course content. You enter the ID in the URL field.")}</span>
</p>
</div>
<div class="wrapper-unit-tree-location bar-mod-content">
<h5 class="title">Unit Tree Location</h5>
<h5 class="title">Location in Course Outline</h5>
<div class="wrapper-unit-overview">
</div>
</div>
......
......@@ -17,12 +17,12 @@
</a>
</li>
<li class="nav-item">
<a href="#" class="button button-new" data-category="chapter" data-parent="mock-course" data-default-name="Section">
<a href="#" class="button button-new" data-category="chapter" data-parent="mock-course" data-default-name="Section" title="Click to add a new section">
<i class="icon-plus"></i>New Section
</a>
</li>
<li class="nav-item">
<a href="#" rel="external" class="button view-button view-live-button" title="This link will open in a new browser window/tab">View Live</a>
<a href="#" rel="external" class="button view-button view-live-button" title="Click to open the courseware in the LMS in a new tab">View Live</a>
</li>
</ul>
</nav>
......@@ -36,7 +36,7 @@
<article class="outline" data-locator="mock-course" data-course-key="slashes:MockCourse">
<div class="no-content add-xblock-component">
<p>You haven't added any content to this course yet.
<a href="#" class="button button-new" data-category="chapter" data-parent="mock-course" data-default-name="Section">
<a href="#" class="button button-new" data-category="chapter" data-parent="mock-course" data-default-name="Section" title="Click to add a new section">
<i class="icon-plus"></i>Add Section
</a>
</p>
......
<%
var title = gettext("Draft (Never published)");
if (visibilityState === 'staff_only') {
title = gettext("Unpublished (Staff only)");
title = gettext("Visible to Staff Only");
} else if (visibilityState === 'live') {
title = gettext("Published and Live");
} else if (published && !hasChanges) {
title = gettext("Published");
title = gettext("Published (not yet released)");
} else if (published && hasChanges) {
title = gettext("Draft (Unpublished changes)");
}
......@@ -57,7 +57,13 @@ var visibleToStaffOnly = visibilityState === 'staff_only';
</div>
<div class="wrapper-visibility bar-mod-content">
<h5 class="title"><%= gettext("Will Be Visible To:") %></h5>
<h5 class="title">
<% if (released && published && !hasChanges) { %>
<%= gettext("Is Visible To:") %>
<% } else { %>
<%= gettext("Will Be Visible To:") %>
<% } %>
</h5>
<% if (visibleToStaffOnly) { %>
<p class="copy"><%= gettext("Staff Only") %></p>
<% } else { %>
......
......@@ -6,7 +6,8 @@
<div class="wrapper-xblock-header">
<div class="wrapper-xblock-header-primary">
<% if (includesChildren) { %>
<h3 class="xblock-title expand-collapse <%= isCollapsed ? 'expand' : 'collapse' %>" title="<%= gettext('Collapse/Expand this Checklist') %>">
<h3 class="xblock-title expand-collapse <%= isCollapsed ? 'expand' : 'collapse' %>"
title="<%= interpolate(gettext('Collapse/Expand this %(xblock_type)s'), { xblock_type: xblockTypeDisplayName }, true) %>">
<i class="icon-caret-down ui-toggle-expansion"></i>
<% } else { %>
<h3 class="xblock-title">
......@@ -52,7 +53,8 @@
<div class="no-content add-xblock-component">
<p><%= gettext("You haven't added any content to this course yet.") %>
<a href="#" class="button button-new" data-category="<%= childCategory %>"
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>">
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>"
title="<%= interpolate(gettext('Click to add a new %(xblock_type)s'), { xblock_type: defaultNewChildName }, true) %>" >
<i class="icon-plus"></i><%= addChildLabel %>
</a>
</p>
......@@ -64,7 +66,8 @@
<% if (childType) { %>
<div class="add-xblock-component">
<a href="#" class="button button-new" data-category="<%= childCategory %>"
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>">
data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>"
title="<%= interpolate(gettext('Click to add a new %(xblock_type)s'), { xblock_type: defaultNewChildName }, true) %>" >
<i class="icon-plus"></i><%= addChildLabel %>
</a>
</div>
......
<div class="incontext-editor-action-wrapper"><a href="" class="action-edit action-inline xblock-field-value-edit incontext-editor-open-action"><i class="icon-pencil"></i><span class="sr"> <%= gettext("Edit") %></span></a></div>
<div class="incontext-editor-action-wrapper">
<a href="" class="action-edit action-inline xblock-field-value-edit incontext-editor-open-action" title="<%= gettext('Edit the name') %>">
<i class="icon-pencil"></i><span class="sr"> <%= gettext("Edit") %></span>
</a>
</div>
<div class="xblock-string-field-editor incontext-editor-form">
<form>
<% var formLabel = gettext("Edit %(display_name)s (required)"); %>
<label><span class="sr"><%= interpolate(formLabel, {display_name: fieldDisplayName}, true) %></span>
<input type="text" value="<%= value %>" class="xblock-field-input incontext-editor-input" data-metadata-name="<%= fieldName %>">
<input type="text" value="<%= value %>" class="xblock-field-input incontext-editor-input" data-metadata-name="<%= fieldName %>" title="<%= gettext('Edit the name') %>">
</label>
<button class="sr action action-primary" name="submit" type="submit"><%= gettext("Save") %></button>
<button class="sr action action-secondary" name="cancel" type="button"><%= gettext("Cancel") %></button>
......
......@@ -122,7 +122,8 @@ class ContainerPage(PageObject):
if not warnings.is_present():
return False
warning_text = warnings.first.text[0]
return warning_text == "This content is live for students. Edit with caution."
return (warning_text == "This unit is visible to students. If you edit the unit, you must re-publish it for students to see your changes."
or warning_text == "Caution: The last published version of this unit is live. By publishing changes you will change the student experience.")
@property
def publish_action(self):
......@@ -161,7 +162,7 @@ class ContainerPage(PageObject):
def view_published_version(self):
"""
Clicks "View Published Version", which will open the published version of the unit page in the LMS.
Clicks "View Live Version", which will open the published version of the unit page in the LMS.
Switches the browser to the newly opened LMS window.
"""
......
......@@ -379,10 +379,10 @@ class UnitPublishingTest(ContainerBase):
"""
__test__ = True
PUBLISHED_STATUS = "Publishing Status\nPublished"
PUBLISHED_STATUS = "Publishing Status\nPublished (not yet released)"
PUBLISHED_LIVE_STATUS = "Publishing Status\nPublished and Live"
DRAFT_STATUS = "Publishing Status\nDraft (Unpublished changes)"
LOCKED_STATUS = "Publishing Status\nUnpublished (Staff only)"
LOCKED_STATUS = "Publishing Status\nVisible to Staff Only"
RELEASE_TITLE_RELEASED = "RELEASED:"
RELEASE_TITLE_RELEASE = "RELEASE:"
......@@ -673,11 +673,11 @@ class UnitPublishingTest(ContainerBase):
Scenario: The publish title displays correctly for units that are not live
Given I have a published unit with no unpublished changes that releases in the future
When I go to the unit page in Studio
Then the title in the Publish information box is "Published"
Then the title in the Publish information box is "Published (not yet released)"
And when I add a component to the unit
Then the title in the Publish information box is "Draft (Unpublished changes)"
And when I click the Publish button
Then the title in the Publish information box is "Published"
Then the title in the Publish information box is "Published (not yet released)"
"""
unit = self.go_to_unit_page('Unreleased Section', 'Unreleased Subsection', 'Unreleased Unit')
self._verify_publish_title(unit, self.PUBLISHED_STATUS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment