From 4bf2bb42fb9d5a604f2cd4cfa7ecfceeb3614639 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 21 Aug 2024 00:06:10 -0500 Subject: [PATCH] fix: cleanup templates for home, login pages if context has 'image_url' then use that, otherwise configured logo --- src/wuttaweb/templates/auth/login.mako | 9 +-------- src/wuttaweb/templates/base_meta.mako | 4 ++-- src/wuttaweb/templates/home.mako | 9 +-------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/wuttaweb/templates/auth/login.mako b/src/wuttaweb/templates/auth/login.mako index e6b77c6..278992b 100644 --- a/src/wuttaweb/templates/auth/login.mako +++ b/src/wuttaweb/templates/auth/login.mako @@ -4,13 +4,9 @@ <%def name="title()">Login -<%def name="render_this_page()"> - ${self.page_content()} - - <%def name="page_content()">
-
${base_meta.full_logo()}
+
${base_meta.full_logo(image_url or None)}
${form.render_vue_tag()} @@ -44,6 +40,3 @@ - - -${parent.body()} diff --git a/src/wuttaweb/templates/base_meta.mako b/src/wuttaweb/templates/base_meta.mako index 741ac4a..67739fa 100644 --- a/src/wuttaweb/templates/base_meta.mako +++ b/src/wuttaweb/templates/base_meta.mako @@ -12,8 +12,8 @@ ${h.image(config.get('wuttaweb.header_logo_url', default=request.static_url('wuttaweb:static/img/favicon.ico')), "Header Logo", style="height: 49px;")} -<%def name="full_logo()"> - ${h.image(config.get('wuttaweb.logo_url', default=request.static_url('wuttaweb:static/img/logo.png')), f"{app.get_title()} logo")} +<%def name="full_logo(image_url=None)"> + ${h.image(image_url or config.get('wuttaweb.logo_url', default=request.static_url('wuttaweb:static/img/logo.png')), f"{app.get_title()} logo")} <%def name="footer()"> diff --git a/src/wuttaweb/templates/home.mako b/src/wuttaweb/templates/home.mako index 1bb5f0d..0af63ef 100644 --- a/src/wuttaweb/templates/home.mako +++ b/src/wuttaweb/templates/home.mako @@ -4,16 +4,9 @@ <%def name="title()">Home -<%def name="render_this_page()"> - ${self.page_content()} - - <%def name="page_content()">
-
${base_meta.full_logo()}
+
${base_meta.full_logo(image_url or None)}

Welcome to ${app.get_title()}

- - -${parent.body()}