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
63786822
Commit
63786822
authored
Oct 05, 2012
by
Lyla Fischer
Committed by
Calen Pennington
Oct 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thumnail image is a thumnail image
parent
83eeb196
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
cms/djangoapps/contentstore/views.py
+8
-3
cms/templates/asset_index.html
+1
-1
cms/urls.py
+1
-1
No files found.
cms/djangoapps/contentstore/views.py
View file @
63786822
...
...
@@ -822,12 +822,17 @@ def asset_index(request, org, course, name):
display_info
=
{}
display_info
[
'displayname'
]
=
asset
[
'displayname'
]
display_info
[
'uploadDate'
]
=
asset
[
'uploadDate'
]
contentstore_reference
=
StaticContent
.
compute_location
(
id
[
'org'
],
id
[
'course'
],
id
[
'name'
])
display_info
[
'url'
]
=
StaticContent
.
get_url_path_from_location
(
contentstore_reference
)
asset_location
=
StaticContent
.
compute_location
(
id
[
'org'
],
id
[
'course'
],
id
[
'name'
])
display_info
[
'url'
]
=
StaticContent
.
get_url_path_from_location
(
asset_location
)
thumbnail_name
=
contentstore
()
.
find
(
asset_location
)
.
generate_thumbnail_name
()
thumbnail_location
=
StaticContent
.
compute_location
(
id
[
'org'
],
id
[
'course'
],
thumbnail_name
)
display_info
[
'thumb_url'
]
=
StaticContent
.
get_url_path_from_location
(
thumbnail_location
)
asset_display
.
append
(
display_info
)
print
assets
[
0
]
return
render_to_response
(
'asset_index.html'
,
{
'assets'
:
asset_display
,
'upload_asset_callback_url'
:
upload_asset_callback_url
...
...
cms/templates/asset_index.html
View file @
63786822
...
...
@@ -26,7 +26,7 @@
% for asset in assets:
<tr>
<td
class=
"thumb-col"
>
<div
class=
"thumb"
><img
src=
"${asset['url']}"
></div>
<div
class=
"thumb"
><img
src=
"${asset['
thumb_
url']}"
></div>
</td>
<td
class=
"name-col"
>
<a
href=
"${asset['url']}"
class=
"filename"
>
${asset['displayname']}
</a>
...
...
cms/urls.py
View file @
63786822
...
...
@@ -30,9 +30,9 @@ urlpatterns = ('',
'contentstore.views.remove_user'
,
name
=
'remove_user'
),
url
(
r'^(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<name>[^/]+)/remove_user$'
,
'contentstore.views.remove_user'
,
name
=
'remove_user'
),
url
(
r'^assets/(?P<location>.*?)$'
,
'contentstore.views.asset_index'
,
name
=
'asset_index'
),
url
(
r'^pages/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$'
,
'contentstore.views.static_pages'
,
name
=
'static_pages'
),
url
(
r'^edit_static/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$'
,
'contentstore.views.edit_static'
,
name
=
'edit_static'
),
url
(
r'^(?P<org>[^/]+)/(?P<course>[^/]+)/assets/(?P<name>[^/]+)$'
,
'contentstore.views.asset_index'
,
name
=
'asset_index'
),
# temporary landing page for a course
url
(
r'^landing/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$'
,
'contentstore.views.landing'
,
name
=
'landing'
),
...
...
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