Commit 0ef7fa2c by E. Kolpakov

Reworked discussion assets management to work on production like environment…

Reworked discussion assets management to work on production like environment (pipelines+nginx proxy)
parent 8ad62cbc
...@@ -389,6 +389,10 @@ PIPELINE_CSS = { ...@@ -389,6 +389,10 @@ PIPELINE_CSS = {
], ],
'output_filename': 'css/cms-style-xmodule-annotations.css', 'output_filename': 'css/cms-style-xmodule-annotations.css',
}, },
'discussion': {
'source_filenames': ['sass/discussion-forum.css'],
'output_filename': 'css/cms-style-discussion-forum.css'
}
} }
# test_order: Determines the position of this chunk of javascript on # test_order: Determines the position of this chunk of javascript on
......
...@@ -11,8 +11,6 @@ from mako.template import Template as MakoTemplate ...@@ -11,8 +11,6 @@ from mako.template import Template as MakoTemplate
from rooted_paths import rooted_glob from rooted_paths import rooted_glob
discussion_js = sorted(rooted_glob(settings.COMMON_ROOT / 'static', 'coffee/src/discussion/**/*.js'))
JS_URLS = [ JS_URLS = [
# VENDOR # VENDOR
'js/vendor/URI.min.js', 'js/vendor/URI.min.js',
...@@ -30,11 +28,10 @@ JS_URLS = [ ...@@ -30,11 +28,10 @@ JS_URLS = [
'xblock/discussion/js/vendor/Markdown.Editor.js', 'xblock/discussion/js/vendor/Markdown.Editor.js',
'xblock/discussion/js/vendor/mathjax_delay_renderer.js', 'xblock/discussion/js/vendor/mathjax_delay_renderer.js',
'xblock/discussion/js/vendor/customwmd.js', 'xblock/discussion/js/vendor/customwmd.js',
] + discussion_js ]
CSS_URLS = [ CSS_URLS = [
'xblock/discussion/css/vendor/font-awesome.css', 'xblock/discussion/css/vendor/font-awesome.css'
'sass/discussion-forum.css',
] ]
......
...@@ -34,6 +34,8 @@ if Backbone? ...@@ -34,6 +34,8 @@ if Backbone?
if @isQuestion() if @isQuestion()
@markedAnswers = new Comments() @markedAnswers = new Comments()
@options = options
rerender: () -> rerender: () ->
if @showView? if @showView?
@showView.undelegateEvents() @showView.undelegateEvents()
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%namespace name='static' file='../static_content.html'/>
<%block name="js_extra">
<%static:js group='discussion'/>
</%block>
<%block name="css_extra">
<%static:css group='discussion'/>
</%block>
<div class="discussion-course"> <div class="discussion-course">
% if enable_new_post_btn and has_permission_to_create_thread: % if enable_new_post_btn and has_permission_to_create_thread:
......
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
<%! from django_comment_client.permissions import has_permission %> <%! from django_comment_client.permissions import has_permission %>
<%include file="_underscore_templates.html" /> <%include file="_underscore_templates.html" />
<%namespace name='static' file='../static_content.html'/>
<%block name="js_extra">
<%static:js group='discussion'/>
</%block>
<%block name="css_extra">
<%static:css group='discussion'/>
</%block>
<div class="discussion-module" data-discussion-id="${discussion_id | h}"> <div class="discussion-module" data-discussion-id="${discussion_id | h}">
<a class="discussion-show control-button" href="javascript:void(0)" data-discussion-id="${discussion_id | h}" role="button"><span class="show-hide-discussion-icon"></span><span class="button-text">${_("Show Discussion")}</span></a> <a class="discussion-show control-button" href="javascript:void(0)" data-discussion-id="${discussion_id | h}" role="button"><span class="show-hide-discussion-icon"></span><span class="button-text">${_("Show Discussion")}</span></a>
% if has_permission(user, 'create_thread', course.id): % if has_permission(user, 'create_thread', course.id):
......
...@@ -1077,6 +1077,10 @@ PIPELINE_CSS = { ...@@ -1077,6 +1077,10 @@ PIPELINE_CSS = {
], ],
'output_filename': 'css/lms-style-xmodule-annotations.css', 'output_filename': 'css/lms-style-xmodule-annotations.css',
}, },
'discussion': {
'source_filenames': ['sass/discussion-forum.css'],
'output_filename': 'css/lms-style-discussion-forum.css'
}
} }
......
...@@ -50,7 +50,6 @@ ${page_title_breadcrumbs(course_name())} ...@@ -50,7 +50,6 @@ ${page_title_breadcrumbs(course_name())}
<script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script> <script type="text/javascript" src="${static.url('js/vendor/codemirror-compressed.js')}"></script>
<%static:js group='courseware'/> <%static:js group='courseware'/>
<%static:js group='discussion'/>
<%include file="../discussion/_js_body_dependencies.html" /> <%include file="../discussion/_js_body_dependencies.html" />
% if staff_access: % if staff_access:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment