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
b1daf0b3
Commit
b1daf0b3
authored
Jun 19, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #211 from edx/db/fix-assets-page-notifications
Clean up assets page notifications
parents
24bee17d
687779ba
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
27 deletions
+10
-27
cms/static/js/views/assets.js
+9
-22
cms/static/js/views/feedback.js
+1
-0
cms/templates/asset_index.html
+0
-5
No files found.
cms/static/js/views/assets.js
View file @
b1daf0b3
...
...
@@ -9,7 +9,7 @@ function removeAsset(e){
e
.
preventDefault
();
var
that
=
this
;
var
msg
=
new
CMS
.
Models
.
ConfirmAssetDeleteMessage
({
var
msg
=
new
CMS
.
Views
.
Prompt
.
Confirmation
({
title
:
gettext
(
"Delete File Confirmation"
),
message
:
gettext
(
"Are you sure you wish to delete this item. It cannot be reversed!
\
n
\
nAlso any content that links/refers to this item will no longer work (e.g. broken images and/or links)"
),
actions
:
{
...
...
@@ -17,15 +17,17 @@ function removeAsset(e){
text
:
gettext
(
"OK"
),
click
:
function
(
view
)
{
// call the back-end to actually remove the asset
$
.
post
(
view
.
model
.
get
(
'remove_asset_url'
),
{
'location'
:
view
.
model
.
get
(
'asset_location'
)
},
var
url
=
$
(
'.asset-library'
).
data
(
'remove-asset-callback-url'
);
var
row
=
$
(
that
).
closest
(
'tr'
);
$
.
post
(
url
,
{
'location'
:
row
.
data
(
'id'
)
},
function
()
{
// show the post-commit confirmation
$
(
".wrapper-alert-confirmation"
).
addClass
(
"is-shown"
).
attr
(
'aria-hidden'
,
'false'
);
view
.
model
.
get
(
'row_to_remove'
)
.
remove
();
row
.
remove
();
analytics
.
track
(
'Deleted Asset'
,
{
'course'
:
course_location_analytics
,
'id'
:
view
.
model
.
get
(
'asset_location
'
)
'id'
:
row
.
data
(
'id
'
)
});
}
);
...
...
@@ -38,24 +40,9 @@ function removeAsset(e){
view
.
hide
();
}
}]
},
remove_asset_url
:
$
(
'.asset-library'
).
data
(
'remove-asset-callback-url'
),
asset_location
:
$
(
this
).
closest
(
'tr'
).
data
(
'id'
),
row_to_remove
:
$
(
this
).
closest
(
'tr'
)
});
// workaround for now. We can't spawn multiple instances of the Prompt View
// so for now, a bit of hackery to just make sure we have a single instance
// note: confirm_delete_prompt is in asset_index.html
if
(
confirm_delete_prompt
===
null
)
confirm_delete_prompt
=
new
CMS
.
Views
.
Prompt
({
model
:
msg
});
else
{
confirm_delete_prompt
.
model
=
msg
;
confirm_delete_prompt
.
show
();
}
return
;
});
return
msg
.
show
()
;
}
function
showUploadModal
(
e
)
{
...
...
cms/static/js/views/feedback.js
View file @
b1daf0b3
...
...
@@ -90,6 +90,7 @@ CMS.Views.SystemFeedback = Backbone.View.extend({
var
parent
=
CMS
.
Views
[
_
.
str
.
capitalize
(
this
.
options
.
type
)];
if
(
parent
&&
parent
.
active
&&
parent
.
active
!==
this
)
{
parent
.
active
.
stopListening
();
parent
.
active
.
undelegateEvents
();
}
this
.
$el
.
html
(
this
.
template
(
this
.
options
));
parent
.
active
=
this
;
...
...
cms/templates/asset_index.html
View file @
b1daf0b3
...
...
@@ -8,11 +8,6 @@
<
%
block
name=
"jsextra"
>
<script
src=
"${static.url('js/vendor/mustache.js')}"
></script>
<script
type=
'text/javascript'
>
// we just want a singleton
confirm_delete_prompt
=
null
;
</script>
</
%
block>
<
%
block
name=
"content"
>
...
...
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