Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a438e5

Browse files
authored
Add body components (#1015)
1 parentf91a98d commit5a438e5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎pgml-dashboard/src/templates/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use pgml_components::Component;
12
use std::collections::HashMap;
23

34
pubusecrate::components::{self,NavLink,StaticNav,StaticNavLink};
@@ -104,6 +105,7 @@ pub struct WebAppBase<'a> {
104105
pubaccount_management_nav:StaticNav,
105106
pubupper_left_nav:StaticNav,
106107
publower_left_nav:StaticNav,
108+
pubbody_components:Vec<Component>,
107109
}
108110

109111
impl<'a>WebAppBase<'a>{
@@ -153,6 +155,11 @@ impl<'a> WebAppBase<'a> {
153155
self
154156
}
155157

158+
pubfnbody_components(&mutself,components:Vec<Component>) ->&mutSelf{
159+
self.body_components = components;
160+
self
161+
}
162+
156163
pubfnrender<T>(&mutself,template:T) ->String
157164
where
158165
T: sailfish::TemplateOnce,

‎pgml-dashboard/templates/layout/web_app_base.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<htmllang="en-US"data-bs-theme="dark">
1919
<%- head %>
2020
<body>
21+
<% for component in body_components { %>
22+
<%+ component %>
23+
<% } %>
2124
<main>
2225
<divclass="container-fluid p-0 min-vh-lg-100">
2326
<divclass="row gx-0 min-vh-lg-100 gy-0">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp