@@ -3,7 +3,7 @@ use crate::components::notifications::marketing::AlertBanner;
33use crate :: guards:: Cluster ;
44use crate :: models:: User ;
55use crate :: Notification ;
6- use pgml_components:: component;
6+ use pgml_components:: { component, Component } ;
77use sailfish:: TemplateOnce ;
88use std:: fmt;
99
@@ -35,19 +35,21 @@ pub struct Base {
3535 pub user : Option < User > ,
3636 pub theme : Theme ,
3737 pub no_transparent_nav : bool ,
38+ pub body_components : Vec < Component > ,
3839}
3940
4041impl Base {
4142 pub fn new ( title : & str , context : Option < & Cluster > ) -> Base {
4243 let title = format ! ( "{} - PostgresML" , title) ;
4344
44- let ( head, footer, user) = match context. as_ref ( ) {
45+ let ( head, footer, user, body_components ) = match context. as_ref ( ) {
4546 Some ( context) => (
4647 Head :: new ( ) . title ( & title) . context ( & context. context . head_items ) ,
4748 Some ( context. context . marketing_footer . clone ( ) ) ,
4849 Some ( context. context . user . clone ( ) ) ,
50+ context. context . body_components . clone ( ) ,
4951 ) ,
50- None => ( Head :: new ( ) . title ( & title) , None , None ) ,
52+ None => ( Head :: new ( ) . title ( & title) , None , None , Vec :: new ( ) ) ,
5153 } ;
5254
5355 Base {
@@ -56,6 +58,7 @@ impl Base {
5658 alert_banner : AlertBanner :: from_notification ( Notification :: next_alert ( context) ) ,
5759 user,
5860 no_transparent_nav : false ,
61+ body_components,
5962 ..Default :: default ( )
6063 }
6164 }
0 commit comments