The parent navbar decides how to place the child's content.
Do not use "next" because that means that the parent must know
if they have children. Instead, use body wrapping and always
call the "navbar_content" tag with a body.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<%doc>
- Copyright (C) 2015, 2020, 2021 The Meme Factory, Inc.
+ Copyright (C) 2015, 2020, 2021, 2024 The Meme Factory, Inc.
http://www.karlpinc.com/
This file is part of PGWUI_Common.
errors_base_mak = asset_abspath('pgwui_common:templates/errors_base.mak')
auth_parts_mak = asset_abspath('pgwui_common:templates/auth_parts.mak')
+ lib_mak = asset_abspath('pgwui_common:templates/lib.mak')
%>
<%inherit file="${errors_base_mak}" />
<%namespace file="${auth_parts_mak}"
name="auth_parts"
inheritable="True" />
+<%namespace name="lib" file="${lib_mak}" />
+
+<%def name="navbar_content()">
+ <%parent:navbar_content>
+ <%lib:have_navbar_logout>
+ ${caller.body()}
+ </%lib:have_navbar_logout>
+ </%parent:navbar_content>
+</%def>
<%def name="upload_form(extra_rows=[], upload_nulls=True)">
<form action="" enctype="multipart/form-data" method="post">
% if 'pgwui_menu' in pgwui['urls']:
| <a href="${pgwui['urls']['pgwui_menu']}">Menu</a>
% endif
-</%def>
-
-<%def name="navbar()">
- <p class="navbar">
- ${self.navbar_content()}
- </p>
+ ${caller.body()}
</%def>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</head>
<body>
- ${self.navbar()}
+ <%block name="navbar">
+ <p class="navbar">
+ <%self:navbar_content />
+ </p>
+ </%block>
<%block name="summary_info" />
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<%doc>
- Copyright (C) 2015, 2020, 2021 The Meme Factory, Inc.
+ Copyright (C) 2015, 2020, 2021, 2024 The Meme Factory, Inc.
http://www.karlpinc.com/
This file is part of PGWUI_Common.
License along with this program. If not, see
<http://www.gnu.org/licenses/>.
- Base template for a form that reports multiple errors
- and has "logout" in the navbar
+ Base template for a form that reports multiple errors.
Karl O. Pinc <kop@karlpinc.com>
<%inherit file="${base_mak}" />
-<%def name="navbar_content()">
- ${parent.navbar_content()}
- % if 'pgwui_logout' in pgwui['urls']:
- | <a href="${pgwui['urls']['pgwui_logout']}">Logout</a>
- % endif
-</%def>
-
<%block name="summary_info">
% if filename:
<p>File supplied: <em class="filename">${filename}</em></p>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<%doc>
+ Copyright (C) 2024 The Meme Factory, Inc. http://www.karlpinc.com/
+
+ This file is part of PGWUI_Common.
+
+ This program is free software: you can redistribute it and/or
+ modify it under the terms of the GNU Affero General Public License
+ as published by the Free Software Foundation, either version 3 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+
+ Library template of utility functions.
+
+ Karl O. Pinc <kop@meme.com>
+
+ This template uses the following variables in it's context:
+
+ pgwui Dict
+ urls Dict of urls, keyed by pgwui component name
+
+</%doc>
+
+<%def name="have_navbar_logout()">
+ ${caller.body()}
+ % if 'pgwui_logout' in pgwui['urls']:
+ | <a href="{pgwui["urls"]["pgwui_logout"]}"> Logout</a>
+ % endif
+</%def>