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
2e43d2eb
Commit
2e43d2eb
authored
Oct 13, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't display a broken thumbnail image if a thumbnail is not available
parent
f1517fef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
cms/djangoapps/contentstore/views.py
+3
-3
cms/templates/asset_index.html
+5
-1
No files found.
cms/djangoapps/contentstore/views.py
View file @
2e43d2eb
...
...
@@ -848,9 +848,9 @@ def asset_index(request, org, course, name):
display_info
[
'url'
]
=
StaticContent
.
get_url_path_from_location
(
asset_location
)
# note, due to the schema change we may not have a 'thumbnail_location' in the result set
thumbnail_location
=
Location
(
asset
.
get
(
'thumbnail_location'
,
None
)
)
display_info
[
'thumb_url'
]
=
StaticContent
.
get_url_path_from_location
(
thumbnail_location
)
_thumbnail_location
=
asset
.
get
(
'thumbnail_location'
,
None
)
thumbnail_location
=
Location
(
_thumbnail_location
)
if
_thumbnail_location
is
not
None
else
None
display_info
[
'thumb_url'
]
=
StaticContent
.
get_url_path_from_location
(
thumbnail_location
)
if
thumbnail_location
is
not
None
else
None
asset_display
.
append
(
display_info
)
...
...
cms/templates/asset_index.html
View file @
2e43d2eb
...
...
@@ -26,7 +26,11 @@
% for asset in assets:
<tr>
<td
class=
"thumb-col"
>
<div
class=
"thumb"
><img
src=
"${asset['thumb_url']}"
></div>
<div
class=
"thumb"
>
% if asset['thumb_url'] is not None:
<img
src=
"${asset['thumb_url']}"
>
% endif
</div>
</td>
<td
class=
"name-col"
>
<a
href=
"${asset['url']}"
class=
"filename"
>
${asset['displayname']}
</a>
...
...
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