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
0f18b740
Commit
0f18b740
authored
Oct 06, 2016
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move pipeline_js Django app into CMS
Note: this used to be in common, but it was only used in Studio.
parent
dda92d13
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
6 deletions
+14
-6
.eslintignore
+4
-0
cms/djangoapps/pipeline_js/__init__.py
+0
-0
cms/djangoapps/pipeline_js/templates/xmodule.js
+0
-0
cms/djangoapps/pipeline_js/urls.py
+0
-0
cms/djangoapps/pipeline_js/views.py
+8
-5
cms/envs/common.py
+2
-1
No files found.
.eslintignore
View file @
0f18b740
...
@@ -32,6 +32,10 @@ cms/static/xmodule_js
...
@@ -32,6 +32,10 @@ cms/static/xmodule_js
lms/static/xmodule_js
lms/static/xmodule_js
# Mako templates that generate .js files
cms/djangoapps/pipeline_js/templates
# This directory is about half Coffee and half JS, things get messy here so just ignore all existing coffee paths
# This directory is about half Coffee and half JS, things get messy here so just ignore all existing coffee paths
common/lib/xmodule/xmodule/js/spec/annotatable/display_spec.js
common/lib/xmodule/xmodule/js/spec/annotatable/display_spec.js
common/lib/xmodule/xmodule/js/spec/capa/display_spec.js
common/lib/xmodule/xmodule/js/spec/capa/display_spec.js
...
...
c
ommon
/djangoapps/pipeline_js/__init__.py
→
c
ms
/djangoapps/pipeline_js/__init__.py
View file @
0f18b740
File moved
c
ommon
/djangoapps/pipeline_js/templates/xmodule.js
→
c
ms
/djangoapps/pipeline_js/templates/xmodule.js
View file @
0f18b740
File moved
c
ommon
/djangoapps/pipeline_js/urls.py
→
c
ms
/djangoapps/pipeline_js/urls.py
View file @
0f18b740
File moved
c
ommon
/djangoapps/pipeline_js/views.py
→
c
ms
/djangoapps/pipeline_js/views.py
View file @
0f18b740
"""
"""
Views for returning XModule JS (used by requirejs)
Views for returning XModule JS (used by requirejs)
"""
"""
import
json
import
json
from
django.conf
import
settings
from
django.conf
import
settings
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
edxmako.shortcuts
import
render_to_response
from
edxmako.shortcuts
import
render_to_response
...
@@ -12,15 +15,15 @@ def get_xmodule_urls():
...
@@ -12,15 +15,15 @@ def get_xmodule_urls():
"""
"""
Returns a list of the URLs to hit to grab all the XModule JS
Returns a list of the URLs to hit to grab all the XModule JS
"""
"""
pipeline_js_settings
=
settings
.
PIPELINE_JS
[
"module-js"
]
if
settings
.
DEBUG
:
if
settings
.
DEBUG
:
paths
=
[
path
.
replace
(
".coffee"
,
".js"
)
for
path
in
paths
=
[
path
.
replace
(
".coffee"
,
".js"
)
for
path
in
pipeline_js_settings
[
"source_filenames"
]]
settings
.
PIPELINE_JS
[
'module-js'
][
'source_filenames'
]]
else
:
else
:
paths
=
[
settings
.
PIPELINE_JS
[
'module-js'
][
'output_filename'
]]
paths
=
[
pipeline_js_settings
[
"output_filename"
]]
return
[
staticfiles_storage
.
url
(
path
)
for
path
in
paths
]
return
[
staticfiles_storage
.
url
(
path
)
for
path
in
paths
]
def
xmodule_js_files
(
request
):
def
xmodule_js_files
(
request
):
# pylint: disable=unused-argument
"""
"""
View function that returns XModule URLs as a JSON list; meant to be used
View function that returns XModule URLs as a JSON list; meant to be used
as an API
as an API
...
@@ -29,7 +32,7 @@ def xmodule_js_files(request):
...
@@ -29,7 +32,7 @@ def xmodule_js_files(request):
return
HttpResponse
(
json
.
dumps
(
urls
),
content_type
=
"application/json"
)
return
HttpResponse
(
json
.
dumps
(
urls
),
content_type
=
"application/json"
)
def
requirejs_xmodule
(
request
):
def
requirejs_xmodule
(
request
):
# pylint: disable=unused-argument
"""
"""
View function that returns a requirejs-wrapped Javascript file that
View function that returns a requirejs-wrapped Javascript file that
loads all the XModule URLs; meant to be loaded via requireJS
loads all the XModule URLs; meant to be loaded via requireJS
...
...
cms/envs/common.py
View file @
0f18b740
...
@@ -226,6 +226,7 @@ SOCIAL_SHARING_SETTINGS = {
...
@@ -226,6 +226,7 @@ SOCIAL_SHARING_SETTINGS = {
PROJECT_ROOT
=
path
(
__file__
)
.
abspath
()
.
dirname
()
.
dirname
()
# /edx-platform/cms
PROJECT_ROOT
=
path
(
__file__
)
.
abspath
()
.
dirname
()
.
dirname
()
# /edx-platform/cms
REPO_ROOT
=
PROJECT_ROOT
.
dirname
()
REPO_ROOT
=
PROJECT_ROOT
.
dirname
()
COMMON_ROOT
=
REPO_ROOT
/
"common"
COMMON_ROOT
=
REPO_ROOT
/
"common"
CMS_ROOT
=
REPO_ROOT
/
"cms"
LMS_ROOT
=
REPO_ROOT
/
"lms"
LMS_ROOT
=
REPO_ROOT
/
"lms"
ENV_ROOT
=
REPO_ROOT
.
dirname
()
# virtualenv dir /edx-platform is in
ENV_ROOT
=
REPO_ROOT
.
dirname
()
# virtualenv dir /edx-platform is in
...
@@ -249,8 +250,8 @@ MAKO_TEMPLATES['main'] = [
...
@@ -249,8 +250,8 @@ MAKO_TEMPLATES['main'] = [
PROJECT_ROOT
/
'templates'
,
PROJECT_ROOT
/
'templates'
,
COMMON_ROOT
/
'templates'
,
COMMON_ROOT
/
'templates'
,
COMMON_ROOT
/
'djangoapps'
/
'pipeline_mako'
/
'templates'
,
COMMON_ROOT
/
'djangoapps'
/
'pipeline_mako'
/
'templates'
,
COMMON_ROOT
/
'djangoapps'
/
'pipeline_js'
/
'templates'
,
COMMON_ROOT
/
'static'
,
# required to statically include common Underscore templates
COMMON_ROOT
/
'static'
,
# required to statically include common Underscore templates
CMS_ROOT
/
'djangoapps'
/
'pipeline_js'
/
'templates'
,
]
]
for
namespace
,
template_dirs
in
lms
.
envs
.
common
.
MAKO_TEMPLATES
.
iteritems
():
for
namespace
,
template_dirs
in
lms
.
envs
.
common
.
MAKO_TEMPLATES
.
iteritems
():
...
...
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