From 967000d707e86efc0539f02ebab38a7278f22f85 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Wed, 13 Sep 2023 15:10:49 -0700 Subject: [PATCH] Add body components --- pgml-dashboard/src/templates/mod.rs | 7 +++++++ pgml-dashboard/templates/layout/web_app_base.html | 3 +++ 2 files changed, 10 insertions(+) diff --git a/pgml-dashboard/src/templates/mod.rs b/pgml-dashboard/src/templates/mod.rs index e38b275f6..cedcacdb4 100644 --- a/pgml-dashboard/src/templates/mod.rs +++ b/pgml-dashboard/src/templates/mod.rs @@ -1,3 +1,4 @@ +use pgml_components::Component; use std::collections::HashMap; pub use crate::components::{self, NavLink, StaticNav, StaticNavLink}; @@ -104,6 +105,7 @@ pub struct WebAppBase<'a> { pub account_management_nav: StaticNav, pub upper_left_nav: StaticNav, pub lower_left_nav: StaticNav, + pub body_components: Vec, } impl<'a> WebAppBase<'a> { @@ -153,6 +155,11 @@ impl<'a> WebAppBase<'a> { self } + pub fn body_components(&mut self, components: Vec) -> &mut Self { + self.body_components = components; + self + } + pub fn render(&mut self, template: T) -> String where T: sailfish::TemplateOnce, diff --git a/pgml-dashboard/templates/layout/web_app_base.html b/pgml-dashboard/templates/layout/web_app_base.html index e4ca839d2..46f7afd44 100644 --- a/pgml-dashboard/templates/layout/web_app_base.html +++ b/pgml-dashboard/templates/layout/web_app_base.html @@ -18,6 +18,9 @@ <%- head %> + <% for component in body_components { %> + <%+ component %> + <% } %>
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy