Commit 63786822 by Lyla Fischer Committed by Calen Pennington

thumnail image is a thumnail image

parent 83eeb196
......@@ -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
......
......@@ -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>
......
......@@ -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'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment