From 581ad54d5f1d57d385feaaf47edd48bcf27ea79c Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Tue, 23 Oct 2018 22:10:52 -0500 Subject: [PATCH] Let the base.mak template be overrideable by Pyramid's API --- src/pgwui_common/configure.py | 4 ++++ src/pgwui_common/templates/auth_base.mak | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pgwui_common/configure.py b/src/pgwui_common/configure.py index 52c820f..d8103a8 100644 --- a/src/pgwui_common/configure.py +++ b/src/pgwui_common/configure.py @@ -30,6 +30,10 @@ following into your package's __init__.py: config = Configurator() config.include('pgwui_common.configure.includeme') +Note that you can override any of the assets in this package or any of +the PGWUI packages, any of the templates or css, using Pyramid's Asset +Override API (or via pyramid.includes = yourextension in the .ini file). + ''' diff --git a/src/pgwui_common/templates/auth_base.mak b/src/pgwui_common/templates/auth_base.mak index 367e738..1cafb43 100644 --- a/src/pgwui_common/templates/auth_base.mak +++ b/src/pgwui_common/templates/auth_base.mak @@ -36,7 +36,13 @@ null_rep -<%inherit file="base.mak" /> +<%! + from pyramid.path import AssetResolver + + asset_resolver = AssetResolver() +%> + +<%inherit file="${asset_resolver.resolve('templates/base.mak')}" /> <%def name="navbar()">