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