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
OpenEdx
edx-platform
Commits
89b8fc0d
Commit
89b8fc0d
authored
Oct 19, 2017
by
Eric Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eod checkpoint
parent
5c969554
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
+26
-7
cms/templates/asset_index.html
+1
-1
common/djangoapps/pipeline_mako/templates/static_content.html
+13
-6
webpack.config.js
+12
-0
No files found.
cms/templates/asset_index.html
View file @
89b8fc0d
...
...
@@ -57,8 +57,8 @@
<div
class=
"content-primary"
>
% if waffle_flag_enabled:
<div
id=
"root"
></div>
<
%
static:sfeTranslate
locale=
"fr"
></
%
static:sfeTranslate>
<
%
static:webpack
entry=
"AssetsPage"
></
%
static:webpack>
<
%
static:ericfischer
locale=
"fr"
></
%
static:ericfischer>
% else:
<div
class=
"wrapper-assets"
></div>
% endif
...
...
common/djangoapps/pipeline_mako/templates/static_content.html
View file @
89b8fc0d
...
...
@@ -86,27 +86,34 @@ engine = Engine(dirs=settings.DEFAULT_TEMPLATE_ENGINE['DIRS'])
source
,
template_path =
Loader(engine).load_template_source(path)
%
>
${source | n, decode.utf8}
</
%
def>
<
%
def
name=
"
ericfischer
(locale)"
>
<
%
def
name=
"
sfeTranslate
(locale)"
>
<
%
from
django
.
conf
import
settings
from
django
.
contrib
.
staticfiles
.
storage
import
staticfiles_storage
from
django
.
template
import
Template
,
Context
from
webpack_loader
.
exceptions
import
WebpackLoaderBadStatsError
path =
"{base}/bundles/studio-frontend/locale_messages/{locale}.json"
.
format
(
messages =
""
messages_path =
"{base}/bundles/studio-frontend/locale_messages/{locale}.json"
.
format
(
base=
settings.STATIC_ROOT,
locale=
locale
)
with
open
(
messages_path
)
as
inputfile:
messages =
inputfile.read()
messages =
""
with
open
(
path
)
as
input:
messages =
input.read(
)
localeScriptUrl =
staticfiles_storage.url(
"
bundles
/
studio-frontend
/
locale_scripts
/{
locale
}.
js
".
format
(
locale=
locale)
)
return
Template
("""
<
div
id=
studio-frontend-messages
style=
"display: none;"
>
<
script
type=
"text/javascript"
src=
{{
localeScriptUrl
}}
></script>
<div
id=
studio-frontend-messages
style=
"display: none;"
data-locale=
{{locale}}
>
{{ messages }}
</div>
""").render(Context({
'localeScriptUrl': localeScriptUrl,
'messages': messages,
'locale': locale
}))
%>
</
%
def>
...
...
webpack.config.js
View file @
89b8fc0d
...
...
@@ -123,6 +123,7 @@ var wpconfig = {
/studio-frontend/
,
/paragon/
],
exclude
:
/studio-frontend
\/
src
\/
locale_scripts/
,
use
:
'babel-loader'
},
{
...
...
@@ -137,6 +138,17 @@ var wpconfig = {
}
},
{
test
:
/
\.
jsx$/
,
include
:
/studio-frontend
\/
src
\/
locale_scripts/
,
use
:
{
loader
:
'babel-loader'
,
options
:
{
name
:
'[name].[ext]'
,
outputPath
:
'studio-frontend/locale_scripts/'
}
}
},
{
test
:
/
(
.scss|.css
)
$/
,
include
:
[
/studio-frontend/
,
...
...
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