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
5cb1b259
Commit
5cb1b259
authored
Aug 23, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #787 from edx/peter-fogg/static-page-delete
Add delete confirmation to static pages.
parents
07d9106c
75b76b37
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
cms/djangoapps/contentstore/features/static-pages.feature
+2
-1
cms/static/coffee/src/views/tabs.coffee
+18
-7
No files found.
cms/djangoapps/contentstore/features/static-pages.feature
View file @
5cb1b259
...
@@ -11,8 +11,9 @@ Feature: Static Pages
...
@@ -11,8 +11,9 @@ Feature: Static Pages
Given
I have opened a new course in Studio
Given
I have opened a new course in Studio
And
I go to the static pages page
And
I go to the static pages page
And
I add a new page
And
I add a new page
When
I will confirm all alerts
And
I
"delete"
the
"Empty"
page
And
I
"delete"
the
"Empty"
page
Then
I am shown a prompt
When
I confirm the prompt
Then
I should not see a
"Empty"
static page
Then
I should not see a
"Empty"
static page
# Safari won't update the name properly
# Safari won't update the name properly
...
...
cms/static/coffee/src/views/tabs.coffee
View file @
5cb1b259
...
@@ -64,20 +64,31 @@ class CMS.Views.TabsEdit extends Backbone.View
...
@@ -64,20 +64,31 @@ class CMS.Views.TabsEdit extends Backbone.View
course
:
course_location_analytics
course
:
course_location_analytics
deleteTab
:
(
event
)
=>
deleteTab
:
(
event
)
=>
if
not
confirm
'Are you sure you want to delete this component? This action cannot be undone.'
confirm
=
new
CMS
.
Views
.
Prompt
.
Warning
return
title
:
gettext
(
'Delete Component Confirmation'
)
message
:
gettext
(
'Are you sure you want to delete this component? This action cannot be undone.'
)
actions
:
primary
:
text
:
gettext
(
"OK"
)
click
:
(
view
)
->
view
.
hide
()
$component
=
$
(
event
.
currentTarget
).
parents
(
'.component'
)
$component
=
$
(
event
.
currentTarget
).
parents
(
'.component'
)
analytics
.
track
"Deleted Static Page"
,
analytics
.
track
"Deleted Static Page"
,
course
:
course_location_analytics
course
:
course_location_analytics
id
:
$component
.
data
(
'id'
)
id
:
$component
.
data
(
'id'
)
deleting
=
new
CMS
.
Views
.
Notification
.
Mini
title
:
gettext
(
'Deleting'
)
+
'…'
deleting
.
show
()
$
.
post
(
'/delete_item'
,
{
$
.
post
(
'/delete_item'
,
{
id
:
$component
.
data
(
'id'
)
id
:
$component
.
data
(
'id'
)
},
=>
},
=>
$component
.
remove
()
$component
.
remove
()
deleting
.
hide
()
)
)
secondary
:
[
text
:
gettext
(
'Cancel'
)
click
:
(
view
)
->
view
.
hide
()
]
confirm
.
show
()
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