diff --git a/CHANGELOG.md b/CHANGELOG.md index 4926aad..43f172b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog +- 2018-11-28 [Feature] Enable comprehensive theming! - 2018-11-28 [Improvement] Get rid of datadog - 2018-11-28 [Improvement] Upgrade docker images to ubuntu 18.04 for android, forum, notes, xqueue - 2018-11-28 [Feature] Make it possible to define default platform language interactively diff --git a/README.md b/README.md index 30fbb32..98e0593 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,14 @@ The images are built, tagged and uploaded to Docker Hub in one command: ## Help/Troubleshooting +### How to add custom themes? + +Comprehensive theming is enabled by default. Just drop your themes in `data/themes` and compile assets: + + make assets + +Then, follow the [Open edX documentation to enable your themes](https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/changing_appearance/theming/enable_themes.html#apply-a-theme-to-a-site). + ### How to add extra XBlocks to the LMS/CMS? Additional requirements can be added to the `openedx/requirements/private.txt` file. Then, the `openedx` docker image must be rebuilt to include the new requirements. For instance: diff --git a/configurator/templates/openedx/cms.env.json b/configurator/templates/openedx/cms.env.json index a0683df..1084eec 100644 --- a/configurator/templates/openedx/cms.env.json +++ b/configurator/templates/openedx/cms.env.json @@ -18,6 +18,7 @@ "CONTACT_EMAIL": "{{ CONTACT_EMAIL }}", "CELERY_BROKER_HOSTNAME": "rabbitmq", "CELERY_BROKER_TRANSPORT": "amqp", + "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], "MEDIA_ROOT": "/openedx/data/uploads/", "STATIC_ROOT_BASE": "/openedx/data/staticfiles", "ELASTIC_SEARCH_CONFIG": [{ diff --git a/configurator/templates/openedx/lms.env.json b/configurator/templates/openedx/lms.env.json index 55457ab..77c0be2 100644 --- a/configurator/templates/openedx/lms.env.json +++ b/configurator/templates/openedx/lms.env.json @@ -22,6 +22,7 @@ "CELERY_BROKER_TRANSPORT": "amqp", "COMMENTS_SERVICE_URL": "http://forum:4567", "COMMENTS_SERVICE_KEY": "forumapikey", + "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], "MEDIA_ROOT": "/openedx/data/uploads/", "STATIC_ROOT_BASE": "/openedx/data/staticfiles", "ELASTIC_SEARCH_CONFIG": [{ diff --git a/configurator/templates/openedx/universal/cms/production.py b/configurator/templates/openedx/universal/cms/production.py index db0a7e8..8ab1f29 100644 --- a/configurator/templates/openedx/universal/cms/production.py +++ b/configurator/templates/openedx/universal/cms/production.py @@ -1,4 +1,3 @@ -import os from ..aws import * INSTALLED_APPS.remove('openedx.core.djangoapps.datadog.apps.DatadogConfig') @@ -15,11 +14,6 @@ LOGGING['handlers']['tracking'] = { 'formatter': 'standard', } -# Create folders if necessary -for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]: - if not os.path.exists(folder): - os.makedirs(folder) - ALLOWED_HOSTS = [ ENV_TOKENS.get('CMS_BASE'), '127.0.0.1', 'localhost', 'studio.localhost', @@ -30,3 +24,9 @@ ALLOWED_HOSTS = [ DEFAULT_FROM_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] SERVER_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] + +# Create folders if necessary +import os +for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]: + if not os.path.exists(folder): + os.makedirs(folder) diff --git a/docker-compose.yml b/docker-compose.yml index 446be3d..9b9c726 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,6 +87,7 @@ services: volumes: - ./config/openedx:/openedx/config - ./data/lms:/openedx/data + - ./data/themes:/openedx/themes depends_on: - elasticsearch - forum @@ -106,6 +107,7 @@ services: volumes: - ./config/openedx:/openedx/config - ./data/cms:/openedx/data + - ./data/themes:/openedx/themes depends_on: - memcached - mongodb @@ -128,6 +130,7 @@ services: volumes: - ./config/openedx:/openedx/config - ./data/lms:/openedx/data + - ./data/themes:/openedx/themes depends_on: - lms @@ -143,5 +146,6 @@ services: volumes: - ./config/openedx:/openedx/config - ./data/cms:/openedx/data + - ./data/themes:/openedx/themes depends_on: - cms diff --git a/openedx/Dockerfile b/openedx/Dockerfile index f17c2d4..3f7e1d0 100644 --- a/openedx/Dockerfile +++ b/openedx/Dockerfile @@ -16,9 +16,9 @@ RUN apt update && \ # This replaces the "nodeenv" install. RUN apt install -y nodejs-legacy -# Static assets will reside in /openedx/data and edx-platform will be -# checked-out in /openedx/ -RUN mkdir /openedx /openedx/data /openedx/edx-platform +# Static assets will reside in /openedx/data, themes in /openedx/themes and +# edx-platform will be checked-out in /openedx/ +RUN mkdir /openedx /openedx/data /openedx/themes /openedx/edx-platform WORKDIR /openedx/edx-platform ## Checkout edx-platform code