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
0cf42edc
Commit
0cf42edc
authored
Aug 02, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #552 from edx/peter-fogg/course-update-notifications
Notifications for course updates.
parents
042b7d5f
1ebedc9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
26 deletions
+69
-26
cms/djangoapps/contentstore/features/course-updates.feature
+6
-2
cms/djangoapps/contentstore/features/section.py
+2
-2
cms/static/js/views/course_info_edit.js
+61
-22
No files found.
cms/djangoapps/contentstore/features/course-updates.feature
View file @
0cf42edc
...
@@ -6,6 +6,7 @@ Feature: Course updates
...
@@ -6,6 +6,7 @@ Feature: Course updates
And
I go to the course updates page
And
I go to the course updates page
When
I add a new update with the text
"Hello"
When
I add a new update with the text
"Hello"
Then
I should see the update
"Hello"
Then
I should see the update
"Hello"
And
I see a
"saving"
notification
Scenario
:
Users can edit updates
Scenario
:
Users can edit updates
Given
I have opened a new course in Studio
Given
I have opened a new course in Studio
...
@@ -13,15 +14,16 @@ Feature: Course updates
...
@@ -13,15 +14,16 @@ Feature: Course updates
When
I add a new update with the text
"Hello"
When
I add a new update with the text
"Hello"
And
I modify the text to
"Goodbye"
And
I modify the text to
"Goodbye"
Then
I should see the update
"Goodbye"
Then
I should see the update
"Goodbye"
And
I see a
"saving"
notification
Scenario
:
Users can delete updates
Scenario
:
Users can delete updates
Given
I have opened a new course in Studio
Given
I have opened a new course in Studio
And
I go to the course updates page
And
I go to the course updates page
And
I add a new update with the text
"Hello"
And
I add a new update with the text
"Hello"
When
I will confirm all alerts
And
I delete the update
And
I delete the update
And
I confirm the prompt
Then
I should not see the update
"Hello"
Then
I should not see the update
"Hello"
And
I see a
"deleting"
notification
Scenario
:
Users can edit update dates
Scenario
:
Users can edit update dates
Given
I have opened a new course in Studio
Given
I have opened a new course in Studio
...
@@ -29,9 +31,11 @@ Feature: Course updates
...
@@ -29,9 +31,11 @@ Feature: Course updates
And
I add a new update with the text
"Hello"
And
I add a new update with the text
"Hello"
When
I edit the date to
"June 1, 2013"
When
I edit the date to
"June 1, 2013"
Then
I should see the date
"June 1, 2013"
Then
I should see the date
"June 1, 2013"
And
I see a
"saving"
notification
Scenario
:
Users can change handouts
Scenario
:
Users can change handouts
Given
I have opened a new course in Studio
Given
I have opened a new course in Studio
And
I go to the course updates page
And
I go to the course updates page
When
I modify the handout to
"<ol>Test</ol>"
When
I modify the handout to
"<ol>Test</ol>"
Then
I see the handout
"Test"
Then
I see the handout
"Test"
And
I see a
"saving"
notification
cms/djangoapps/contentstore/features/section.py
View file @
0cf42edc
...
@@ -42,8 +42,8 @@ def i_save_a_new_section_release_date(_step):
...
@@ -42,8 +42,8 @@ def i_save_a_new_section_release_date(_step):
world
.
browser
.
click_link_by_text
(
'Save'
)
world
.
browser
.
click_link_by_text
(
'Save'
)
@step
(
'I see a "
saving
" notification'
)
@step
(
'I see a "
(saving|deleting)
" notification'
)
def
i_see_a_
saving_notification
(
step
):
def
i_see_a_
mini_notification
(
_step
,
_type
):
saving_css
=
'.wrapper-notification-mini'
saving_css
=
'.wrapper-notification-mini'
assert
world
.
is_css_present
(
saving_css
)
assert
world
.
is_css_present
(
saving_css
)
...
...
cms/static/js/views/course_info_edit.js
View file @
0cf42edc
...
@@ -97,7 +97,19 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
...
@@ -97,7 +97,19 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
var
targetModel
=
this
.
eventModel
(
event
);
var
targetModel
=
this
.
eventModel
(
event
);
targetModel
.
set
({
date
:
this
.
dateEntry
(
event
).
val
(),
content
:
this
.
$codeMirror
.
getValue
()
});
targetModel
.
set
({
date
:
this
.
dateEntry
(
event
).
val
(),
content
:
this
.
$codeMirror
.
getValue
()
});
// push change to display, hide the editor, submit the change
// push change to display, hide the editor, submit the change
targetModel
.
save
({});
var
saving
=
new
CMS
.
Views
.
Notification
.
Mini
({
title
:
gettext
(
'Saving'
)
+
'…'
});
saving
.
show
();
var
ele
=
this
.
modelDom
(
event
);
targetModel
.
save
({},
{
success
:
function
()
{
saving
.
hide
();
},
error
:
function
()
{
ele
.
remove
();
}
});
this
.
closeEditor
(
this
);
this
.
closeEditor
(
this
);
analytics
.
track
(
'Saved Course Update'
,
{
analytics
.
track
(
'Saved Course Update'
,
{
...
@@ -140,29 +152,48 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
...
@@ -140,29 +152,48 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
onDelete
:
function
(
event
)
{
onDelete
:
function
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
if
(
!
confirm
(
'Are you sure you want to delete this update? This action cannot be undone.'
))
{
var
self
=
this
;
return
;
}
analytics
.
track
(
'Deleted Course Update'
,
{
'course'
:
course_location_analytics
,
'date'
:
this
.
dateEntry
(
event
).
val
()
});
var
targetModel
=
this
.
eventModel
(
event
);
var
targetModel
=
this
.
eventModel
(
event
);
this
.
modelDom
(
event
).
remove
();
var
confirm
=
new
CMS
.
Views
.
Prompt
.
Warning
({
var
cacheThis
=
this
;
title
:
gettext
(
'Are you sure you want to delete this update?'
),
targetModel
.
destroy
({
message
:
gettext
(
'This action cannot be undone.'
),
success
:
function
(
model
,
response
)
{
actions
:
{
cacheThis
.
collection
.
fetch
({
primary
:
{
success
:
function
()
{
text
:
gettext
(
'OK'
),
cacheThis
.
render
();
click
:
function
()
{
},
analytics
.
track
(
'Deleted Course Update'
,
{
reset
:
true
'course'
:
course_location_analytics
,
});
'date'
:
self
.
dateEntry
(
event
).
val
()
});
self
.
modelDom
(
event
).
remove
();
var
deleting
=
new
CMS
.
Views
.
Notification
.
Mini
({
title
:
gettext
(
'Deleting'
)
+
'…'
});
deleting
.
show
();
targetModel
.
destroy
({
success
:
function
(
model
,
response
)
{
self
.
collection
.
fetch
({
success
:
function
()
{
self
.
render
();
deleting
.
hide
();
},
reset
:
true
});
}
});
confirm
.
hide
();
}
},
secondary
:
{
text
:
gettext
(
'Cancel'
),
click
:
function
()
{
confirm
.
hide
();
}
}
}
}
});
});
},
confirm
.
show
();
},
closeEditor
:
function
(
self
,
removePost
)
{
closeEditor
:
function
(
self
,
removePost
)
{
var
targetModel
=
self
.
collection
.
get
(
self
.
$currentPost
.
attr
(
'name'
));
var
targetModel
=
self
.
collection
.
get
(
self
.
$currentPost
.
attr
(
'name'
));
...
@@ -280,7 +311,15 @@ CMS.Views.ClassInfoHandoutsView = Backbone.View.extend({
...
@@ -280,7 +311,15 @@ CMS.Views.ClassInfoHandoutsView = Backbone.View.extend({
onSave
:
function
(
event
)
{
onSave
:
function
(
event
)
{
this
.
model
.
set
(
'data'
,
this
.
$codeMirror
.
getValue
());
this
.
model
.
set
(
'data'
,
this
.
$codeMirror
.
getValue
());
this
.
render
();
this
.
render
();
this
.
model
.
save
({});
var
saving
=
new
CMS
.
Views
.
Notification
.
Mini
({
title
:
gettext
(
'Saving'
)
+
'…'
});
saving
.
show
();
this
.
model
.
save
({},
{
success
:
function
()
{
saving
.
hide
();
}
});
this
.
$form
.
hide
();
this
.
$form
.
hide
();
this
.
closeEditor
(
this
);
this
.
closeEditor
(
this
);
...
...
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