From fa844245249be52e6d3a766c9ceac22ec3efcc11 Mon Sep 17 00:00:00 2001 From: Diana Whitten Date: Mon, 27 Jul 2015 15:59:14 -0700 Subject: [PATCH] Themes should live at root of openstack_dashboard Recent changes to Horizon Themes has broadened the scope of simply containing only static files. Themes can now house simple Django overrides and as such, should not be located under '/static' by default any longer. Change-Id: Ifbf4cf65e063a2f5342d9cfdc82287a827789e93 Partially-Implements: blueprint horizon-theme-css-reorg --- doc/source/topics/settings.rst | 11 ++++++----- openstack_dashboard/settings.py | 4 ++-- .../{static => }/themes/blue/static/_styles.scss | 0 .../{static => }/themes/blue/static/_variables.scss | 0 .../themes/blue/static/bootstrap/_styles.scss | 0 .../themes/blue/static/bootstrap/_variables.scss | 0 .../themes/blue/static/horizon/_styles.scss | 0 .../themes/blue/static/horizon/_variables.scss | 0 .../{static => }/themes/blue/templates/_header.html | 0 .../blue/templates/context_selection/_overview.html | 0 .../templates/context_selection/_project_list.html | 0 .../{static => }/themes/default/_styles.scss | 0 .../{static => }/themes/default/_variables.scss | 0 .../themes/default/bootstrap/_styles.scss | 0 .../themes/default/bootstrap/_variables.scss | 0 .../{static => }/themes/default/horizon/_styles.scss | 0 .../themes/default/horizon/_variables.scss | 0 .../{static => }/themes/webroot/_styles.scss | 0 .../{static => }/themes/webroot/_variables.scss | 0 19 files changed, 8 insertions(+), 7 deletions(-) rename openstack_dashboard/{static => }/themes/blue/static/_styles.scss (100%) rename openstack_dashboard/{static => }/themes/blue/static/_variables.scss (100%) rename openstack_dashboard/{static => }/themes/blue/static/bootstrap/_styles.scss (100%) rename openstack_dashboard/{static => }/themes/blue/static/bootstrap/_variables.scss (100%) rename openstack_dashboard/{static => }/themes/blue/static/horizon/_styles.scss (100%) rename openstack_dashboard/{static => }/themes/blue/static/horizon/_variables.scss (100%) rename openstack_dashboard/{static => }/themes/blue/templates/_header.html (100%) rename openstack_dashboard/{static => }/themes/blue/templates/context_selection/_overview.html (100%) rename openstack_dashboard/{static => }/themes/blue/templates/context_selection/_project_list.html (100%) rename openstack_dashboard/{static => }/themes/default/_styles.scss (100%) rename openstack_dashboard/{static => }/themes/default/_variables.scss (100%) rename openstack_dashboard/{static => }/themes/default/bootstrap/_styles.scss (100%) rename openstack_dashboard/{static => }/themes/default/bootstrap/_variables.scss (100%) rename openstack_dashboard/{static => }/themes/default/horizon/_styles.scss (100%) rename openstack_dashboard/{static => }/themes/default/horizon/_variables.scss (100%) rename openstack_dashboard/{static => }/themes/webroot/_styles.scss (100%) rename openstack_dashboard/{static => }/themes/webroot/_variables.scss (100%) diff --git a/doc/source/topics/settings.rst b/doc/source/topics/settings.rst index b2fa2626e7..2f947572a7 100755 --- a/doc/source/topics/settings.rst +++ b/doc/source/topics/settings.rst @@ -398,13 +398,14 @@ This example sorts flavors by vcpus in descending order:: .. versionadded:: 2015.1(Kilo) -Default: ``"static/themes/default"`` +Default: ``"themes/default"`` This setting allows Horizon to use a custom theme. The theme folder should contain one _variables.scss file and one _styles.scss file. -_variables.scss contains all the bootstrap and horizon specific variables -which are used to style the GUI. Whereas _styles.scss contains extra styling. -For example themes, see: /horizon/openstack_dashboard/static/themes/ +_variables.scss contains or must import all the bootstrap and horizon +specific variables which are used to style the GUI. Whereas _styles.scss +contains extra styling. For example themes, see: +/horizon/openstack_dashboard/themes/ If the static theme folder also contains a sub-folder 'templates', then the path to that sub-folder will be prepended to TEMPLATE_DIRS tuple @@ -1042,7 +1043,7 @@ Make sure you run ``python manage.py collectstatic`` and ``python manage.py compress`` after you change the ``_variables.scss`` file. For your convenience, a custom theme for only setting the web root has been -provided see: ``"/horizon/openstack_dashboard/static/themes/webroot"`` +provided see: ``"/horizon/openstack_dashboard/themes/webroot"`` .. note:: diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py index 3d32835557..cb3a0dea98 100644 --- a/openstack_dashboard/settings.py +++ b/openstack_dashboard/settings.py @@ -262,7 +262,7 @@ ADD_INSTALLED_APPS = [] # STATIC directory for custom theme, set as default. # It can be overridden in local_settings.py -CUSTOM_THEME_PATH = 'static/themes/default' +CUSTOM_THEME_PATH = 'themes/default' try: from local.local_settings import * # noqa @@ -295,7 +295,7 @@ CUSTOM_THEME = os.path.join(ROOT_PATH, CUSTOM_THEME_PATH) # it to our first-come, first-serve TEMPLATE_DIRS if os.path.exists(os.path.join(CUSTOM_THEME, 'templates')): TEMPLATE_DIRS = \ - (os.path.join(CUSTOM_THEME_PATH, 'templates'),) + TEMPLATE_DIRS + (os.path.join(CUSTOM_THEME, 'templates'),) + TEMPLATE_DIRS # Only expose the subdirectory 'static' if it exists from a custom theme, # allowing other logic to live with a theme that we might not want to expose diff --git a/openstack_dashboard/static/themes/blue/static/_styles.scss b/openstack_dashboard/themes/blue/static/_styles.scss similarity index 100% rename from openstack_dashboard/static/themes/blue/static/_styles.scss rename to openstack_dashboard/themes/blue/static/_styles.scss diff --git a/openstack_dashboard/static/themes/blue/static/_variables.scss b/openstack_dashboard/themes/blue/static/_variables.scss similarity index 100% rename from openstack_dashboard/static/themes/blue/static/_variables.scss rename to openstack_dashboard/themes/blue/static/_variables.scss diff --git a/openstack_dashboard/static/themes/blue/static/bootstrap/_styles.scss b/openstack_dashboard/themes/blue/static/bootstrap/_styles.scss similarity index 100% rename from openstack_dashboard/static/themes/blue/static/bootstrap/_styles.scss rename to openstack_dashboard/themes/blue/static/bootstrap/_styles.scss diff --git a/openstack_dashboard/static/themes/blue/static/bootstrap/_variables.scss b/openstack_dashboard/themes/blue/static/bootstrap/_variables.scss similarity index 100% rename from openstack_dashboard/static/themes/blue/static/bootstrap/_variables.scss rename to openstack_dashboard/themes/blue/static/bootstrap/_variables.scss diff --git a/openstack_dashboard/static/themes/blue/static/horizon/_styles.scss b/openstack_dashboard/themes/blue/static/horizon/_styles.scss similarity index 100% rename from openstack_dashboard/static/themes/blue/static/horizon/_styles.scss rename to openstack_dashboard/themes/blue/static/horizon/_styles.scss diff --git a/openstack_dashboard/static/themes/blue/static/horizon/_variables.scss b/openstack_dashboard/themes/blue/static/horizon/_variables.scss similarity index 100% rename from openstack_dashboard/static/themes/blue/static/horizon/_variables.scss rename to openstack_dashboard/themes/blue/static/horizon/_variables.scss diff --git a/openstack_dashboard/static/themes/blue/templates/_header.html b/openstack_dashboard/themes/blue/templates/_header.html similarity index 100% rename from openstack_dashboard/static/themes/blue/templates/_header.html rename to openstack_dashboard/themes/blue/templates/_header.html diff --git a/openstack_dashboard/static/themes/blue/templates/context_selection/_overview.html b/openstack_dashboard/themes/blue/templates/context_selection/_overview.html similarity index 100% rename from openstack_dashboard/static/themes/blue/templates/context_selection/_overview.html rename to openstack_dashboard/themes/blue/templates/context_selection/_overview.html diff --git a/openstack_dashboard/static/themes/blue/templates/context_selection/_project_list.html b/openstack_dashboard/themes/blue/templates/context_selection/_project_list.html similarity index 100% rename from openstack_dashboard/static/themes/blue/templates/context_selection/_project_list.html rename to openstack_dashboard/themes/blue/templates/context_selection/_project_list.html diff --git a/openstack_dashboard/static/themes/default/_styles.scss b/openstack_dashboard/themes/default/_styles.scss similarity index 100% rename from openstack_dashboard/static/themes/default/_styles.scss rename to openstack_dashboard/themes/default/_styles.scss diff --git a/openstack_dashboard/static/themes/default/_variables.scss b/openstack_dashboard/themes/default/_variables.scss similarity index 100% rename from openstack_dashboard/static/themes/default/_variables.scss rename to openstack_dashboard/themes/default/_variables.scss diff --git a/openstack_dashboard/static/themes/default/bootstrap/_styles.scss b/openstack_dashboard/themes/default/bootstrap/_styles.scss similarity index 100% rename from openstack_dashboard/static/themes/default/bootstrap/_styles.scss rename to openstack_dashboard/themes/default/bootstrap/_styles.scss diff --git a/openstack_dashboard/static/themes/default/bootstrap/_variables.scss b/openstack_dashboard/themes/default/bootstrap/_variables.scss similarity index 100% rename from openstack_dashboard/static/themes/default/bootstrap/_variables.scss rename to openstack_dashboard/themes/default/bootstrap/_variables.scss diff --git a/openstack_dashboard/static/themes/default/horizon/_styles.scss b/openstack_dashboard/themes/default/horizon/_styles.scss similarity index 100% rename from openstack_dashboard/static/themes/default/horizon/_styles.scss rename to openstack_dashboard/themes/default/horizon/_styles.scss diff --git a/openstack_dashboard/static/themes/default/horizon/_variables.scss b/openstack_dashboard/themes/default/horizon/_variables.scss similarity index 100% rename from openstack_dashboard/static/themes/default/horizon/_variables.scss rename to openstack_dashboard/themes/default/horizon/_variables.scss diff --git a/openstack_dashboard/static/themes/webroot/_styles.scss b/openstack_dashboard/themes/webroot/_styles.scss similarity index 100% rename from openstack_dashboard/static/themes/webroot/_styles.scss rename to openstack_dashboard/themes/webroot/_styles.scss diff --git a/openstack_dashboard/static/themes/webroot/_variables.scss b/openstack_dashboard/themes/webroot/_variables.scss similarity index 100% rename from openstack_dashboard/static/themes/webroot/_variables.scss rename to openstack_dashboard/themes/webroot/_variables.scss