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
0bd5446f
Commit
0bd5446f
authored
Oct 09, 2012
by
Lyla Fischer
Committed by
Calen Pennington
Oct 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed date display
parent
115d7358
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
18 deletions
+10
-18
cms/djangoapps/contentstore/utils.py
+5
-0
cms/djangoapps/contentstore/views.py
+4
-3
cms/templates/asset_index.html
+1
-15
No files found.
cms/djangoapps/contentstore/utils.py
View file @
0bd5446f
...
...
@@ -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"
)
cms/djangoapps/contentstore/views.py
View file @
0bd5446f
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
)
...
...
cms/templates/asset_index.html
View file @
0bd5446f
...
...
@@ -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>
...
...
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