Stanford Themeing : paver update_assets doesnt detect theme

579 views
Skip to first unread message

abhilash

unread,
Jul 28, 2016, 11:31:48 PM7/28/16
to Open edX operations
Hello,

I've tried to apply the Stanford theme on our installation of Open Edx, however the paver update_assets scripts haven't been able to enable theming.

How i installed Open Edx 
  1. Server : Freshly installed Ubuntu 12.04 on DigitalOcean droplet.
  2. Installed using the command "wget https://raw.githubusercontent.com/edx/configuration/master/util/install/sandbox.sh -- | bash
  3. Updated required *.json files
How i tried to apply a new theme : 
  1. Made edits to Stanford theme, updated file names to default/_default etc
  2. Placed edited files in folder named 'default'
  3. Moved 'default' folder to "/edx/app/edxapp/themes/"
  4. Updated the fields in lms.env.json
    1. "THEME_NAME": "default"
    2. "USE_CUSTOM_THEME": true
  5. Ran the update_assets paver command, this was the output

  6. ---> pavelib.assets.update_assets
    ---> pavelib.prereqs.install_node_prereqs
    NO_PREREQ_INSTALL is set, not installing prereqs
    xmodule_assets common/static/xmodule
    Finished processing xmodule assets.
    mkdir_p path('common/static/common/js/vendor')
    /bin/cp -rf node_modules/jquery/dist/jquery.js common/static/common/js/vendor
    /bin/cp -rf node_modules/jquery-migrate/dist/jquery-migrate.js common/static/common/js/vendor
    /bin/cp -rf node_modules/jquery.scrollto/jquery.scrollTo.js common/static/common/js/vendor
    /bin/cp -rf node_modules/underscore/underscore.js common/static/common/js/vendor
    /bin/cp -rf node_modules/underscore.string/dist/underscore.string.js common/static/common/js/vendor
    /bin/cp -rf node_modules/picturefill/dist/picturefill.js common/static/common/js/vendor
    /bin/cp -rf node_modules/backbone/backbone.js common/static/common/js/vendor
    /bin/cp -rf node_modules/edx-ui-toolkit/node_modules/backbone.paginator/lib/backbone.paginator.js common/static/common/js/vendor
    /bin/cp -rf node_modules/backbone-validation/dist/backbone-validation-min.js common/static/common/js/vendor
    ---> pavelib.assets.compile_coffeescript
    node_modules/.bin/coffee --compile `find /edx/app/edxapp/edx-platform/lms /edx/app/edxapp/edx-platform/cms /edx/app/edxapp/edx-platform/common -type f -name "*.coffee"`
    python manage.py lms --settings=aws compile_sass lms 
    2016-07-29 08:53:17,472 INFO 31226 [dd.dogapi] dog_stats_api.py:66 - Initializing dog api to use statsd: localhost, 8125
    Skipping theme asset compilation: enable theming to process themed assets
    ---> pavelib.assets.compile_sass
    Started compiling Sass:
    Finished compiling 'common' sass.
    Started compiling 'lms' Sass for 'system'.
    Finished compiling 'lms' Sass for 'system'.
    Finished compiling Sass:
    >> common/static/sass -> common/static/css in 0:00:00.001446s
    >> lms/static/sass -> lms/static/css in 0:01:11.627859s
    >> lms/static/certificates/sass -> lms/static/certificates/css in 0:00:18.956131s

    Successful compilations:
    --- "common" sass files.
    --- lms sass for system.

    python manage.py lms --settings=aws collectstatic --noinput > /dev/null
    2016-07-29 08:54:52,664 INFO 31519 [dd.dogapi] dog_stats_api.py:66 - Initializing dog api to use statsd: localhost, 8125
    Finished collecting lms assets.


  7. Notice the line "Skipping theme asset compilation: enable theming to process themed assets" ? Can anyone please explain why this is so?  

Ernesto Sanchez

unread,
Jul 29, 2016, 6:01:02 PM7/29/16
to Open edX operations

Vinayak Bhat

unread,
Aug 2, 2016, 1:25:12 PM8/2/16
to Open edX operations
Hi,

I have tried similar steps as abhilash and was getting the same issues. Tried what you had suggested but the theme is not applied. 

Nicolas CS

unread,
Aug 4, 2016, 9:23:19 AM8/4/16
to Open edX operations
I am having exactly the same problem, I didn't have it a few days ago using exactly the same steps, maybe there was some change in the repos or anything like that. The guide suggested by Ernesto Sanchez is for comprehensive themming, this error is happening with stanford theming. Please help!!! I have been looking for the solution for two days but it has been useless :'(.

By the way I have a native installation and I also tried modifying the /edx/app/edx_ansible/edx_ansible/playbooks/roles/edxapp/defaults/main.yml file

edxapp_use_custom_theme: true
edxapp_theme_name: 'default'
edxapp_theme_source_repo: 'https://github.com/Stanford-Online/edx-theme.git'
edxapp_theme_version: 'HEAD'

And updating the edx-platform, it download the theme, but does not use it.

Vinayak Bhat

unread,
Aug 7, 2016, 9:13:04 AM8/7/16
to Open edX operations
I was able to sort it out after referring Ernesto Sanchez steps and also after digging through a bit of code in edx-platform sources.
Yes you guessed it right. if you are using latest master, use_custom_theme does not work. I have seen code commits where there they are saying they have removed the use of that flag. I may be wrong here because of being new to codebase but practical experience backs it up :-)

one solution is to modify stanford theming to work with comprehensive theming. See https://github.com/edx/edx-platform/tree/master/themes The instructions at the bottom should indicate you the usage. But they did not exactly work for me.. I had to do some changes to the stanford theme and steps were a bit different :
  1. lms-main.scss seemed to have been split to lms-main-v1.scss and lms-main-v2.scss. so is the case with lis-main-rtl.scss. so you will have to repeat it for both these files.
  2. Instead of  $static-path: '../../../..';@import 'lms/static/sass/lms-main';@import '_default';  i used  @import 'default';@import '/edx/app/edxapp/edx-platform/lms/static/sass/lms-main-v1'; etc. I did not get the relative paths correct a couple of times so went with full path. so this may not work on all installations. mine was a native 12.04 ubuntu installation of edx
  3. changed stanford themes theme-header.html to header.html
  4. also i had to change the path of $homepage-bg-image: url('../themes/default/images/sunrise.jpg'); in _default.scss to $homepage-bg-image: url('default/images/sunrise.jpg'); Any image references were changed similarly
  5. update the assets using paver command and the theme was applied on lms.
Regards,
Vinayak
Reply all
Reply to author
Forward
0 new messages