@@ -3,7 +3,7 @@ use crate::components::notifications::marketing::AlertBanner;
3
3
use crate :: guards:: Cluster ;
4
4
use crate :: models:: User ;
5
5
use crate :: Notification ;
6
- use pgml_components:: component;
6
+ use pgml_components:: { component, Component } ;
7
7
use sailfish:: TemplateOnce ;
8
8
use std:: fmt;
9
9
@@ -35,19 +35,21 @@ pub struct Base {
35
35
pub user : Option < User > ,
36
36
pub theme : Theme ,
37
37
pub no_transparent_nav : bool ,
38
+ pub body_components : Vec < Component > ,
38
39
}
39
40
40
41
impl Base {
41
42
pub fn new ( title : & str , context : Option < & Cluster > ) -> Base {
42
43
let title = format ! ( "{} - PostgresML" , title) ;
43
44
44
- let ( head, footer, user) = match context. as_ref ( ) {
45
+ let ( head, footer, user, body_components ) = match context. as_ref ( ) {
45
46
Some ( context) => (
46
47
Head :: new ( ) . title ( & title) . context ( & context. context . head_items ) ,
47
48
Some ( context. context . marketing_footer . clone ( ) ) ,
48
49
Some ( context. context . user . clone ( ) ) ,
50
+ context. context . body_components . clone ( ) ,
49
51
) ,
50
- None => ( Head :: new ( ) . title ( & title) , None , None ) ,
52
+ None => ( Head :: new ( ) . title ( & title) , None , None , Vec :: new ( ) ) ,
51
53
} ;
52
54
53
55
Base {
@@ -56,6 +58,7 @@ impl Base {
56
58
alert_banner : AlertBanner :: from_notification ( Notification :: next_alert ( context) ) ,
57
59
user,
58
60
no_transparent_nav : false ,
61
+ body_components,
59
62
..Default :: default ( )
60
63
}
61
64
}
0 commit comments