diff --git a/doc/source/topics/settings.rst b/doc/source/topics/settings.rst index 2f947572a7..844738530b 100755 --- a/doc/source/topics/settings.rst +++ b/doc/source/topics/settings.rst @@ -411,6 +411,11 @@ 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 to allow for theme specific template customizations. +If the theme folder (or its static folder) contain an 'img' directory, +then all images contained within dashboard/img can be overridden by providing +a file with the same name. This makes it very easy to customize logo.png, +logo-splash.png and favicon.ico. + ``DROPDOWN_MAX_ITEMS`` ---------------------- diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py index cb3a0dea98..b0bcb5a5e6 100644 --- a/openstack_dashboard/settings.py +++ b/openstack_dashboard/settings.py @@ -307,6 +307,13 @@ STATICFILES_DIRS.append( ('custom', CUSTOM_THEME), ) +# Load the subdirectory 'img' of a custom theme if it exists, thereby allowing +# very granular theme overrides of all dashboard img files using the first-come +# first-serve filesystem loader. +if os.path.exists(os.path.join(CUSTOM_THEME, 'img')): + STATICFILES_DIRS.insert(0, ('dashboard/img', + os.path.join(CUSTOM_THEME, 'img'))) + # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates. find_static_files(ROOT_PATH, HORIZON_CONFIG)