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
14be4310
Commit
14be4310
authored
Jun 12, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add confirmation step for deleting a textbook
parent
9de2dc51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
16 deletions
+36
-16
cms/templates/textbooks.html
+36
-16
No files found.
cms/templates/textbooks.html
View file @
14be4310
...
@@ -75,7 +75,7 @@ CMS.Views.TextbookShow = Backbone.View.extend({
...
@@ -75,7 +75,7 @@ CMS.Views.TextbookShow = Backbone.View.extend({
tagName
:
"li"
,
tagName
:
"li"
,
events
:
{
events
:
{
"click .edit"
:
"editTextbook"
,
"click .edit"
:
"editTextbook"
,
"click .delete"
:
"
d
elete"
,
"click .delete"
:
"
confirmD
elete"
,
"click .show-chapters"
:
"showChapters"
,
"click .show-chapters"
:
"showChapters"
,
"click .hide-chapters"
:
"hideChapters"
"click .hide-chapters"
:
"hideChapters"
},
},
...
@@ -87,24 +87,44 @@ CMS.Views.TextbookShow = Backbone.View.extend({
...
@@ -87,24 +87,44 @@ CMS.Views.TextbookShow = Backbone.View.extend({
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
this
.
model
.
collection
.
trigger
(
"editOne"
,
this
.
model
);
this
.
model
.
collection
.
trigger
(
"editOne"
,
this
.
model
);
},
},
d
elete
:
function
(
e
)
{
confirmD
elete
:
function
(
e
)
{
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
var
collection
=
this
.
model
.
collection
;
var
textbook
=
this
.
model
,
collection
=
this
.
model
.
collection
;
collection
.
remove
(
this
.
model
);
var
msg
=
new
CMS
.
Models
.
WarningMessage
({
msg
=
new
CMS
.
Models
.
SystemFeedback
({
title
:
_
.
str
.
sprintf
(
gettext
(
"Delete “%s”?"
),
intent
:
"saving"
,
textbook
.
escape
(
'name'
)),
title
:
gettext
(
"Deleting…"
)
message
:
gettext
(
"Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed."
),
});
actions
:
{
notif
=
new
CMS
.
Views
.
Notification
({
primary
:
{
model
:
msg
,
text
:
gettext
(
"Delete"
),
closeIcon
:
false
,
click
:
function
(
view
)
{
minShown
:
1250
view
.
hide
();
});
collection
.
remove
(
textbook
);
collection
.
save
({
var
delmsg
=
new
CMS
.
Models
.
SystemFeedback
({
complete
:
function
()
{
intent
:
"saving"
,
notif
.
hide
();
title
:
gettext
(
"Deleting…"
)
});
var
notif
=
new
CMS
.
Views
.
Notification
({
model
:
delmsg
,
closeIcon
:
false
,
minShown
:
1250
});
collection
.
save
({
complete
:
function
()
{
notif
.
hide
();
}
});
}
},
secondary
:
[{
text
:
gettext
(
"Cancel"
),
click
:
function
(
view
)
{
view
.
hide
();
}
}]
}
}
});
});
var
prompt
=
new
CMS
.
Views
.
Prompt
({
model
:
msg
});
},
},
showChapters
:
function
(
e
)
{
showChapters
:
function
(
e
)
{
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
...
...
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