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
97c08451
Commit
97c08451
authored
May 04, 2017
by
Andy Armstrong
Committed by
GitHub
May 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15044 from edx/bjacobel/mako-bundle-nonfatal
Mako should be able to render even if webpack hasn't run
parents
70f4bcc6
69dd20ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
common/djangoapps/pipeline_mako/templates/static_content.html
+16
-10
No files found.
common/djangoapps/pipeline_mako/templates/static_content.html
View file @
97c08451
<
%
page
expression_filter=
"h"
/>
<
%
page
expression_filter=
"h"
/>
<
%!
<
%!
import
logging
from
django
.
contrib
.
staticfiles
.
storage
import
staticfiles_storage
from
django
.
contrib
.
staticfiles
.
storage
import
staticfiles_storage
from
pipeline_mako
import
compressed_css
,
compressed_js
from
pipeline_mako
import
compressed_css
,
compressed_js
from
django
.
utils
.
translation
import
get_language_bidi
from
django
.
utils
.
translation
import
get_language_bidi
...
@@ -18,6 +19,7 @@ from openedx.core.djangoapps.theming.helpers import (
...
@@ -18,6 +19,7 @@ from openedx.core.djangoapps.theming.helpers import (
)
)
from
certificates
.
api
import
get_asset_url_by_slug
from
certificates
.
api
import
get_asset_url_by_slug
from
openedx
.
core
.
djangoapps
.
lang_pref
.
api
import
released_languages
from
openedx
.
core
.
djangoapps
.
lang_pref
.
api
import
released_languages
logger =
logging.getLogger(__name__)
%
>
%
>
<
%
def
name=
"marketing_link(name)"
><
%
<
%
def
name=
"marketing_link(name)"
><
%
...
@@ -92,16 +94,20 @@ source, template_path = Loader(engine).load_template_source(path)
...
@@ -92,16 +94,20 @@ source, template_path = Loader(engine).load_template_source(path)
</
%
doc>
</
%
doc>
<
%
<
%
from
django
.
template
import
Template
,
Context
from
django
.
template
import
Template
,
Context
return
Template
("""
try:
{%
load
render_bundle
from
webpack_loader
%}
return
Template
("""
{%
render_bundle
entry
%}
{%
load
render_bundle
from
webpack_loader
%}
<
script
type=
"text/javascript"
>
{%
render_bundle
entry
%}
{% autoescape off %}{{ body }}{% endautoescape %}
<
script
type=
"text/javascript"
>
</script>
{% autoescape off %}{{ body }}{% endautoescape %}
""").render(Context({
</script>
'entry': entry,
""").render(Context({
'body': capture(caller.body)
'entry': entry,
}))
'body': capture(caller.body)
}))
except IOError as e:
# Don't break Mako template rendering if the bundle or webpack-stats can't be found, but log it
logger.error(e)
%>
%>
</
%
def>
</
%
def>
...
...
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