From 6b15303d899b8b1e55d3a9d2b0588090324645d8 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 18 May 2012 15:10:10 -0400 Subject: [PATCH] Make collectstatic compile .coffee files, and preserve the askbot workflow using guard --- Gemfile | 4 +- Gemfile.lock | 31 +---- Guardfile | 20 +-- envs/common.py | 35 +++-- envs/dev.py | 6 + rakefile | 13 +- {templates => static}/coffee/README.md | 0 {templates => static}/coffee/files.json | 0 .../coffee/fixtures/accordion.html | 0 .../coffee/fixtures/calculator.html | 0 .../coffee/fixtures/feedback_form.html | 0 .../coffee/spec/calculator_spec.coffee | 0 .../coffee/spec/calculator_spec.js | 0 .../coffee/spec/courseware_spec.coffee | 0 .../coffee/spec/courseware_spec.js | 0 .../coffee/spec/feedback_form_spec.coffee | 0 .../coffee/spec/feedback_form_spec.js | 0 .../coffee/spec/helper.coffee | 0 {templates => static}/coffee/spec/helper.js | 0 static/coffee/src/.gitignore | 1 + .../coffee/src/calculator.coffee | 0 .../coffee/src/courseware.coffee | 0 .../coffee/src/feedback_form.coffee | 0 {templates => static}/coffee/src/main.coffee | 0 static/css | 1 - {sass => static}/images/css/.xcf | Bin .../images/css/bottomWrapper-bg.jpg | Bin .../images/css/footerWrapper-bg.jpg | Bin {sass => static}/images/css/hat.jpg | Bin {sass => static}/images/css/hmenu-sel.jpg | Bin {sass => static}/images/css/hmenu.jpg | Bin {sass => static}/images/css/page-bg.jpg | Bin {sass => static}/images/css/page-vbg.jpg | Bin {sass => static}/images/css/topBanner-old.xcf | Bin {sass => static}/images/css/topBanner.jpg | Bin {sass => static}/images/css/topBanner.png | Bin {sass => static}/images/css/topBanner.xcf | Bin {sass => static}/images/css/topWrapper-bg.jpg | Bin .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin .../images/ui-bg_flat_0_eeeeee_40x100.png | Bin .../images/ui-bg_flat_55_ffffff_40x100.png | Bin .../images/ui-bg_flat_75_ffffff_40x100.png | Bin .../images/ui-bg_glass_65_023063_1x400.png | Bin .../images/ui-bg_glass_65_ffffff_1x400.png | Bin .../ui-bg_highlight-soft_100_7fbcdf_1x100.png | Bin .../ui-bg_highlight-soft_100_bddeff_1x100.png | Bin .../ui-bg_highlight-soft_100_f6f6f6_1x100.png | Bin .../ui-bg_highlight-soft_25_7fbcdf_1x100.png | Bin .../ui-bg_highlight-soft_25_bddeff_1x100.png | Bin .../ui-bg_highlight-soft_50_7fbcfd_1x100.png | Bin .../images/ui-icons_031634_256x240.png | Bin .../images/ui-icons_454545_256x240.png | Bin .../images/ui-icons_adcc80_256x240.png | Bin .../images/ui-icons_fa720a_256x240.png | Bin .../images/ui-icons_ffffff_256x240.png | Bin static/js/application.js | 121 ------------------ {sass => static/sass}/.gitignore | 0 {templates => static}/sass/README.md | 13 +- {sass => static/sass}/_gradebook.scss | 0 {sass => static/sass}/_help.scss | 0 {sass => static/sass}/_info.scss | 0 {sass => static/sass}/_profile.scss | 0 {sass => static/sass}/_textbook.scss | 0 {sass => static/sass}/application.scss | 0 {sass => static/sass}/base/_base.scss | 0 {sass => static/sass}/base/_extends.scss | 2 +- {sass => static/sass}/base/_font-face.scss | 0 {sass => static/sass}/base/_functions.scss | 0 {sass => static/sass}/base/_reset.scss | 0 {sass => static/sass}/base/_variables.scss | 0 {sass => static/sass}/bourbon/_bourbon.scss | 0 .../sass}/bourbon/addons/_button.scss | 0 .../sass}/bourbon/addons/_clearfix.scss | 0 .../sass}/bourbon/addons/_font-family.scss | 0 .../bourbon/addons/_html5-input-types.scss | 0 .../sass}/bourbon/addons/_position.scss | 0 .../bourbon/addons/_timing-functions.scss | 0 .../sass}/bourbon/css3/_animation.scss | 0 .../sass}/bourbon/css3/_appearance.scss | 0 .../sass}/bourbon/css3/_background-image.scss | 0 .../sass}/bourbon/css3/_background-size.scss | 0 .../sass}/bourbon/css3/_border-image.scss | 0 .../sass}/bourbon/css3/_border-radius.scss | 0 .../sass}/bourbon/css3/_box-shadow.scss | 0 .../sass}/bourbon/css3/_box-sizing.scss | 0 .../sass}/bourbon/css3/_columns.scss | 0 .../sass}/bourbon/css3/_flex-box.scss | 0 .../sass}/bourbon/css3/_inline-block.scss | 0 .../sass}/bourbon/css3/_linear-gradient.scss | 0 .../sass}/bourbon/css3/_radial-gradient.scss | 0 .../sass}/bourbon/css3/_transform.scss | 0 .../sass}/bourbon/css3/_transition.scss | 0 .../sass}/bourbon/css3/_user-select.scss | 0 .../_deprecated-webkit-gradient.scss | 0 .../sass}/bourbon/functions/_flex-grid.scss | 0 .../sass}/bourbon/functions/_grid-width.scss | 0 .../bourbon/functions/_linear-gradient.scss | 0 .../bourbon/functions/_modular-scale.scss | 0 .../bourbon/functions/_radial-gradient.scss | 0 .../bourbon/functions/_render-gradients.scss | 0 .../sass}/bourbon/functions/_tint-shade.scss | 0 {sass => static/sass}/bourbon/lib/bourbon.rb | 0 .../bourbon/lib/bourbon/sass_extensions.rb | 0 .../lib/bourbon/sass_extensions/functions.rb | 0 .../sass_extensions/functions/compact.rb | 0 .../sass}/courseware/_amplifier.scss | 0 .../sass}/courseware/_courseware.scss | 0 .../sass}/courseware/_sequence-nav.scss | 0 .../sass}/courseware/_sidebar.scss | 0 {sass => static/sass}/courseware/_video.scss | 0 .../sass}/discussion/_answers.scss | 0 .../sass}/discussion/_askbot-original.scss | 0 {sass => static/sass}/discussion/_badges.scss | 0 .../sass}/discussion/_discussion.scss | 0 .../sass}/discussion/_form-wmd-toolbar.scss | 0 {sass => static/sass}/discussion/_forms.scss | 0 {sass => static/sass}/discussion/_modals.scss | 0 .../sass}/discussion/_profile.scss | 0 .../sass}/discussion/_question-view.scss | 0 .../sass}/discussion/_questions.scss | 0 .../sass}/discussion/_sidebar.scss | 0 {sass => static/sass}/discussion/_tags.scss | 0 {sass => static/sass}/layout/_calculator.scss | 0 {sass => static/sass}/layout/_footer.scss | 0 {sass => static/sass}/layout/_header.scss | 0 {sass => static/sass}/layout/_layout.scss | 0 {sass => static/sass}/layout/_leanmodal.scss | 0 {sass => static/sass}/marketing-ie.scss | 0 {sass => static/sass}/marketing.scss | 0 {sass => static/sass}/marketing/_base.scss | 0 {sass => static/sass}/marketing/_extends.scss | 0 {sass => static/sass}/marketing/_footer.scss | 0 {sass => static/sass}/marketing/_header.scss | 0 {sass => static/sass}/marketing/_index.scss | 0 .../sass}/marketing/_variables.scss | 0 .../plugins/_jquery-ui-1.8.16.custom.scss | 34 ++--- .../sass}/plugins/_jquery.qtip.min.scss | 0 {sass => static/sass}/print.scss | 0 {sass => static/sass}/wiki/_basic-html.scss | 0 {sass => static/sass}/wiki/_create.scss | 0 {sass => static/sass}/wiki/_sidebar.scss | 0 {sass => static/sass}/wiki/_table.scss | 0 {sass => static/sass}/wiki/_wiki.scss | 0 urls.py | 4 +- 144 files changed, 70 insertions(+), 215 deletions(-) rename {templates => static}/coffee/README.md (100%) rename {templates => static}/coffee/files.json (100%) rename {templates => static}/coffee/fixtures/accordion.html (100%) rename {templates => static}/coffee/fixtures/calculator.html (100%) rename {templates => static}/coffee/fixtures/feedback_form.html (100%) rename {templates => static}/coffee/spec/calculator_spec.coffee (100%) rename {templates => static}/coffee/spec/calculator_spec.js (100%) rename {templates => static}/coffee/spec/courseware_spec.coffee (100%) rename {templates => static}/coffee/spec/courseware_spec.js (100%) rename {templates => static}/coffee/spec/feedback_form_spec.coffee (100%) rename {templates => static}/coffee/spec/feedback_form_spec.js (100%) rename {templates => static}/coffee/spec/helper.coffee (100%) rename {templates => static}/coffee/spec/helper.js (100%) create mode 100644 static/coffee/src/.gitignore rename {templates => static}/coffee/src/calculator.coffee (100%) rename {templates => static}/coffee/src/courseware.coffee (100%) rename {templates => static}/coffee/src/feedback_form.coffee (100%) rename {templates => static}/coffee/src/main.coffee (100%) delete mode 120000 static/css rename {sass => static}/images/css/.xcf (100%) rename {sass => static}/images/css/bottomWrapper-bg.jpg (100%) rename {sass => static}/images/css/footerWrapper-bg.jpg (100%) rename {sass => static}/images/css/hat.jpg (100%) rename {sass => static}/images/css/hmenu-sel.jpg (100%) rename {sass => static}/images/css/hmenu.jpg (100%) rename {sass => static}/images/css/page-bg.jpg (100%) rename {sass => static}/images/css/page-vbg.jpg (100%) rename {sass => static}/images/css/topBanner-old.xcf (100%) rename {sass => static}/images/css/topBanner.jpg (100%) rename {sass => static}/images/css/topBanner.png (100%) rename {sass => static}/images/css/topBanner.xcf (100%) rename {sass => static}/images/css/topWrapper-bg.jpg (100%) rename {sass => static}/images/ui-bg_flat_0_aaaaaa_40x100.png (100%) rename {sass => static}/images/ui-bg_flat_0_eeeeee_40x100.png (100%) rename {sass => static}/images/ui-bg_flat_55_ffffff_40x100.png (100%) rename {sass => static}/images/ui-bg_flat_75_ffffff_40x100.png (100%) rename {sass => static}/images/ui-bg_glass_65_023063_1x400.png (100%) rename {sass => static}/images/ui-bg_glass_65_ffffff_1x400.png (100%) rename {sass => static}/images/ui-bg_highlight-soft_100_7fbcdf_1x100.png (100%) rename {sass => static}/images/ui-bg_highlight-soft_100_bddeff_1x100.png (100%) rename {sass => static}/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png (100%) rename {sass => static}/images/ui-bg_highlight-soft_25_7fbcdf_1x100.png (100%) rename {sass => static}/images/ui-bg_highlight-soft_25_bddeff_1x100.png (100%) rename {sass => static}/images/ui-bg_highlight-soft_50_7fbcfd_1x100.png (100%) rename {sass => static}/images/ui-icons_031634_256x240.png (100%) rename {sass => static}/images/ui-icons_454545_256x240.png (100%) rename {sass => static}/images/ui-icons_adcc80_256x240.png (100%) rename {sass => static}/images/ui-icons_fa720a_256x240.png (100%) rename {sass => static}/images/ui-icons_ffffff_256x240.png (100%) delete mode 100644 static/js/application.js rename {sass => static/sass}/.gitignore (100%) rename {templates => static}/sass/README.md (59%) rename {sass => static/sass}/_gradebook.scss (100%) rename {sass => static/sass}/_help.scss (100%) rename {sass => static/sass}/_info.scss (100%) rename {sass => static/sass}/_profile.scss (100%) rename {sass => static/sass}/_textbook.scss (100%) rename {sass => static/sass}/application.scss (100%) rename {sass => static/sass}/base/_base.scss (100%) rename {sass => static/sass}/base/_extends.scss (98%) rename {sass => static/sass}/base/_font-face.scss (100%) rename {sass => static/sass}/base/_functions.scss (100%) rename {sass => static/sass}/base/_reset.scss (100%) rename {sass => static/sass}/base/_variables.scss (100%) rename {sass => static/sass}/bourbon/_bourbon.scss (100%) rename {sass => static/sass}/bourbon/addons/_button.scss (100%) rename {sass => static/sass}/bourbon/addons/_clearfix.scss (100%) rename {sass => static/sass}/bourbon/addons/_font-family.scss (100%) rename {sass => static/sass}/bourbon/addons/_html5-input-types.scss (100%) rename {sass => static/sass}/bourbon/addons/_position.scss (100%) rename {sass => static/sass}/bourbon/addons/_timing-functions.scss (100%) rename {sass => static/sass}/bourbon/css3/_animation.scss (100%) rename {sass => static/sass}/bourbon/css3/_appearance.scss (100%) rename {sass => static/sass}/bourbon/css3/_background-image.scss (100%) rename {sass => static/sass}/bourbon/css3/_background-size.scss (100%) rename {sass => static/sass}/bourbon/css3/_border-image.scss (100%) rename {sass => static/sass}/bourbon/css3/_border-radius.scss (100%) rename {sass => static/sass}/bourbon/css3/_box-shadow.scss (100%) rename {sass => static/sass}/bourbon/css3/_box-sizing.scss (100%) rename {sass => static/sass}/bourbon/css3/_columns.scss (100%) rename {sass => static/sass}/bourbon/css3/_flex-box.scss (100%) rename {sass => static/sass}/bourbon/css3/_inline-block.scss (100%) rename {sass => static/sass}/bourbon/css3/_linear-gradient.scss (100%) rename {sass => static/sass}/bourbon/css3/_radial-gradient.scss (100%) rename {sass => static/sass}/bourbon/css3/_transform.scss (100%) rename {sass => static/sass}/bourbon/css3/_transition.scss (100%) rename {sass => static/sass}/bourbon/css3/_user-select.scss (100%) rename {sass => static/sass}/bourbon/functions/_deprecated-webkit-gradient.scss (100%) rename {sass => static/sass}/bourbon/functions/_flex-grid.scss (100%) rename {sass => static/sass}/bourbon/functions/_grid-width.scss (100%) rename {sass => static/sass}/bourbon/functions/_linear-gradient.scss (100%) rename {sass => static/sass}/bourbon/functions/_modular-scale.scss (100%) rename {sass => static/sass}/bourbon/functions/_radial-gradient.scss (100%) rename {sass => static/sass}/bourbon/functions/_render-gradients.scss (100%) rename {sass => static/sass}/bourbon/functions/_tint-shade.scss (100%) rename {sass => static/sass}/bourbon/lib/bourbon.rb (100%) rename {sass => static/sass}/bourbon/lib/bourbon/sass_extensions.rb (100%) rename {sass => static/sass}/bourbon/lib/bourbon/sass_extensions/functions.rb (100%) rename {sass => static/sass}/bourbon/lib/bourbon/sass_extensions/functions/compact.rb (100%) rename {sass => static/sass}/courseware/_amplifier.scss (100%) rename {sass => static/sass}/courseware/_courseware.scss (100%) rename {sass => static/sass}/courseware/_sequence-nav.scss (100%) rename {sass => static/sass}/courseware/_sidebar.scss (100%) rename {sass => static/sass}/courseware/_video.scss (100%) rename {sass => static/sass}/discussion/_answers.scss (100%) rename {sass => static/sass}/discussion/_askbot-original.scss (100%) rename {sass => static/sass}/discussion/_badges.scss (100%) rename {sass => static/sass}/discussion/_discussion.scss (100%) rename {sass => static/sass}/discussion/_form-wmd-toolbar.scss (100%) rename {sass => static/sass}/discussion/_forms.scss (100%) rename {sass => static/sass}/discussion/_modals.scss (100%) rename {sass => static/sass}/discussion/_profile.scss (100%) rename {sass => static/sass}/discussion/_question-view.scss (100%) rename {sass => static/sass}/discussion/_questions.scss (100%) rename {sass => static/sass}/discussion/_sidebar.scss (100%) rename {sass => static/sass}/discussion/_tags.scss (100%) rename {sass => static/sass}/layout/_calculator.scss (100%) rename {sass => static/sass}/layout/_footer.scss (100%) rename {sass => static/sass}/layout/_header.scss (100%) rename {sass => static/sass}/layout/_layout.scss (100%) rename {sass => static/sass}/layout/_leanmodal.scss (100%) rename {sass => static/sass}/marketing-ie.scss (100%) rename {sass => static/sass}/marketing.scss (100%) rename {sass => static/sass}/marketing/_base.scss (100%) rename {sass => static/sass}/marketing/_extends.scss (100%) rename {sass => static/sass}/marketing/_footer.scss (100%) rename {sass => static/sass}/marketing/_header.scss (100%) rename {sass => static/sass}/marketing/_index.scss (100%) rename {sass => static/sass}/marketing/_variables.scss (100%) rename {sass => static/sass}/plugins/_jquery-ui-1.8.16.custom.scss (94%) rename {sass => static/sass}/plugins/_jquery.qtip.min.scss (100%) rename {sass => static/sass}/print.scss (100%) rename {sass => static/sass}/wiki/_basic-html.scss (100%) rename {sass => static/sass}/wiki/_create.scss (100%) rename {sass => static/sass}/wiki/_sidebar.scss (100%) rename {sass => static/sass}/wiki/_table.scss (100%) rename {sass => static/sass}/wiki/_wiki.scss (100%) diff --git a/Gemfile b/Gemfile index 9730219ef2..cf72c5cd26 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,8 @@ source :rubygems gem 'guard', '~> 1.0.3' -gem 'guard-process', '~> 1.0.3' -gem 'guard-coffeescript', '~> 0.6.0' gem 'sass', '3.1.15' -gem 'guard-sass', :github => 'sikachu/guard-sass' gem 'bourbon', '~> 1.3.6' gem 'libnotify', '~> 0.7.2' gem 'ruby_gntp', '~> 0.3.4' +gem 'guard-rake', '0.0.5' diff --git a/Gemfile.lock b/Gemfile.lock index e63f6edcbd..573843c103 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,19 @@ -GIT - remote: git://github.com/sikachu/guard-sass.git - revision: 2a646996d7fdaa2fabf5f65ba700bd8b02f14c1b - specs: - guard-sass (0.6.0) - guard (>= 0.4.0) - sass (>= 3.1) - GEM remote: http://rubygems.org/ specs: bourbon (1.3.6) sass (>= 3.1) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.3.3) - execjs (1.3.2) - multi_json (~> 1.0) ffi (1.0.11) guard (1.0.3) ffi (>= 0.5.0) thor (>= 0.14.6) - guard-coffeescript (0.6.0) - coffee-script (>= 2.2.0) - guard (>= 0.8.3) - guard-process (1.0.3) - ffi (~> 1.0.9) - guard (>= 0.4.2) - spoon (~> 0.0.1) + guard-rake (0.0.5) + guard + rake libnotify (0.7.2) - multi_json (1.3.5) + rake (0.9.2.2) ruby_gntp (0.3.4) sass (3.1.15) - spoon (0.0.1) thor (0.15.2) PLATFORMS @@ -41,9 +22,7 @@ PLATFORMS DEPENDENCIES bourbon (~> 1.3.6) guard (~> 1.0.3) - guard-coffeescript (~> 0.6.0) - guard-process (~> 1.0.3) - guard-sass! + guard-rake (= 0.0.5) libnotify (~> 0.7.2) ruby_gntp (~> 0.3.4) sass (= 3.1.15) diff --git a/Guardfile b/Guardfile index 46dbf0d367..3d96355730 100644 --- a/Guardfile +++ b/Guardfile @@ -1,19 +1,3 @@ -require 'bourbon' - -# Helper method -def production? - @@options[:group].include? 'production' -end - -guard :coffeescript, :name => :jasmine, :input => 'templates/coffee/spec', :all_on_start => production? - -guard :coffeescript, :input => 'templates/coffee/src', :noop => true -guard :process, :name => :coffeescript, :command => "coffee -j static/js/application.js -c templates/coffee/src" do - watch(%r{^templates/coffee/src/(.+)\.coffee$}) -end - -if production? - guard :sass, :input => 'templates/sass', :output => 'static/css', :style => :compressed, :all_on_start => true -else - guard :sass, :input => 'templates/sass', :output => 'static/css', :style => :nested, :line_numbers => true +guard :rake, :task => :collectstatic, :run_on_all => true, :run_on_start => true do + watch(%r{^static/.+(.scss|.coffee)$}) end diff --git a/envs/common.py b/envs/common.py index c4c6c897af..1eaecc3228 100644 --- a/envs/common.py +++ b/envs/common.py @@ -153,7 +153,7 @@ MANAGERS = ADMINS # Static content STATIC_URL = '/static/' ADMIN_MEDIA_PREFIX = '/static/admin/' -STATIC_ROOT = ENV_ROOT / "staticfiles" # We don't run collectstatic -- this is to appease askbot checks +STATIC_ROOT = ENV_ROOT / "staticfiles" # FIXME: We should iterate through the courses we have, adding the static # contents for each of them. (Right now we just use symlinks.) @@ -217,7 +217,7 @@ SIMPLE_WIKI_REQUIRE_LOGIN_EDIT = True SIMPLE_WIKI_REQUIRE_LOGIN_VIEW = False ################################# Jasmine ################################### -JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/templates/coffee' +JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee' ################################# Middleware ################################### # List of finder classes that know how to find static files in @@ -266,36 +266,49 @@ STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' PIPELINE_CSS = { 'application': { - 'source_filenames': ['css/application.scss'], + 'source_filenames': ['sass/application.scss'], 'output_filename': 'css/application.css', }, 'marketing': { - 'source_filenames': ['css/marketing.scss'], + 'source_filenames': ['sass/marketing.scss'], 'output_filename': 'css/marketing.css', }, 'marketing-ie': { - 'source_filenames': ['css/marketing-ie.scss'], + 'source_filenames': ['sass/marketing-ie.scss'], 'output_filename': 'css/marketing-ie.css', }, 'print': { - 'source_filenames': ['css/print.scss'], + 'source_filenames': ['sass/print.scss'], 'output_filename': 'css/print.css', } } +PIPELINE_JS = { + 'application': { + 'source_filenames': [ + 'coffee/src/calculator.coffee', + 'coffee/src/courseware.coffee', + 'coffee/src/feedback_form.coffee', + 'coffee/src/main.coffee' + ], + 'output_filename': 'js/application.js' + } +} + PIPELINE_COMPILERS = [ - 'pipeline.compilers.sass.SASSCompiler' + 'pipeline.compilers.sass.SASSCompiler', + 'pipeline.compilers.coffee.CoffeeScriptCompiler', ] -PIPELINE_SASS_ARGUMENTS = '-r {proj_dir}/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT) +PIPELINE_SASS_ARGUMENTS = '-r {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT) PIPELINE_CSS_COMPRESSOR = None STATICFILES_IGNORE_PATTERNS = ( - "*.scss", - "*.rb", + "sass/*", + "coffee/*", "*.py", - "*.pyc", + "*.pyc" ) ################################### APPS ####################################### diff --git a/envs/dev.py b/envs/dev.py index b459f0a34f..2c8f6d2f63 100644 --- a/envs/dev.py +++ b/envs/dev.py @@ -82,3 +82,9 @@ FILE_UPLOAD_HANDLERS = ( 'django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler', ) + +########################### PIPELINE ################################# + +PIPELINE_COFFEE_SCRIPT_BINARY = 'coffee' +PIPELINE_JS_COMPRESSOR = None +PIPELINE_CSS_COMPRESSOR = None diff --git a/rakefile b/rakefile index a2ea3243a9..22bceeee68 100644 --- a/rakefile +++ b/rakefile @@ -59,11 +59,18 @@ task :test => REPORT_DIR do sh("#{django_admin} test --settings=envs.test --pythonpath=. $(ls djangoapps)") end -desc "Start a local server with the specified environment (defaults to dev). Other useful environments are devplus (for dev testing with a real local database)" -task :runserver, :env do |t, args| +desc "Collect static files" +task :collectstatic, :env do |t, args| args.with_defaults(:env => 'dev') django_admin = ENV['DJANGO_ADMIN_PATH'] || select_executable('django-admin.py', 'django-admin') - sh("#{django_admin} runserver --settings=envs.#{args.env} --pythonpath=.") + sh("#{django_admin} collectstatic --settings=envs.#{args.env} --pythonpath=. --noinput --link") +end + +desc "Start a local server with the specified environment (defaults to dev). Other useful environments are devplus (for dev testing with a real local database)" +task :runserver, [:env] => [:collectstatic] do |t, args| + args.with_defaults(:env => 'dev') + django_admin = ENV['DJANGO_ADMIN_PATH'] || select_executable('django-admin.py', 'django-admin') + sh("#{django_admin} runserver --settings=envs.#{args.env} --pythonpath=. --nostatic") end task :package do diff --git a/templates/coffee/README.md b/static/coffee/README.md similarity index 100% rename from templates/coffee/README.md rename to static/coffee/README.md diff --git a/templates/coffee/files.json b/static/coffee/files.json similarity index 100% rename from templates/coffee/files.json rename to static/coffee/files.json diff --git a/templates/coffee/fixtures/accordion.html b/static/coffee/fixtures/accordion.html similarity index 100% rename from templates/coffee/fixtures/accordion.html rename to static/coffee/fixtures/accordion.html diff --git a/templates/coffee/fixtures/calculator.html b/static/coffee/fixtures/calculator.html similarity index 100% rename from templates/coffee/fixtures/calculator.html rename to static/coffee/fixtures/calculator.html diff --git a/templates/coffee/fixtures/feedback_form.html b/static/coffee/fixtures/feedback_form.html similarity index 100% rename from templates/coffee/fixtures/feedback_form.html rename to static/coffee/fixtures/feedback_form.html diff --git a/templates/coffee/spec/calculator_spec.coffee b/static/coffee/spec/calculator_spec.coffee similarity index 100% rename from templates/coffee/spec/calculator_spec.coffee rename to static/coffee/spec/calculator_spec.coffee diff --git a/templates/coffee/spec/calculator_spec.js b/static/coffee/spec/calculator_spec.js similarity index 100% rename from templates/coffee/spec/calculator_spec.js rename to static/coffee/spec/calculator_spec.js diff --git a/templates/coffee/spec/courseware_spec.coffee b/static/coffee/spec/courseware_spec.coffee similarity index 100% rename from templates/coffee/spec/courseware_spec.coffee rename to static/coffee/spec/courseware_spec.coffee diff --git a/templates/coffee/spec/courseware_spec.js b/static/coffee/spec/courseware_spec.js similarity index 100% rename from templates/coffee/spec/courseware_spec.js rename to static/coffee/spec/courseware_spec.js diff --git a/templates/coffee/spec/feedback_form_spec.coffee b/static/coffee/spec/feedback_form_spec.coffee similarity index 100% rename from templates/coffee/spec/feedback_form_spec.coffee rename to static/coffee/spec/feedback_form_spec.coffee diff --git a/templates/coffee/spec/feedback_form_spec.js b/static/coffee/spec/feedback_form_spec.js similarity index 100% rename from templates/coffee/spec/feedback_form_spec.js rename to static/coffee/spec/feedback_form_spec.js diff --git a/templates/coffee/spec/helper.coffee b/static/coffee/spec/helper.coffee similarity index 100% rename from templates/coffee/spec/helper.coffee rename to static/coffee/spec/helper.coffee diff --git a/templates/coffee/spec/helper.js b/static/coffee/spec/helper.js similarity index 100% rename from templates/coffee/spec/helper.js rename to static/coffee/spec/helper.js diff --git a/static/coffee/src/.gitignore b/static/coffee/src/.gitignore new file mode 100644 index 0000000000..a6c7c2852d --- /dev/null +++ b/static/coffee/src/.gitignore @@ -0,0 +1 @@ +*.js diff --git a/templates/coffee/src/calculator.coffee b/static/coffee/src/calculator.coffee similarity index 100% rename from templates/coffee/src/calculator.coffee rename to static/coffee/src/calculator.coffee diff --git a/templates/coffee/src/courseware.coffee b/static/coffee/src/courseware.coffee similarity index 100% rename from templates/coffee/src/courseware.coffee rename to static/coffee/src/courseware.coffee diff --git a/templates/coffee/src/feedback_form.coffee b/static/coffee/src/feedback_form.coffee similarity index 100% rename from templates/coffee/src/feedback_form.coffee rename to static/coffee/src/feedback_form.coffee diff --git a/templates/coffee/src/main.coffee b/static/coffee/src/main.coffee similarity index 100% rename from templates/coffee/src/main.coffee rename to static/coffee/src/main.coffee diff --git a/static/css b/static/css deleted file mode 120000 index 2091f380ce..0000000000 --- a/static/css +++ /dev/null @@ -1 +0,0 @@ -../sass \ No newline at end of file diff --git a/sass/images/css/.xcf b/static/images/css/.xcf similarity index 100% rename from sass/images/css/.xcf rename to static/images/css/.xcf diff --git a/sass/images/css/bottomWrapper-bg.jpg b/static/images/css/bottomWrapper-bg.jpg similarity index 100% rename from sass/images/css/bottomWrapper-bg.jpg rename to static/images/css/bottomWrapper-bg.jpg diff --git a/sass/images/css/footerWrapper-bg.jpg b/static/images/css/footerWrapper-bg.jpg similarity index 100% rename from sass/images/css/footerWrapper-bg.jpg rename to static/images/css/footerWrapper-bg.jpg diff --git a/sass/images/css/hat.jpg b/static/images/css/hat.jpg similarity index 100% rename from sass/images/css/hat.jpg rename to static/images/css/hat.jpg diff --git a/sass/images/css/hmenu-sel.jpg b/static/images/css/hmenu-sel.jpg similarity index 100% rename from sass/images/css/hmenu-sel.jpg rename to static/images/css/hmenu-sel.jpg diff --git a/sass/images/css/hmenu.jpg b/static/images/css/hmenu.jpg similarity index 100% rename from sass/images/css/hmenu.jpg rename to static/images/css/hmenu.jpg diff --git a/sass/images/css/page-bg.jpg b/static/images/css/page-bg.jpg similarity index 100% rename from sass/images/css/page-bg.jpg rename to static/images/css/page-bg.jpg diff --git a/sass/images/css/page-vbg.jpg b/static/images/css/page-vbg.jpg similarity index 100% rename from sass/images/css/page-vbg.jpg rename to static/images/css/page-vbg.jpg diff --git a/sass/images/css/topBanner-old.xcf b/static/images/css/topBanner-old.xcf similarity index 100% rename from sass/images/css/topBanner-old.xcf rename to static/images/css/topBanner-old.xcf diff --git a/sass/images/css/topBanner.jpg b/static/images/css/topBanner.jpg similarity index 100% rename from sass/images/css/topBanner.jpg rename to static/images/css/topBanner.jpg diff --git a/sass/images/css/topBanner.png b/static/images/css/topBanner.png similarity index 100% rename from sass/images/css/topBanner.png rename to static/images/css/topBanner.png diff --git a/sass/images/css/topBanner.xcf b/static/images/css/topBanner.xcf similarity index 100% rename from sass/images/css/topBanner.xcf rename to static/images/css/topBanner.xcf diff --git a/sass/images/css/topWrapper-bg.jpg b/static/images/css/topWrapper-bg.jpg similarity index 100% rename from sass/images/css/topWrapper-bg.jpg rename to static/images/css/topWrapper-bg.jpg diff --git a/sass/images/ui-bg_flat_0_aaaaaa_40x100.png b/static/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from sass/images/ui-bg_flat_0_aaaaaa_40x100.png rename to static/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/sass/images/ui-bg_flat_0_eeeeee_40x100.png b/static/images/ui-bg_flat_0_eeeeee_40x100.png similarity index 100% rename from sass/images/ui-bg_flat_0_eeeeee_40x100.png rename to static/images/ui-bg_flat_0_eeeeee_40x100.png diff --git a/sass/images/ui-bg_flat_55_ffffff_40x100.png b/static/images/ui-bg_flat_55_ffffff_40x100.png similarity index 100% rename from sass/images/ui-bg_flat_55_ffffff_40x100.png rename to static/images/ui-bg_flat_55_ffffff_40x100.png diff --git a/sass/images/ui-bg_flat_75_ffffff_40x100.png b/static/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from sass/images/ui-bg_flat_75_ffffff_40x100.png rename to static/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/sass/images/ui-bg_glass_65_023063_1x400.png b/static/images/ui-bg_glass_65_023063_1x400.png similarity index 100% rename from sass/images/ui-bg_glass_65_023063_1x400.png rename to static/images/ui-bg_glass_65_023063_1x400.png diff --git a/sass/images/ui-bg_glass_65_ffffff_1x400.png b/static/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from sass/images/ui-bg_glass_65_ffffff_1x400.png rename to static/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/sass/images/ui-bg_highlight-soft_100_7fbcdf_1x100.png b/static/images/ui-bg_highlight-soft_100_7fbcdf_1x100.png similarity index 100% rename from sass/images/ui-bg_highlight-soft_100_7fbcdf_1x100.png rename to static/images/ui-bg_highlight-soft_100_7fbcdf_1x100.png diff --git a/sass/images/ui-bg_highlight-soft_100_bddeff_1x100.png b/static/images/ui-bg_highlight-soft_100_bddeff_1x100.png similarity index 100% rename from sass/images/ui-bg_highlight-soft_100_bddeff_1x100.png rename to static/images/ui-bg_highlight-soft_100_bddeff_1x100.png diff --git a/sass/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png b/static/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png similarity index 100% rename from sass/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png rename to static/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png diff --git a/sass/images/ui-bg_highlight-soft_25_7fbcdf_1x100.png b/static/images/ui-bg_highlight-soft_25_7fbcdf_1x100.png similarity index 100% rename from sass/images/ui-bg_highlight-soft_25_7fbcdf_1x100.png rename to static/images/ui-bg_highlight-soft_25_7fbcdf_1x100.png diff --git a/sass/images/ui-bg_highlight-soft_25_bddeff_1x100.png b/static/images/ui-bg_highlight-soft_25_bddeff_1x100.png similarity index 100% rename from sass/images/ui-bg_highlight-soft_25_bddeff_1x100.png rename to static/images/ui-bg_highlight-soft_25_bddeff_1x100.png diff --git a/sass/images/ui-bg_highlight-soft_50_7fbcfd_1x100.png b/static/images/ui-bg_highlight-soft_50_7fbcfd_1x100.png similarity index 100% rename from sass/images/ui-bg_highlight-soft_50_7fbcfd_1x100.png rename to static/images/ui-bg_highlight-soft_50_7fbcfd_1x100.png diff --git a/sass/images/ui-icons_031634_256x240.png b/static/images/ui-icons_031634_256x240.png similarity index 100% rename from sass/images/ui-icons_031634_256x240.png rename to static/images/ui-icons_031634_256x240.png diff --git a/sass/images/ui-icons_454545_256x240.png b/static/images/ui-icons_454545_256x240.png similarity index 100% rename from sass/images/ui-icons_454545_256x240.png rename to static/images/ui-icons_454545_256x240.png diff --git a/sass/images/ui-icons_adcc80_256x240.png b/static/images/ui-icons_adcc80_256x240.png similarity index 100% rename from sass/images/ui-icons_adcc80_256x240.png rename to static/images/ui-icons_adcc80_256x240.png diff --git a/sass/images/ui-icons_fa720a_256x240.png b/static/images/ui-icons_fa720a_256x240.png similarity index 100% rename from sass/images/ui-icons_fa720a_256x240.png rename to static/images/ui-icons_fa720a_256x240.png diff --git a/sass/images/ui-icons_ffffff_256x240.png b/static/images/ui-icons_ffffff_256x240.png similarity index 100% rename from sass/images/ui-icons_ffffff_256x240.png rename to static/images/ui-icons_ffffff_256x240.png diff --git a/static/js/application.js b/static/js/application.js deleted file mode 100644 index 876a926ff3..0000000000 --- a/static/js/application.js +++ /dev/null @@ -1,121 +0,0 @@ -// Generated by CoffeeScript 1.3.2-pre -(function() { - - window.Calculator = (function() { - - function Calculator() {} - - Calculator.bind = function() { - var calculator; - calculator = new Calculator; - $('.calc').click(calculator.toggle); - $('form#calculator').submit(calculator.calculate).submit(function(e) { - return e.preventDefault(); - }); - return $('div.help-wrapper a').hover(calculator.helpToggle).click(function(e) { - return e.preventDefault(); - }); - }; - - Calculator.prototype.toggle = function() { - $('li.calc-main').toggleClass('open'); - $('#calculator_wrapper #calculator_input').focus(); - return $('.calc').toggleClass('closed'); - }; - - Calculator.prototype.helpToggle = function() { - return $('.help').toggleClass('shown'); - }; - - Calculator.prototype.calculate = function() { - return $.getJSON('/calculate', { - equation: $('#calculator_input').val() - }, function(data) { - return $('#calculator_output').val(data.result); - }); - }; - - return Calculator; - - })(); - - window.Courseware = (function() { - - function Courseware() {} - - Courseware.bind = function() { - return this.Navigation.bind(); - }; - - Courseware.Navigation = (function() { - - function Navigation() {} - - Navigation.bind = function() { - var active, navigation; - if ($('#accordion').length) { - navigation = new Navigation; - active = $('#accordion ul:has(li.active)').index('#accordion ul'); - $('#accordion').bind('accordionchange', navigation.log).accordion({ - active: active >= 0 ? active : 1, - header: 'h3', - autoHeight: false - }); - return $('#open_close_accordion a').click(navigation.toggle); - } - }; - - Navigation.prototype.log = function(event, ui) { - return log_event('accordion', { - newheader: ui.newHeader.text(), - oldheader: ui.oldHeader.text() - }); - }; - - Navigation.prototype.toggle = function() { - return $('.course-wrapper').toggleClass('closed'); - }; - - return Navigation; - - })(); - - return Courseware; - - }).call(this); - - window.FeedbackForm = (function() { - - function FeedbackForm() {} - - FeedbackForm.bind = function() { - return $('#feedback_button').click(function() { - var data; - data = { - subject: $('#feedback_subject').val(), - message: $('#feedback_message').val(), - url: window.location.href - }; - return $.post('/send_feedback', data, function() { - return $('#feedback_div').html('Feedback submitted. Thank you'); - }, 'json'); - }); - }; - - return FeedbackForm; - - })(); - - $(function() { - $.ajaxSetup({ - headers: { - 'X-CSRFToken': $.cookie('csrftoken') - } - }); - Calculator.bind(); - Courseware.bind(); - FeedbackForm.bind(); - return $("a[rel*=leanModal]").leanModal(); - }); - -}).call(this); diff --git a/sass/.gitignore b/static/sass/.gitignore similarity index 100% rename from sass/.gitignore rename to static/sass/.gitignore diff --git a/templates/sass/README.md b/static/sass/README.md similarity index 59% rename from templates/sass/README.md rename to static/sass/README.md index 3ef12cc71c..24a1f17bce 100644 --- a/templates/sass/README.md +++ b/static/sass/README.md @@ -24,15 +24,4 @@ If you already install all the dependencies using Bundler, you can just do: $ bundle exec guard -This will generate the sass file for development which some debugging -information. - -### Before Commit - -Since this compiled style you're going to push are going to be used on live -production site, you're encouraged to compress all of the style to save some -bandwidth. You can do that by run this command: - - $ bundle exec guard -g production - -Guard will watch your directory and generated a compressed version of CSS. +This will execute `django-admin collectstatic`, which will compile the sass files diff --git a/sass/_gradebook.scss b/static/sass/_gradebook.scss similarity index 100% rename from sass/_gradebook.scss rename to static/sass/_gradebook.scss diff --git a/sass/_help.scss b/static/sass/_help.scss similarity index 100% rename from sass/_help.scss rename to static/sass/_help.scss diff --git a/sass/_info.scss b/static/sass/_info.scss similarity index 100% rename from sass/_info.scss rename to static/sass/_info.scss diff --git a/sass/_profile.scss b/static/sass/_profile.scss similarity index 100% rename from sass/_profile.scss rename to static/sass/_profile.scss diff --git a/sass/_textbook.scss b/static/sass/_textbook.scss similarity index 100% rename from sass/_textbook.scss rename to static/sass/_textbook.scss diff --git a/sass/application.scss b/static/sass/application.scss similarity index 100% rename from sass/application.scss rename to static/sass/application.scss diff --git a/sass/base/_base.scss b/static/sass/base/_base.scss similarity index 100% rename from sass/base/_base.scss rename to static/sass/base/_base.scss diff --git a/sass/base/_extends.scss b/static/sass/base/_extends.scss similarity index 98% rename from sass/base/_extends.scss rename to static/sass/base/_extends.scss index 1b46231e35..4626afc2fa 100644 --- a/sass/base/_extends.scss +++ b/static/sass/base/_extends.scss @@ -141,7 +141,7 @@ h1.top-header { } span.ui-icon { - background-image: url(images/ui-icons_454545_256x240.png); + background-image: url(../images/ui-icons_454545_256x240.png); } &.active { diff --git a/sass/base/_font-face.scss b/static/sass/base/_font-face.scss similarity index 100% rename from sass/base/_font-face.scss rename to static/sass/base/_font-face.scss diff --git a/sass/base/_functions.scss b/static/sass/base/_functions.scss similarity index 100% rename from sass/base/_functions.scss rename to static/sass/base/_functions.scss diff --git a/sass/base/_reset.scss b/static/sass/base/_reset.scss similarity index 100% rename from sass/base/_reset.scss rename to static/sass/base/_reset.scss diff --git a/sass/base/_variables.scss b/static/sass/base/_variables.scss similarity index 100% rename from sass/base/_variables.scss rename to static/sass/base/_variables.scss diff --git a/sass/bourbon/_bourbon.scss b/static/sass/bourbon/_bourbon.scss similarity index 100% rename from sass/bourbon/_bourbon.scss rename to static/sass/bourbon/_bourbon.scss diff --git a/sass/bourbon/addons/_button.scss b/static/sass/bourbon/addons/_button.scss similarity index 100% rename from sass/bourbon/addons/_button.scss rename to static/sass/bourbon/addons/_button.scss diff --git a/sass/bourbon/addons/_clearfix.scss b/static/sass/bourbon/addons/_clearfix.scss similarity index 100% rename from sass/bourbon/addons/_clearfix.scss rename to static/sass/bourbon/addons/_clearfix.scss diff --git a/sass/bourbon/addons/_font-family.scss b/static/sass/bourbon/addons/_font-family.scss similarity index 100% rename from sass/bourbon/addons/_font-family.scss rename to static/sass/bourbon/addons/_font-family.scss diff --git a/sass/bourbon/addons/_html5-input-types.scss b/static/sass/bourbon/addons/_html5-input-types.scss similarity index 100% rename from sass/bourbon/addons/_html5-input-types.scss rename to static/sass/bourbon/addons/_html5-input-types.scss diff --git a/sass/bourbon/addons/_position.scss b/static/sass/bourbon/addons/_position.scss similarity index 100% rename from sass/bourbon/addons/_position.scss rename to static/sass/bourbon/addons/_position.scss diff --git a/sass/bourbon/addons/_timing-functions.scss b/static/sass/bourbon/addons/_timing-functions.scss similarity index 100% rename from sass/bourbon/addons/_timing-functions.scss rename to static/sass/bourbon/addons/_timing-functions.scss diff --git a/sass/bourbon/css3/_animation.scss b/static/sass/bourbon/css3/_animation.scss similarity index 100% rename from sass/bourbon/css3/_animation.scss rename to static/sass/bourbon/css3/_animation.scss diff --git a/sass/bourbon/css3/_appearance.scss b/static/sass/bourbon/css3/_appearance.scss similarity index 100% rename from sass/bourbon/css3/_appearance.scss rename to static/sass/bourbon/css3/_appearance.scss diff --git a/sass/bourbon/css3/_background-image.scss b/static/sass/bourbon/css3/_background-image.scss similarity index 100% rename from sass/bourbon/css3/_background-image.scss rename to static/sass/bourbon/css3/_background-image.scss diff --git a/sass/bourbon/css3/_background-size.scss b/static/sass/bourbon/css3/_background-size.scss similarity index 100% rename from sass/bourbon/css3/_background-size.scss rename to static/sass/bourbon/css3/_background-size.scss diff --git a/sass/bourbon/css3/_border-image.scss b/static/sass/bourbon/css3/_border-image.scss similarity index 100% rename from sass/bourbon/css3/_border-image.scss rename to static/sass/bourbon/css3/_border-image.scss diff --git a/sass/bourbon/css3/_border-radius.scss b/static/sass/bourbon/css3/_border-radius.scss similarity index 100% rename from sass/bourbon/css3/_border-radius.scss rename to static/sass/bourbon/css3/_border-radius.scss diff --git a/sass/bourbon/css3/_box-shadow.scss b/static/sass/bourbon/css3/_box-shadow.scss similarity index 100% rename from sass/bourbon/css3/_box-shadow.scss rename to static/sass/bourbon/css3/_box-shadow.scss diff --git a/sass/bourbon/css3/_box-sizing.scss b/static/sass/bourbon/css3/_box-sizing.scss similarity index 100% rename from sass/bourbon/css3/_box-sizing.scss rename to static/sass/bourbon/css3/_box-sizing.scss diff --git a/sass/bourbon/css3/_columns.scss b/static/sass/bourbon/css3/_columns.scss similarity index 100% rename from sass/bourbon/css3/_columns.scss rename to static/sass/bourbon/css3/_columns.scss diff --git a/sass/bourbon/css3/_flex-box.scss b/static/sass/bourbon/css3/_flex-box.scss similarity index 100% rename from sass/bourbon/css3/_flex-box.scss rename to static/sass/bourbon/css3/_flex-box.scss diff --git a/sass/bourbon/css3/_inline-block.scss b/static/sass/bourbon/css3/_inline-block.scss similarity index 100% rename from sass/bourbon/css3/_inline-block.scss rename to static/sass/bourbon/css3/_inline-block.scss diff --git a/sass/bourbon/css3/_linear-gradient.scss b/static/sass/bourbon/css3/_linear-gradient.scss similarity index 100% rename from sass/bourbon/css3/_linear-gradient.scss rename to static/sass/bourbon/css3/_linear-gradient.scss diff --git a/sass/bourbon/css3/_radial-gradient.scss b/static/sass/bourbon/css3/_radial-gradient.scss similarity index 100% rename from sass/bourbon/css3/_radial-gradient.scss rename to static/sass/bourbon/css3/_radial-gradient.scss diff --git a/sass/bourbon/css3/_transform.scss b/static/sass/bourbon/css3/_transform.scss similarity index 100% rename from sass/bourbon/css3/_transform.scss rename to static/sass/bourbon/css3/_transform.scss diff --git a/sass/bourbon/css3/_transition.scss b/static/sass/bourbon/css3/_transition.scss similarity index 100% rename from sass/bourbon/css3/_transition.scss rename to static/sass/bourbon/css3/_transition.scss diff --git a/sass/bourbon/css3/_user-select.scss b/static/sass/bourbon/css3/_user-select.scss similarity index 100% rename from sass/bourbon/css3/_user-select.scss rename to static/sass/bourbon/css3/_user-select.scss diff --git a/sass/bourbon/functions/_deprecated-webkit-gradient.scss b/static/sass/bourbon/functions/_deprecated-webkit-gradient.scss similarity index 100% rename from sass/bourbon/functions/_deprecated-webkit-gradient.scss rename to static/sass/bourbon/functions/_deprecated-webkit-gradient.scss diff --git a/sass/bourbon/functions/_flex-grid.scss b/static/sass/bourbon/functions/_flex-grid.scss similarity index 100% rename from sass/bourbon/functions/_flex-grid.scss rename to static/sass/bourbon/functions/_flex-grid.scss diff --git a/sass/bourbon/functions/_grid-width.scss b/static/sass/bourbon/functions/_grid-width.scss similarity index 100% rename from sass/bourbon/functions/_grid-width.scss rename to static/sass/bourbon/functions/_grid-width.scss diff --git a/sass/bourbon/functions/_linear-gradient.scss b/static/sass/bourbon/functions/_linear-gradient.scss similarity index 100% rename from sass/bourbon/functions/_linear-gradient.scss rename to static/sass/bourbon/functions/_linear-gradient.scss diff --git a/sass/bourbon/functions/_modular-scale.scss b/static/sass/bourbon/functions/_modular-scale.scss similarity index 100% rename from sass/bourbon/functions/_modular-scale.scss rename to static/sass/bourbon/functions/_modular-scale.scss diff --git a/sass/bourbon/functions/_radial-gradient.scss b/static/sass/bourbon/functions/_radial-gradient.scss similarity index 100% rename from sass/bourbon/functions/_radial-gradient.scss rename to static/sass/bourbon/functions/_radial-gradient.scss diff --git a/sass/bourbon/functions/_render-gradients.scss b/static/sass/bourbon/functions/_render-gradients.scss similarity index 100% rename from sass/bourbon/functions/_render-gradients.scss rename to static/sass/bourbon/functions/_render-gradients.scss diff --git a/sass/bourbon/functions/_tint-shade.scss b/static/sass/bourbon/functions/_tint-shade.scss similarity index 100% rename from sass/bourbon/functions/_tint-shade.scss rename to static/sass/bourbon/functions/_tint-shade.scss diff --git a/sass/bourbon/lib/bourbon.rb b/static/sass/bourbon/lib/bourbon.rb similarity index 100% rename from sass/bourbon/lib/bourbon.rb rename to static/sass/bourbon/lib/bourbon.rb diff --git a/sass/bourbon/lib/bourbon/sass_extensions.rb b/static/sass/bourbon/lib/bourbon/sass_extensions.rb similarity index 100% rename from sass/bourbon/lib/bourbon/sass_extensions.rb rename to static/sass/bourbon/lib/bourbon/sass_extensions.rb diff --git a/sass/bourbon/lib/bourbon/sass_extensions/functions.rb b/static/sass/bourbon/lib/bourbon/sass_extensions/functions.rb similarity index 100% rename from sass/bourbon/lib/bourbon/sass_extensions/functions.rb rename to static/sass/bourbon/lib/bourbon/sass_extensions/functions.rb diff --git a/sass/bourbon/lib/bourbon/sass_extensions/functions/compact.rb b/static/sass/bourbon/lib/bourbon/sass_extensions/functions/compact.rb similarity index 100% rename from sass/bourbon/lib/bourbon/sass_extensions/functions/compact.rb rename to static/sass/bourbon/lib/bourbon/sass_extensions/functions/compact.rb diff --git a/sass/courseware/_amplifier.scss b/static/sass/courseware/_amplifier.scss similarity index 100% rename from sass/courseware/_amplifier.scss rename to static/sass/courseware/_amplifier.scss diff --git a/sass/courseware/_courseware.scss b/static/sass/courseware/_courseware.scss similarity index 100% rename from sass/courseware/_courseware.scss rename to static/sass/courseware/_courseware.scss diff --git a/sass/courseware/_sequence-nav.scss b/static/sass/courseware/_sequence-nav.scss similarity index 100% rename from sass/courseware/_sequence-nav.scss rename to static/sass/courseware/_sequence-nav.scss diff --git a/sass/courseware/_sidebar.scss b/static/sass/courseware/_sidebar.scss similarity index 100% rename from sass/courseware/_sidebar.scss rename to static/sass/courseware/_sidebar.scss diff --git a/sass/courseware/_video.scss b/static/sass/courseware/_video.scss similarity index 100% rename from sass/courseware/_video.scss rename to static/sass/courseware/_video.scss diff --git a/sass/discussion/_answers.scss b/static/sass/discussion/_answers.scss similarity index 100% rename from sass/discussion/_answers.scss rename to static/sass/discussion/_answers.scss diff --git a/sass/discussion/_askbot-original.scss b/static/sass/discussion/_askbot-original.scss similarity index 100% rename from sass/discussion/_askbot-original.scss rename to static/sass/discussion/_askbot-original.scss diff --git a/sass/discussion/_badges.scss b/static/sass/discussion/_badges.scss similarity index 100% rename from sass/discussion/_badges.scss rename to static/sass/discussion/_badges.scss diff --git a/sass/discussion/_discussion.scss b/static/sass/discussion/_discussion.scss similarity index 100% rename from sass/discussion/_discussion.scss rename to static/sass/discussion/_discussion.scss diff --git a/sass/discussion/_form-wmd-toolbar.scss b/static/sass/discussion/_form-wmd-toolbar.scss similarity index 100% rename from sass/discussion/_form-wmd-toolbar.scss rename to static/sass/discussion/_form-wmd-toolbar.scss diff --git a/sass/discussion/_forms.scss b/static/sass/discussion/_forms.scss similarity index 100% rename from sass/discussion/_forms.scss rename to static/sass/discussion/_forms.scss diff --git a/sass/discussion/_modals.scss b/static/sass/discussion/_modals.scss similarity index 100% rename from sass/discussion/_modals.scss rename to static/sass/discussion/_modals.scss diff --git a/sass/discussion/_profile.scss b/static/sass/discussion/_profile.scss similarity index 100% rename from sass/discussion/_profile.scss rename to static/sass/discussion/_profile.scss diff --git a/sass/discussion/_question-view.scss b/static/sass/discussion/_question-view.scss similarity index 100% rename from sass/discussion/_question-view.scss rename to static/sass/discussion/_question-view.scss diff --git a/sass/discussion/_questions.scss b/static/sass/discussion/_questions.scss similarity index 100% rename from sass/discussion/_questions.scss rename to static/sass/discussion/_questions.scss diff --git a/sass/discussion/_sidebar.scss b/static/sass/discussion/_sidebar.scss similarity index 100% rename from sass/discussion/_sidebar.scss rename to static/sass/discussion/_sidebar.scss diff --git a/sass/discussion/_tags.scss b/static/sass/discussion/_tags.scss similarity index 100% rename from sass/discussion/_tags.scss rename to static/sass/discussion/_tags.scss diff --git a/sass/layout/_calculator.scss b/static/sass/layout/_calculator.scss similarity index 100% rename from sass/layout/_calculator.scss rename to static/sass/layout/_calculator.scss diff --git a/sass/layout/_footer.scss b/static/sass/layout/_footer.scss similarity index 100% rename from sass/layout/_footer.scss rename to static/sass/layout/_footer.scss diff --git a/sass/layout/_header.scss b/static/sass/layout/_header.scss similarity index 100% rename from sass/layout/_header.scss rename to static/sass/layout/_header.scss diff --git a/sass/layout/_layout.scss b/static/sass/layout/_layout.scss similarity index 100% rename from sass/layout/_layout.scss rename to static/sass/layout/_layout.scss diff --git a/sass/layout/_leanmodal.scss b/static/sass/layout/_leanmodal.scss similarity index 100% rename from sass/layout/_leanmodal.scss rename to static/sass/layout/_leanmodal.scss diff --git a/sass/marketing-ie.scss b/static/sass/marketing-ie.scss similarity index 100% rename from sass/marketing-ie.scss rename to static/sass/marketing-ie.scss diff --git a/sass/marketing.scss b/static/sass/marketing.scss similarity index 100% rename from sass/marketing.scss rename to static/sass/marketing.scss diff --git a/sass/marketing/_base.scss b/static/sass/marketing/_base.scss similarity index 100% rename from sass/marketing/_base.scss rename to static/sass/marketing/_base.scss diff --git a/sass/marketing/_extends.scss b/static/sass/marketing/_extends.scss similarity index 100% rename from sass/marketing/_extends.scss rename to static/sass/marketing/_extends.scss diff --git a/sass/marketing/_footer.scss b/static/sass/marketing/_footer.scss similarity index 100% rename from sass/marketing/_footer.scss rename to static/sass/marketing/_footer.scss diff --git a/sass/marketing/_header.scss b/static/sass/marketing/_header.scss similarity index 100% rename from sass/marketing/_header.scss rename to static/sass/marketing/_header.scss diff --git a/sass/marketing/_index.scss b/static/sass/marketing/_index.scss similarity index 100% rename from sass/marketing/_index.scss rename to static/sass/marketing/_index.scss diff --git a/sass/marketing/_variables.scss b/static/sass/marketing/_variables.scss similarity index 100% rename from sass/marketing/_variables.scss rename to static/sass/marketing/_variables.scss diff --git a/sass/plugins/_jquery-ui-1.8.16.custom.scss b/static/sass/plugins/_jquery-ui-1.8.16.custom.scss similarity index 94% rename from sass/plugins/_jquery-ui-1.8.16.custom.scss rename to static/sass/plugins/_jquery-ui-1.8.16.custom.scss index 43847b6441..06fb7fb8f4 100644 --- a/sass/plugins/_jquery-ui-1.8.16.custom.scss +++ b/static/sass/plugins/_jquery-ui-1.8.16.custom.scss @@ -59,26 +59,26 @@ .ui-widget { font-family: Helvetica, Arial, sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Helvetica, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dae5c9; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #031634; } +.ui-widget-content { border: 1px solid #dae5c9; background: #ffffff url(../images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #031634; } .ui-widget-content a { color: #031634; } -.ui-widget-header { border: 1px solid #dae5c9; background: #7fbcfd url(images/ui-bg_highlight-soft_50_7fbcfd_1x100.png) 50% 50% repeat-x; color: #031634; font-weight: bold; } +.ui-widget-header { border: 1px solid #dae5c9; background: #7fbcfd url(../images/ui-bg_highlight-soft_50_7fbcfd_1x100.png) 50% 50% repeat-x; color: #031634; font-weight: bold; } .ui-widget-header a { color: #031634; } /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #dae5c9; background: #7fbcdf url(images/ui-bg_highlight-soft_100_7fbcdf_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #7a994c; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #dae5c9; background: #7fbcdf url(../images/ui-bg_highlight-soft_100_7fbcdf_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #7a994c; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #7a994c; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #7fbcdf; background: #bddeff url(images/ui-bg_highlight-soft_25_bddeff_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #7a994c; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #7fbcdf; background: #bddeff url(../images/ui-bg_highlight-soft_25_bddeff_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #7a994c; } .ui-state-hover a, .ui-state-hover a:hover { color: #7a994c; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #dae5c9; background: #023063 url(images/ui-bg_glass_65_023063_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #dae5c9; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #dae5c9; background: #023063 url(../images/ui-bg_glass_65_023063_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #dae5c9; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #dae5c9; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #cccccc; background: #ffffff url(images/ui-bg_flat_55_ffffff_40x100.png) 50% 50% repeat-x; color: #444444; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #cccccc; background: #ffffff url(../images/ui-bg_flat_55_ffffff_40x100.png) 50% 50% repeat-x; color: #444444; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #444444; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #fa720a; background: #ffffff url(images/ui-bg_flat_55_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #fa720a; background: #ffffff url(../images/ui-bg_flat_55_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #222222; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #222222; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } @@ -89,14 +89,14 @@ ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_adcc80_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_adcc80_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_031634_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_adcc80_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_adcc80_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_adcc80_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fa720a_256x240.png); } +.ui-icon { width: 16px; height: 16px; background-image: url(../images/ui-icons_adcc80_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(../images/ui-icons_adcc80_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(../images/ui-icons_031634_256x240.png); } +.ui-state-default .ui-icon { background-image: url(../images/ui-icons_adcc80_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../images/ui-icons_adcc80_256x240.png); } +.ui-state-active .ui-icon {background-image: url(../images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(../images/ui-icons_adcc80_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../images/ui-icons_fa720a_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } @@ -286,8 +286,8 @@ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 2px; -webkit-border-bottom-right-radius: 2px; -khtml-border-bottom-right-radius: 2px; border-bottom-right-radius: 2px; } /* Overlays */ -.ui-widget-overlay { background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } -.ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 0px; -khtml-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; }/* +.ui-widget-overlay { background: #eeeeee url(../images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } +.ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(../images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 0px; -khtml-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; }/* * jQuery UI Resizable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) diff --git a/sass/plugins/_jquery.qtip.min.scss b/static/sass/plugins/_jquery.qtip.min.scss similarity index 100% rename from sass/plugins/_jquery.qtip.min.scss rename to static/sass/plugins/_jquery.qtip.min.scss diff --git a/sass/print.scss b/static/sass/print.scss similarity index 100% rename from sass/print.scss rename to static/sass/print.scss diff --git a/sass/wiki/_basic-html.scss b/static/sass/wiki/_basic-html.scss similarity index 100% rename from sass/wiki/_basic-html.scss rename to static/sass/wiki/_basic-html.scss diff --git a/sass/wiki/_create.scss b/static/sass/wiki/_create.scss similarity index 100% rename from sass/wiki/_create.scss rename to static/sass/wiki/_create.scss diff --git a/sass/wiki/_sidebar.scss b/static/sass/wiki/_sidebar.scss similarity index 100% rename from sass/wiki/_sidebar.scss rename to static/sass/wiki/_sidebar.scss diff --git a/sass/wiki/_table.scss b/static/sass/wiki/_table.scss similarity index 100% rename from sass/wiki/_table.scss rename to static/sass/wiki/_table.scss diff --git a/sass/wiki/_wiki.scss b/static/sass/wiki/_wiki.scss similarity index 100% rename from sass/wiki/_wiki.scss rename to static/sass/wiki/_wiki.scss diff --git a/urls.py b/urls.py index efbe4b8d62..aef852b99d 100644 --- a/urls.py +++ b/urls.py @@ -1,7 +1,7 @@ from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.contrib import admin -from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.conf.urls.static import static import django.contrib.auth.views @@ -90,4 +90,4 @@ if settings.DEBUG: urlpatterns = patterns(*urlpatterns) if settings.DEBUG: - urlpatterns += staticfiles_urlpatterns() + urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)