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
891bddcd
Commit
891bddcd
authored
Mar 07, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
need to support link references to static content that is in the code base (e.g. module's .js/.css)
parent
49db56ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
common/djangoapps/static_replace/__init__.py
+7
-4
No files found.
common/djangoapps/static_replace/__init__.py
View file @
891bddcd
...
...
@@ -84,12 +84,15 @@ def replace_static_urls(text, data_directory, course_namespace=None):
if
rest
.
endswith
(
'?raw'
):
return
original
# course_namespace is not None, then use studio style urls
if
course_namespace
is
not
None
and
not
isinstance
(
modulestore
(),
XMLModuleStore
):
url
=
StaticContent
.
convert_legacy_static_url
(
rest
,
course_namespace
)
# In debug mode, if we can find the url as is,
el
if
settings
.
DEBUG
and
finders
.
find
(
rest
,
True
):
if
settings
.
DEBUG
and
finders
.
find
(
rest
,
True
):
return
original
# course_namespace is not None, then use studio style urls
elif
course_namespace
is
not
None
and
not
isinstance
(
modulestore
(),
XMLModuleStore
):
if
staticfiles_storage
.
exists
(
rest
):
url
=
staticfiles_storage
.
url
(
rest
)
else
:
url
=
StaticContent
.
convert_legacy_static_url
(
rest
,
course_namespace
)
# Otherwise, look the file up in staticfiles_storage, and append the data directory if needed
else
:
course_path
=
"/"
.
join
((
data_directory
,
rest
))
...
...
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