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
f06c67ef
Commit
f06c67ef
authored
Oct 09, 2012
by
Lyla Fischer
Committed by
Calen Pennington
Oct 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added embeddable links
parent
0bd5446f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
5 deletions
+28
-5
cms/djangoapps/contentstore/views.py
+3
-2
cms/static/js/base.js
+16
-0
cms/static/sass/_assets.scss
+3
-0
cms/templates/asset_index.html
+6
-3
No files found.
cms/djangoapps/contentstore/views.py
View file @
f06c67ef
...
...
@@ -698,8 +698,9 @@ def upload_asset(request, org, course, coursename):
# timestamp populated, but we might as well wait for the first real request to come in
# to re-populate the cache.
del_cached_content
(
content
.
location
)
return
HttpResponse
(
'Upload completed'
)
response
=
HttpResponse
(
'Upload completed'
)
response
[
'asset_url'
]
=
StaticContent
.
get_url_path_from_location
(
file_location
)
return
response
'''
This view will return all CMS users who are editors for the specified course
...
...
cms/static/js/base.js
View file @
f06c67ef
...
...
@@ -23,6 +23,10 @@ $(document).ready(function() {
$modalCover
.
bind
(
'click'
,
hideHistoryModal
);
$
(
'.assets .upload-button'
).
bind
(
'click'
,
showUploadModal
);
$
(
'.upload-modal .close-button'
).
bind
(
'click'
,
hideModal
);
$
(
'a.show-xml'
).
toggle
(
showEmbeddableXML
,
hideEmbeddableXML
);
$
(
'a.copy-button'
).
toggle
(
showEmbeddableXML
,
hideEmbeddableXML
);
$
(
'.unit .item-actions .delete-button'
).
bind
(
'click'
,
deleteUnit
);
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
$
(
'.save-subsection'
).
bind
(
'click'
,
saveSubsection
);
...
...
@@ -72,6 +76,17 @@ function removePolicyMetadata(e) {
_parent_el
.
remove
();
else
_parent_el
.
appendTo
(
"#policy-to-delete"
);
function
showEmbeddableXML
(
e
)
{
$ceiling
=
$
(
this
).
parents
(
'tr'
);
if
(
$ceiling
.
length
===
0
)
$ceiling
=
$
(
this
).
parents
(
'.upload-modal'
);
$ceiling
.
find
(
'.embeddable-xml'
).
html
(
'<img src="'
+
$
(
this
).
attr
(
'href'
)
+
'"/>'
);
}
function
hideEmbeddableXML
(
e
)
{
$ceiling
=
$
(
this
).
parents
(
'tr'
);
console
.
log
(
$ceiling
.
length
)
if
(
$ceiling
.
length
===
0
)
$ceiling
=
$
(
this
).
parents
(
'.upload-modal'
);
$ceiling
.
find
(
'.embeddable-xml'
).
html
(
""
);
}
...
...
@@ -258,6 +273,7 @@ function displayFinishedUpload(xhr) {
if
(
xhr
.
status
=
200
){
markAsLoaded
();
}
$
(
'.upload-modal .copy-button'
).
attr
(
'href'
,
xhr
.
getResponseHeader
(
'asset_url'
));
$
(
'.upload-modal .progress-fill'
).
html
(
xhr
.
responseText
);
$
(
'.upload-modal .choose-file-button'
).
html
(
'Load Another File'
).
show
();
}
...
...
cms/static/sass/_assets.scss
View file @
f06c67ef
...
...
@@ -86,6 +86,9 @@
}
}
}
.show-xml
{
@include
blue-button
;
}
}
.upload-modal
{
...
...
cms/templates/asset_index.html
View file @
f06c67ef
...
...
@@ -30,12 +30,13 @@
</td>
<td
class=
"name-col"
>
<a
href=
"${asset['url']}"
class=
"filename"
>
${asset['displayname']}
</a>
<div
class=
"embeddable-xml"
></div>
</td>
<td
class=
"date-col"
>
${asset['uploadDate']}
</td>
<td
class=
"embed-col"
>
<a
href=
"${asset['url']}"
>
copy
</a>
<a
class=
"show-xml"
href=
"${asset['url']}"
>
XML
</a>
</td>
</tr>
% endfor
...
...
@@ -64,8 +65,10 @@
<div
class=
"progress-bar"
>
<div
class=
"progress-fill"
></div>
</div>
<a
href=
"#"
class=
"copy-button"
>
Copy Embed Link
</a>
<form
class=
"file-chooser"
action=
"${upload_asset_callback_url}"
method=
"post"
enctype=
"multipart/form-data"
>
<div
class=
"embeddable-xml"
></div>
<a
href=
"#"
class=
"copy-button"
>
Show Embeddable XML
</a>
<form
class=
"file-chooser"
action=
"${upload_asset_callback_url}"
method=
"post"
enctype=
"multipart/form-data"
>
<a
href=
"#"
class=
"choose-file-button"
>
Choose File
</a>
<input
type=
"file"
class=
"file-input"
name=
"file"
>
</form>
...
...
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