diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index a3fadaad2a..cd670e8243 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -58,9 +58,9 @@ ADVANCED_COMPONENT_POLICY_KEY = 'advanced_modules' ADVANCED_PROBLEM_TYPES = settings.ADVANCED_PROBLEM_TYPES -CONTAINER_TEMPATES = [ +CONTAINER_TEMPLATES = [ "basic-modal", "modal-button", "edit-xblock-modal", - "editor-mode-button", "upload-dialog", "image-modal", + "editor-mode-button", "upload-dialog", "add-xblock-component", "add-xblock-component-button", "add-xblock-component-menu", "add-xblock-component-menu-problem", "xblock-string-field-editor", "publish-xblock", "publish-history", "unit-outline", "container-message", "license-selector", @@ -217,7 +217,7 @@ def container_handler(request, usage_key_string): 'xblock_info': xblock_info, 'draft_preview_link': preview_lms_link, 'published_preview_link': lms_link, - 'templates': CONTAINER_TEMPATES + 'templates': CONTAINER_TEMPLATES }) else: return HttpResponseBadRequest("Only supports HTML requests") diff --git a/cms/djangoapps/contentstore/views/library.py b/cms/djangoapps/contentstore/views/library.py index 7bb3cc1e1a..12987bfe0b 100644 --- a/cms/djangoapps/contentstore/views/library.py +++ b/cms/djangoapps/contentstore/views/library.py @@ -26,7 +26,7 @@ from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from .user import user_with_role -from .component import get_component_templates, CONTAINER_TEMPATES +from .component import get_component_templates, CONTAINER_TEMPLATES from student.auth import ( STUDIO_VIEW_USERS, STUDIO_EDIT_ROLES, get_user_permissions, has_studio_read_access, has_studio_write_access ) @@ -197,7 +197,7 @@ def library_blocks_view(library, user, response_format): 'context_library': library, 'component_templates': json.dumps(component_templates), 'xblock_info': xblock_info, - 'templates': CONTAINER_TEMPATES, + 'templates': CONTAINER_TEMPLATES, }) diff --git a/cms/envs/common.py b/cms/envs/common.py index 83020f746e..46a2dcc184 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -210,6 +210,7 @@ MAKO_TEMPLATES['main'] = [ COMMON_ROOT / 'templates', COMMON_ROOT / 'djangoapps' / 'pipeline_mako' / 'templates', COMMON_ROOT / 'djangoapps' / 'pipeline_js' / 'templates', + COMMON_ROOT / 'static', # required to statically include common Underscore templates ] for namespace, template_dirs in lms.envs.common.MAKO_TEMPLATES.iteritems(): diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index 0f0028d9a3..0260b5311f 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -30,6 +30,11 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' LMS_BASE = "localhost:8000" FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE +########################### PIPELINE ################################# + +# Skip RequireJS optimizer in development +STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' + ############################# ADVANCED COMPONENTS ############################# # Make it easier to test advanced components in local dev @@ -92,6 +97,11 @@ FEATURES['ENABLE_COURSEWARE_INDEX'] = True FEATURES['ENABLE_LIBRARY_INDEX'] = True SEARCH_ENGINE = "search.elastic.ElasticSearchEngine" +################################# DJANGO-REQUIRE ############################### + +# Whether to run django-require in debug mode. +REQUIRE_DEBUG = DEBUG + ############################################################################### # See if the developer has any local overrides. try: diff --git a/cms/static/build.js b/cms/static/build.js index 6103b8afe7..bb890bee5c 100644 --- a/cms/static/build.js +++ b/cms/static/build.js @@ -118,7 +118,7 @@ * As of 1.0.3, this value can also be a string that is converted to a * RegExp via new RegExp(). */ - fileExclusionRegExp: /^\.|spec/, + fileExclusionRegExp: /^\.|spec|spec_helpers/, /** * Allow CSS optimizations. Allowed values: * - "standard": @import inlining and removal of comments, unnecessary @@ -153,6 +153,6 @@ * SILENT: 4 * Default is 0. */ - logLevel: 4 + logLevel: 1 }; } ()) diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee index 6052f95412..14907cbc86 100644 --- a/cms/static/coffee/spec/main.coffee +++ b/cms/static/coffee/spec/main.coffee @@ -23,6 +23,7 @@ requirejs.config({ "jquery.simulate": "xmodule_js/common_static/js/vendor/jquery.simulate", "datepair": "xmodule_js/common_static/js/vendor/timepicker/datepair", "date": "xmodule_js/common_static/js/vendor/date", + "text": "xmodule_js/common_static/js/vendor/requirejs/text", "underscore": "xmodule_js/common_static/js/vendor/underscore-min", "underscore.string": "xmodule_js/common_static/js/vendor/underscore.string.min", "backbone": "xmodule_js/common_static/js/vendor/backbone-min", @@ -240,13 +241,11 @@ define([ "js/spec/views/active_video_upload_list_spec", "js/spec/views/previous_video_upload_spec", "js/spec/views/previous_video_upload_list_spec", - "js/spec/views/paging_spec", "js/spec/views/assets_spec", "js/spec/views/baseview_spec", "js/spec/views/container_spec", "js/spec/views/paged_container_spec", "js/spec/views/group_configuration_spec", - "js/spec/views/paging_spec", "js/spec/views/unit_outline_spec", "js/spec/views/xblock_spec", "js/spec/views/xblock_editor_spec", diff --git a/cms/static/coffee/spec/main_spec.coffee b/cms/static/coffee/spec/main_spec.coffee index db442b15ed..2de4869dbe 100644 --- a/cms/static/coffee/spec/main_spec.coffee +++ b/cms/static/coffee/spec/main_spec.coffee @@ -1,4 +1,4 @@ -require ["jquery", "backbone", "coffee/src/main", "js/common_helpers/ajax_helpers", "jasmine-stealth", "jquery.cookie"], +require ["jquery", "backbone", "coffee/src/main", "common/js/spec_helpers/ajax_helpers", "jasmine-stealth", "jquery.cookie"], ($, Backbone, main, AjaxHelpers) -> describe "CMS", -> it "should initialize URL", -> diff --git a/cms/static/coffee/spec/main_squire.coffee b/cms/static/coffee/spec/main_squire.coffee index 7698e8b34b..1feee91414 100644 --- a/cms/static/coffee/spec/main_squire.coffee +++ b/cms/static/coffee/spec/main_squire.coffee @@ -21,6 +21,7 @@ requirejs.config({ "jquery.immediateDescendents": "xmodule_js/common_static/coffee/src/jquery.immediateDescendents", "datepair": "xmodule_js/common_static/js/vendor/timepicker/datepair", "date": "xmodule_js/common_static/js/vendor/date", + "text": "xmodule_js/common_static/js/vendor/requirejs/text", "underscore": "xmodule_js/common_static/js/vendor/underscore-min", "underscore.string": "xmodule_js/common_static/js/vendor/underscore.string.min", "backbone": "xmodule_js/common_static/js/vendor/backbone-min", diff --git a/cms/static/coffee/spec/models/section_spec.coffee b/cms/static/coffee/spec/models/section_spec.coffee index 491cb340ec..95d26e43d4 100644 --- a/cms/static/coffee/spec/models/section_spec.coffee +++ b/cms/static/coffee/spec/models/section_spec.coffee @@ -1,4 +1,4 @@ -define ["js/models/section", "js/common_helpers/ajax_helpers", "js/utils/module"], (Section, AjaxHelpers, ModuleUtils) -> +define ["js/models/section", "common/js/spec_helpers/ajax_helpers", "js/utils/module"], (Section, AjaxHelpers, ModuleUtils) -> describe "Section", -> describe "basic", -> beforeEach -> diff --git a/cms/static/coffee/spec/views/assets_spec.coffee b/cms/static/coffee/spec/views/assets_spec.coffee index 038ad63b73..72bccbe396 100644 --- a/cms/static/coffee/spec/views/assets_spec.coffee +++ b/cms/static/coffee/spec/views/assets_spec.coffee @@ -1,11 +1,9 @@ -define ["jquery", "jasmine", "js/common_helpers/ajax_helpers", "squire"], +define ["jquery", "jasmine", "common/js/spec_helpers/ajax_helpers", "squire"], ($, jasmine, AjaxHelpers, Squire) -> feedbackTpl = readFixtures('system-feedback.underscore') assetLibraryTpl = readFixtures('asset-library.underscore') assetTpl = readFixtures('asset.underscore') - pagingHeaderTpl = readFixtures('paging-header.underscore') - pagingFooterTpl = readFixtures('paging-footer.underscore') describe "Asset view", -> beforeEach -> @@ -141,8 +139,6 @@ define ["jquery", "jasmine", "js/common_helpers/ajax_helpers", "squire"], beforeEach -> setFixtures($(" diff --git a/cms/templates/container.html b/cms/templates/container.html index b93ada88c9..4f2cc15da9 100644 --- a/cms/templates/container.html +++ b/cms/templates/container.html @@ -24,6 +24,9 @@ from django.utils.translation import ugettext as _ <%static:include path="js/${template_name}.underscore" /> % endfor + %block> diff --git a/cms/templates/js/mock/mock-container-paged-xblock.underscore b/cms/templates/js/mock/mock-container-paged-xblock.underscore index e3c1470558..78c26468d9 100644 --- a/cms/templates/js/mock/mock-container-paged-xblock.underscore +++ b/cms/templates/js/mock/mock-container-paged-xblock.underscore @@ -13,39 +13,6 @@