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
This commit is contained in:
Diana Whitten 2015-07-27 15:59:14 -07:00
parent 55d88786fd
commit fa84424524
19 changed files with 8 additions and 7 deletions

View File

@ -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::

View File

@ -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