From 170694e58016220dbbfe10855345836f8c271546 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 17 Oct 2012 10:31:18 -0400 Subject: [PATCH 1/2] fix/cdodge/asset-upload-tweeks --- cms/djangoapps/contentstore/utils.py | 3 ++- cms/djangoapps/contentstore/views.py | 2 +- cms/static/js/base.js | 4 +++- cms/templates/asset_index.html | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 582123b78f..4889506bd8 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -76,5 +76,6 @@ def compute_unit_state(unit): return UnitState.public -def get_date_display(date): +def get_date_display(date, convertToLocalTime=False): + print date.__class__.__name__ return date.strftime("%d %B, %Y at %I:%M %p") diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index d95322f2f8..64f301e1fc 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -872,7 +872,7 @@ def asset_index(request, org, course, name): id = asset['_id'] display_info = {} display_info['displayname'] = asset['displayname'] - display_info['uploadDate'] = get_date_display(asset['uploadDate']) + display_info['uploadDate'] = get_date_display(asset['uploadDate'], True) asset_location = StaticContent.compute_location(id['org'], id['course'], id['name']) display_info['url'] = StaticContent.get_url_path_from_location(asset_location) diff --git a/cms/static/js/base.js b/cms/static/js/base.js index 787cd2f524..867f81e973 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -321,7 +321,7 @@ function startUpload(e) { function resetUploadBar(){ var percentVal = '0%'; - $('.upload-modal .progress-fill').width(percentVal) + $('.upload-modal .progress-fill').width(percentVal); $('.upload-modal .progress-fill').html(percentVal); } @@ -338,6 +338,7 @@ function displayFinishedUpload(xhr) { $('.upload-modal .copy-button').attr('href', xhr.getResponseHeader('asset_url')); $('.upload-modal .progress-fill').html(xhr.responseText); $('.upload-modal .choose-file-button').html('Load Another File').show(); + $('.upload-modal .progress-fill').width('100%'); } function markAsLoaded() { @@ -349,6 +350,7 @@ function hideModal(e) { e.preventDefault(); $('.modal').hide(); $modalCover.hide(); + location.reload(); } function onKeyUp(e) { diff --git a/cms/templates/asset_index.html b/cms/templates/asset_index.html index 1b3ffb6d5d..1d093c1365 100644 --- a/cms/templates/asset_index.html +++ b/cms/templates/asset_index.html @@ -1,7 +1,7 @@ <%inherit file="base.html" /> <%! from django.core.urlresolvers import reverse %> <%block name="bodyclass">assets -<%block name="title">CMS Courseware Overview +<%block name="title">Courseware Assets <%block name="content"> From 5964ecc70c164ba1023bd413c8e643ee703bab8f Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 17 Oct 2012 10:34:23 -0400 Subject: [PATCH 2/2] remove work in progress regarding convert datetime to localtime --- cms/djangoapps/contentstore/utils.py | 3 +-- cms/djangoapps/contentstore/views.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 4889506bd8..582123b78f 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -76,6 +76,5 @@ def compute_unit_state(unit): return UnitState.public -def get_date_display(date, convertToLocalTime=False): - print date.__class__.__name__ +def get_date_display(date): return date.strftime("%d %B, %Y at %I:%M %p") diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 64f301e1fc..d95322f2f8 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -872,7 +872,7 @@ def asset_index(request, org, course, name): id = asset['_id'] display_info = {} display_info['displayname'] = asset['displayname'] - display_info['uploadDate'] = get_date_display(asset['uploadDate'], True) + 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)