Commit 0bd5446f by Lyla Fischer Committed by Calen Pennington

fixed date display

parent 115d7358
...@@ -74,3 +74,8 @@ def compute_unit_state(unit): ...@@ -74,3 +74,8 @@ def compute_unit_state(unit):
return UnitState.private return UnitState.private
else: else:
return UnitState.public return UnitState.public
def get_date_display(date):
print date, type(date)
return date.strftime("%d %B, %Y at %I:%M %p")
import traceback
from util.json_request import expect_json from util.json_request import expect_json
import exceptions import exceptions
import json import json
...@@ -44,7 +45,7 @@ from cache_toolbox.core import set_cached_content, get_cached_content, del_cache ...@@ -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 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 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 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 from xmodule.templates import all_templates
...@@ -669,7 +670,7 @@ def upload_asset(request, org, course, coursename): ...@@ -669,7 +670,7 @@ def upload_asset(request, org, course, coursename):
thumbnail_content = StaticContent(thumbnail_file_location, thumbnail_name, thumbnail_content = StaticContent(thumbnail_file_location, thumbnail_name,
'image/jpeg', thumbnail_file) 'image/jpeg', thumbnail_file)
contentstore().save(thumbnail_content) contentstore().save(thumbnail_content)
# remove any cached content at this location, as thumbnails are treated just like any # remove any cached content at this location, as thumbnails are treated just like any
# other bit of static content # other bit of static content
del_cached_content(thumbnail_content.location) del_cached_content(thumbnail_content.location)
...@@ -830,7 +831,7 @@ def asset_index(request, org, course, name): ...@@ -830,7 +831,7 @@ def asset_index(request, org, course, name):
id = asset['_id'] id = asset['_id']
display_info = {} display_info = {}
display_info['displayname'] = asset['displayname'] 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']) asset_location = StaticContent.compute_location(id['org'], id['course'], id['name'])
display_info['url'] = StaticContent.get_url_path_from_location(asset_location) display_info['url'] = StaticContent.get_url_path_from_location(asset_location)
......
...@@ -39,23 +39,9 @@ ...@@ -39,23 +39,9 @@
</td> </td>
</tr> </tr>
% endfor % 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> </tbody>
</table> </table>
<nav class="pagination"> <nav class="pagination wip-box">
Page: Page:
<ol class="pages"> <ol class="pages">
<li>1</li> <li>1</li>
......
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