Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0b067126
Commit
0b067126
authored
Aug 05, 2014
by
Ben McMorran
Committed by
cahrens
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove specific wording for live content warning
parent
e4635aaa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
31 deletions
+12
-31
cms/static/js/spec/views/pages/container_subviews_spec.js
+8
-21
cms/static/js/views/pages/container_subviews.js
+2
-3
cms/templates/js/container-message.underscore
+1
-5
common/test/acceptance/pages/studio/container.py
+1
-2
No files found.
cms/static/js/spec/views/pages/container_subviews_spec.js
View file @
0b067126
...
...
@@ -519,37 +519,25 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
describe
(
"Message Area"
,
function
()
{
var
messageSelector
=
'.container-message .warning'
,
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.'
;
warningMessage
=
'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
,
has_changes
:
false
currently_visible_to_students
:
false
});
expect
(
containerPage
.
$
(
messageSelector
).
text
().
trim
()).
toBe
(
''
);
});
it
(
'shows a message for a unit that is currently visible to students
and is unchanged
'
,
function
()
{
it
(
'shows a message for a unit that is currently visible to students'
,
function
()
{
renderContainerPage
(
this
,
mockContainerXBlockHtml
,
{
currently_visible_to_students
:
true
,
has_changes
:
false
currently_visible_to_students
:
true
});
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
);
expect
(
containerPage
.
$
(
messageSelector
).
text
().
trim
()).
toBe
(
warningMessage
);
});
it
(
'hides the message when the unit is hidden from students'
,
function
()
{
renderContainerPage
(
this
,
mockContainerXBlockHtml
,
{
currently_visible_to_students
:
true
,
has_changes
:
false
currently_visible_to_students
:
true
});
fetch
({
currently_visible_to_students
:
false
});
expect
(
containerPage
.
$
(
messageSelector
).
text
().
trim
()).
toBe
(
''
);
...
...
@@ -557,11 +545,10 @@ 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
,
has_changes
:
false
currently_visible_to_students
:
false
});
fetch
({
currently_visible_to_students
:
true
});
expect
(
containerPage
.
$
(
messageSelector
).
text
().
trim
()).
toBe
(
unchangedW
arningMessage
);
expect
(
containerPage
.
$
(
messageSelector
).
text
().
trim
()).
toBe
(
w
arningMessage
);
});
});
});
...
...
cms/static/js/views/pages/container_subviews.js
View file @
0b067126
...
...
@@ -38,13 +38,12 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
},
shouldRefresh
:
function
(
model
)
{
return
ViewUtils
.
hasChangedAttributes
(
model
,
[
'currently_visible_to_students'
,
'has_changes'
]);
return
ViewUtils
.
hasChangedAttributes
(
model
,
[
'currently_visible_to_students'
]);
},
render
:
function
()
{
this
.
$el
.
html
(
this
.
template
({
currentlyVisibleToStudents
:
this
.
model
.
get
(
'currently_visible_to_students'
),
hasChanges
:
this
.
model
.
get
(
'has_changes'
)
currentlyVisibleToStudents
:
this
.
model
.
get
(
'currently_visible_to_students'
)
}));
return
this
;
}
...
...
cms/templates/js/container-message.underscore
View file @
0b067126
...
...
@@ -2,11 +2,7 @@
<div class="message has-warnings">
<p class="warning">
<i class="icon-warning-sign"></i>
<% 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.") %>
<% } %>
<%= gettext("Caution: The last published version of this unit is live. By publishing changes you will change the student experience.") %>
</p>
</div>
<% } %>
common/test/acceptance/pages/studio/container.py
View file @
0b067126
...
...
@@ -122,8 +122,7 @@ class ContainerPage(PageObject):
if
not
warnings
.
is_present
():
return
False
warning_text
=
warnings
.
first
.
text
[
0
]
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."
)
return
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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment