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
b05ead86
Commit
b05ead86
authored
Jan 31, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Revert "Merge pull request #1374 from MITx/feature/cale/no-course-collectstatic""
This reverts commit
c4f56620
.
parent
82b2dc71
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
25 deletions
+33
-25
cms/djangoapps/contentstore/views.py
+1
-1
common/lib/xmodule/xmodule/capa_module.py
+2
-2
lms/djangoapps/courseware/courses.py
+1
-2
lms/djangoapps/courseware/module_render.py
+8
-2
lms/envs/common.py
+0
-18
lms/envs/dev.py
+21
-0
No files found.
cms/djangoapps/contentstore/views.py
View file @
b05ead86
...
@@ -526,7 +526,7 @@ def load_preview_module(request, preview_id, descriptor, instance_state, shared_
...
@@ -526,7 +526,7 @@ def load_preview_module(request, preview_id, descriptor, instance_state, shared_
module
.
get_html
=
replace_static_urls
(
module
.
get_html
=
replace_static_urls
(
module
.
get_html
,
module
.
get_html
,
module
.
metadata
.
get
(
'data_dir'
,
module
.
location
.
course
),
'/static/'
+
module
.
metadata
.
get
(
'data_dir'
,
module
.
location
.
course
),
course_namespace
=
Location
([
module
.
location
.
tag
,
module
.
location
.
org
,
module
.
location
.
course
,
None
,
None
])
course_namespace
=
Location
([
module
.
location
.
tag
,
module
.
location
.
org
,
module
.
location
.
course
,
None
,
None
])
)
)
save_preview_state
(
request
,
preview_id
,
descriptor
.
location
.
url
(),
save_preview_state
(
request
,
preview_id
,
descriptor
.
location
.
url
(),
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
b05ead86
...
@@ -369,7 +369,7 @@ class CapaModule(XModule):
...
@@ -369,7 +369,7 @@ class CapaModule(XModule):
id
=
self
.
location
.
html_id
(),
ajax_url
=
self
.
system
.
ajax_url
)
+
html
+
"</div>"
id
=
self
.
location
.
html_id
(),
ajax_url
=
self
.
system
.
ajax_url
)
+
html
+
"</div>"
# now do the substitutions which are filesystem based, e.g. '/static/' prefixes
# now do the substitutions which are filesystem based, e.g. '/static/' prefixes
return
self
.
system
.
replace_urls
(
html
,
self
.
metadata
[
'data_dir'
],
course_namespace
=
self
.
location
)
return
self
.
system
.
replace_urls
(
html
)
def
handle_ajax
(
self
,
dispatch
,
get
):
def
handle_ajax
(
self
,
dispatch
,
get
):
'''
'''
...
@@ -490,7 +490,7 @@ class CapaModule(XModule):
...
@@ -490,7 +490,7 @@ class CapaModule(XModule):
new_answers
=
dict
()
new_answers
=
dict
()
for
answer_id
in
answers
:
for
answer_id
in
answers
:
try
:
try
:
new_answer
=
{
answer_id
:
self
.
system
.
replace_urls
(
answers
[
answer_id
]
,
self
.
metadata
[
'data_dir'
],
course_namespace
=
self
.
location
)}
new_answer
=
{
answer_id
:
self
.
system
.
replace_urls
(
answers
[
answer_id
])}
except
TypeError
:
except
TypeError
:
log
.
debug
(
'Unable to perform URL substitution on answers[
%
s]:
%
s'
%
(
answer_id
,
answers
[
answer_id
]))
log
.
debug
(
'Unable to perform URL substitution on answers[
%
s]:
%
s'
%
(
answer_id
,
answers
[
answer_id
]))
new_answer
=
{
answer_id
:
answers
[
answer_id
]}
new_answer
=
{
answer_id
:
answers
[
answer_id
]}
...
...
lms/djangoapps/courseware/courses.py
View file @
b05ead86
...
@@ -88,8 +88,7 @@ def course_image_url(course):
...
@@ -88,8 +88,7 @@ def course_image_url(course):
"""Try to look up the image url for the course. If it's not found,
"""Try to look up the image url for the course. If it's not found,
log an error and return the dead link"""
log an error and return the dead link"""
if
isinstance
(
modulestore
(),
XMLModuleStore
):
if
isinstance
(
modulestore
(),
XMLModuleStore
):
path
=
course
.
metadata
[
'data_dir'
]
+
"/images/course_image.jpg"
return
'/static/'
+
course
.
metadata
[
'data_dir'
]
+
"/images/course_image.jpg"
return
try_staticfiles_lookup
(
path
)
else
:
else
:
loc
=
course
.
location
.
_replace
(
tag
=
'c4x'
,
category
=
'asset'
,
name
=
'images_course_image.jpg'
)
loc
=
course
.
location
.
_replace
(
tag
=
'c4x'
,
category
=
'asset'
,
name
=
'images_course_image.jpg'
)
path
=
StaticContent
.
get_url_path_from_location
(
loc
)
path
=
StaticContent
.
get_url_path_from_location
(
loc
)
...
...
lms/djangoapps/courseware/module_render.py
View file @
b05ead86
...
@@ -3,6 +3,8 @@ import logging
...
@@ -3,6 +3,8 @@ import logging
import
pyparsing
import
pyparsing
import
sys
import
sys
from
functools
import
partial
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -244,7 +246,11 @@ def _get_module(user, request, descriptor, student_module_cache, course_id,
...
@@ -244,7 +246,11 @@ def _get_module(user, request, descriptor, student_module_cache, course_id,
# TODO (cpennington): This should be removed when all html from
# TODO (cpennington): This should be removed when all html from
# a module is coming through get_html and is therefore covered
# a module is coming through get_html and is therefore covered
# by the replace_static_urls code below
# by the replace_static_urls code below
replace_urls
=
replace_urls
,
replace_urls
=
partial
(
replace_urls
,
staticfiles_prefix
=
'/static/'
+
descriptor
.
metadata
.
get
(
'data_dir'
,
''
),
course_namespace
=
descriptor
.
location
.
_replace
(
category
=
None
,
name
=
None
),
),
node_path
=
settings
.
NODE_PATH
,
node_path
=
settings
.
NODE_PATH
,
anonymous_student_id
=
unique_id_for_user
(
user
),
anonymous_student_id
=
unique_id_for_user
(
user
),
course_id
=
course_id
,
course_id
=
course_id
,
...
@@ -280,7 +286,7 @@ def _get_module(user, request, descriptor, student_module_cache, course_id,
...
@@ -280,7 +286,7 @@ def _get_module(user, request, descriptor, student_module_cache, course_id,
module
.
get_html
=
replace_static_urls
(
module
.
get_html
=
replace_static_urls
(
_get_html
,
_get_html
,
module
.
metadata
[
'data_dir'
]
if
'data_dir'
in
module
.
metadata
else
''
,
'/static/'
+
module
.
metadata
.
get
(
'data_dir'
,
''
),
course_namespace
=
module
.
location
.
_replace
(
category
=
None
,
name
=
None
))
course_namespace
=
module
.
location
.
_replace
(
category
=
None
,
name
=
None
))
# Allow URLs of the form '/course/' refer to the root of multicourse directory
# Allow URLs of the form '/course/' refer to the root of multicourse directory
...
...
lms/envs/common.py
View file @
b05ead86
...
@@ -266,24 +266,6 @@ STATICFILES_DIRS = [
...
@@ -266,24 +266,6 @@ STATICFILES_DIRS = [
COMMON_ROOT
/
"static"
,
COMMON_ROOT
/
"static"
,
PROJECT_ROOT
/
"static"
,
PROJECT_ROOT
/
"static"
,
]
]
if
os
.
path
.
isdir
(
DATA_DIR
):
# Add the full course repo if there is no static directory
STATICFILES_DIRS
+=
[
# TODO (cpennington): When courses are stored in a database, this
# should no longer be added to STATICFILES
(
course_dir
,
DATA_DIR
/
course_dir
)
for
course_dir
in
os
.
listdir
(
DATA_DIR
)
if
(
os
.
path
.
isdir
(
DATA_DIR
/
course_dir
)
and
not
os
.
path
.
isdir
(
DATA_DIR
/
course_dir
/
'static'
))
]
# Otherwise, add only the static directory from the course dir
STATICFILES_DIRS
+=
[
# TODO (cpennington): When courses are stored in a database, this
# should no longer be added to STATICFILES
(
course_dir
,
DATA_DIR
/
course_dir
/
'static'
)
for
course_dir
in
os
.
listdir
(
DATA_DIR
)
if
(
os
.
path
.
isdir
(
DATA_DIR
/
course_dir
/
'static'
))
]
# Locale/Internationalization
# Locale/Internationalization
TIME_ZONE
=
'America/New_York'
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
TIME_ZONE
=
'America/New_York'
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
...
...
lms/envs/dev.py
View file @
b05ead86
...
@@ -106,6 +106,27 @@ VIRTUAL_UNIVERSITIES = []
...
@@ -106,6 +106,27 @@ VIRTUAL_UNIVERSITIES = []
COMMENTS_SERVICE_KEY
=
"PUT_YOUR_API_KEY_HERE"
COMMENTS_SERVICE_KEY
=
"PUT_YOUR_API_KEY_HERE"
############################## Course static files ##########################
if
os
.
path
.
isdir
(
DATA_DIR
):
# Add the full course repo if there is no static directory
STATICFILES_DIRS
+=
[
# TODO (cpennington): When courses are stored in a database, this
# should no longer be added to STATICFILES
(
course_dir
,
DATA_DIR
/
course_dir
)
for
course_dir
in
os
.
listdir
(
DATA_DIR
)
if
(
os
.
path
.
isdir
(
DATA_DIR
/
course_dir
)
and
not
os
.
path
.
isdir
(
DATA_DIR
/
course_dir
/
'static'
))
]
# Otherwise, add only the static directory from the course dir
STATICFILES_DIRS
+=
[
# TODO (cpennington): When courses are stored in a database, this
# should no longer be added to STATICFILES
(
course_dir
,
DATA_DIR
/
course_dir
/
'static'
)
for
course_dir
in
os
.
listdir
(
DATA_DIR
)
if
(
os
.
path
.
isdir
(
DATA_DIR
/
course_dir
/
'static'
))
]
################################# mitx revision string #####################
################################# mitx revision string #####################
MITX_VERSION_STRING
=
os
.
popen
(
'cd
%
s; git describe'
%
REPO_ROOT
)
.
read
()
.
strip
()
MITX_VERSION_STRING
=
os
.
popen
(
'cd
%
s; git describe'
%
REPO_ROOT
)
.
read
()
.
strip
()
...
...
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