fixed date display
This commit is contained in:
committed by
Calen Pennington
parent
115d7358fa
commit
0bd5446f80
@@ -74,3 +74,8 @@ def compute_unit_state(unit):
|
||||
return UnitState.private
|
||||
else:
|
||||
return UnitState.public
|
||||
|
||||
|
||||
def get_date_display(date):
|
||||
print date, type(date)
|
||||
return date.strftime("%d %B, %Y at %I:%M %p")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import traceback
|
||||
from util.json_request import expect_json
|
||||
import exceptions
|
||||
import json
|
||||
@@ -44,7 +45,7 @@ from cache_toolbox.core import set_cached_content, get_cached_content, del_cache
|
||||
from auth.authz import is_user_in_course_group_role, get_users_in_course_group_by_role
|
||||
from auth.authz import get_user_by_email, add_user_to_course_group, remove_user_from_course_group
|
||||
from auth.authz import INSTRUCTOR_ROLE_NAME, STAFF_ROLE_NAME
|
||||
from .utils import get_course_location_for_item, get_lms_link_for_item, compute_unit_state
|
||||
from .utils import get_course_location_for_item, get_lms_link_for_item, compute_unit_state, get_date_display
|
||||
|
||||
from xmodule.templates import all_templates
|
||||
|
||||
@@ -669,7 +670,7 @@ def upload_asset(request, org, course, coursename):
|
||||
thumbnail_content = StaticContent(thumbnail_file_location, thumbnail_name,
|
||||
'image/jpeg', thumbnail_file)
|
||||
contentstore().save(thumbnail_content)
|
||||
|
||||
|
||||
# remove any cached content at this location, as thumbnails are treated just like any
|
||||
# other bit of static content
|
||||
del_cached_content(thumbnail_content.location)
|
||||
@@ -830,7 +831,7 @@ def asset_index(request, org, course, name):
|
||||
id = asset['_id']
|
||||
display_info = {}
|
||||
display_info['displayname'] = asset['displayname']
|
||||
display_info['uploadDate'] = asset['uploadDate']
|
||||
display_info['uploadDate'] = get_date_display(asset['uploadDate'])
|
||||
|
||||
asset_location = StaticContent.compute_location(id['org'], id['course'], id['name'])
|
||||
display_info['url'] = StaticContent.get_url_path_from_location(asset_location)
|
||||
|
||||
@@ -39,23 +39,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
% endfor
|
||||
<tr>
|
||||
<td class="thumb-col">
|
||||
<div class="thumb"><img src="http://dribbble.s3.amazonaws.com/users/4573/screenshots/157708/final.png"></div>
|
||||
</td>
|
||||
<td class="name-col">
|
||||
<a href="#" class="filename">raygun-2.jpg</a>
|
||||
</td>
|
||||
<td class="date-col">
|
||||
10/2/2012
|
||||
</td>
|
||||
<td class="embed-col">
|
||||
<a href="#">copy</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<nav class="pagination">
|
||||
<nav class="pagination wip-box">
|
||||
Page:
|
||||
<ol class="pages">
|
||||
<li>1</li>
|
||||
|
||||
Reference in New Issue
Block a user