From 1e3647d27bfaa5d1cec60a02f0c8bd9d4a2e12d7 Mon Sep 17 00:00:00 2001 From: Lance Edgar <lance@wuttaproject.org> Date: Fri, 24 Jan 2025 19:02:53 -0600 Subject: [PATCH] fix: add `index_title_controls()` def block for base template for customization purposes --- src/wuttaweb/templates/base.mako | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/wuttaweb/templates/base.mako b/src/wuttaweb/templates/base.mako index d84a0e2..846843d 100644 --- a/src/wuttaweb/templates/base.mako +++ b/src/wuttaweb/templates/base.mako @@ -248,12 +248,7 @@ % else: <h1 class="title">${index_title}</h1> % endif - % if master and master.creatable and not master.creating and master.has_perm('create'): - <wutta-button once type="is-primary" - tag="a" href="${url(f'{route_prefix}.create')}" - icon-left="plus" - label="Create New" /> - % endif + ${self.index_title_controls()} % endif </div> </div> @@ -349,6 +344,15 @@ </footer> </%def> +<%def name="index_title_controls()"> + % if master and master.creatable and not master.creating and master.has_perm('create'): + <wutta-button once type="is-primary" + tag="a" href="${url(f'{route_prefix}.create')}" + icon-left="plus" + label="Create New" /> + % endif +</%def> + <%def name="render_vue_template_whole_page()"> <script type="text/x-template" id="whole-page-template">