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
ce06e7f7
Commit
ce06e7f7
authored
Jul 29, 2014
by
Ben McMorran
Committed by
cahrens
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix delete messages in course outline
STUD-2019
parent
9d44417c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
cms/static/js/views/utils/xblock_utils.js
+11
-5
cms/static/js/views/xblock_outline.js
+6
-5
No files found.
cms/static/js/views/utils/xblock_utils.js
View file @
ce06e7f7
...
...
@@ -67,14 +67,20 @@ define(["jquery", "underscore", "gettext", "js/views/utils/view_utils", "js/util
/**
* Deletes the specified xblock.
* @param xblockInfo The model for the xblock to be deleted.
* @param xblockType A string representing the type of the xblock to be deleted.
* @returns {jQuery promise} A promise representing the deletion of the xblock.
*/
deleteXBlock
=
function
(
xblockInfo
)
{
deleteXBlock
=
function
(
xblockInfo
,
xblockType
)
{
var
deletion
=
$
.
Deferred
(),
url
=
ModuleUtils
.
getUpdateUrl
(
xblockInfo
.
id
);
ViewUtils
.
confirmThenRunOperation
(
gettext
(
'Delete this component?'
),
gettext
(
'Deleting this component is permanent and cannot be undone.'
),
gettext
(
'Yes, delete this component'
),
url
=
ModuleUtils
.
getUpdateUrl
(
xblockInfo
.
id
),
xblockType
=
xblockType
||
gettext
(
'component'
);
ViewUtils
.
confirmThenRunOperation
(
interpolate
(
gettext
(
'Delete this %(xblock_type)s?'
),
{
xblock_type
:
xblockType
},
true
),
interpolate
(
gettext
(
'Deleting this %(xblock_type)s is permanent and cannot be undone.'
),
{
xblock_type
:
xblockType
},
true
),
interpolate
(
gettext
(
'Yes, delete this %(xblock_type)s'
),
{
xblock_type
:
xblockType
},
true
),
function
()
{
ViewUtils
.
runOperationShowingMessage
(
gettext
(
'Deleting…'
),
function
()
{
...
...
cms/static/js/views/xblock_outline.js
View file @
ce06e7f7
...
...
@@ -167,14 +167,14 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
});
},
getXBlockType
:
function
(
category
,
parentInfo
)
{
getXBlockType
:
function
(
category
,
parentInfo
,
translate
)
{
var
xblockType
=
category
;
if
(
category
===
'chapter'
)
{
xblockType
=
'section'
;
xblockType
=
translate
?
gettext
(
'section'
)
:
'section'
;
}
else
if
(
category
===
'sequential'
)
{
xblockType
=
'subsection'
;
xblockType
=
translate
?
gettext
(
'subsection'
)
:
'subsection'
;
}
else
if
(
category
===
'vertical'
&&
(
!
parentInfo
||
parentInfo
.
get
(
'category'
)
===
'sequential'
))
{
xblockType
=
'unit'
;
xblockType
=
translate
?
gettext
(
'unit'
)
:
'unit'
;
}
return
xblockType
;
},
...
...
@@ -243,7 +243,8 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
var
self
=
this
,
parentView
=
this
.
parentView
;
event
.
preventDefault
();
XBlockViewUtils
.
deleteXBlock
(
this
.
model
).
done
(
function
()
{
var
xblockType
=
this
.
getXBlockType
(
this
.
model
.
get
(
'category'
),
parentView
.
model
,
true
);
XBlockViewUtils
.
deleteXBlock
(
this
.
model
,
xblockType
).
done
(
function
()
{
if
(
parentView
)
{
parentView
.
onChildDeleted
(
self
,
event
);
}
...
...
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