diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 974f4cdeb3..e4febee949 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,7 @@ Changelog * Refactored the way forms are constructed for the page editor, to allow custom forms to be used * Notification message on publish now indicates whether the page is being published now or scheduled for publication in future (Chris Rogers) * Server errors when uploading images / documents through the chooser modal are now reported back to the user (Nigel Fletton) + * Added a hook `insert_global_admin_css` for inserting custom CSS throughout the admin backend (Tom Dyson) * New translations for Hungarian, Swedish (Sweden) and Turkish * Fix: Custom page managers no longer raise an error when used on an abstract model * Fix: Wagtail's migrations are now all reversible (benjaoming) diff --git a/docs/reference/hooks.rst b/docs/reference/hooks.rst index 12a4c90a84..ac5023b6ab 100644 --- a/docs/reference/hooks.rst +++ b/docs/reference/hooks.rst @@ -244,6 +244,27 @@ Hooks for customising the editing interface for pages and snippets. + 'demo/css/vendor/font-awesome/css/font-awesome.min.css">') +.. _insert_global_admin_css: + +``insert_global_admin_css`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Add additional CSS files or snippets to all admin pages. + +.. code-block:: python + + from django.utils.html import format_html + from django.conf import settings + + from wagtail.wagtailcore import hooks + + @hooks.register('insert_global_admin_css') + def global_admin_css(): + return format_html('') + + .. _insert_editor_js: ``insert_editor_js`` diff --git a/docs/releases/1.4.rst b/docs/releases/1.4.rst index 1df2411b89..203db6fb9c 100644 --- a/docs/releases/1.4.rst +++ b/docs/releases/1.4.rst @@ -48,6 +48,7 @@ Minor features * Refactored the way forms are constructed for the page editor, to allow custom forms to be used * Notification message on publish now indicates whether the page is being published now or scheduled for publication in future (Chris Rogers) * Server errors when uploading images / documents through the chooser modal are now reported back to the user (Nigel Fletton) + * Added a hook ``insert_global_admin_css`` for inserting custom CSS throughout the admin backend (Tom Dyson) * New translations for Hungarian, Swedish (Sweden) and Turkish diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/admin_base.html b/wagtail/wagtailadmin/templates/wagtailadmin/admin_base.html index cc370eb37d..74dcc5ca1c 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/admin_base.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/admin_base.html @@ -5,6 +5,7 @@ + {% hook_output 'insert_global_admin_css' %} {% block extra_css %}{% endblock %} {% endblock %}