@@ -114,149 +114,6 @@ impl From<Layout> for String {
114
114
}
115
115
}
116
116
117
- // #[derive(TemplateOnce, Clone, Default)]
118
- // #[template(path = "layout/web_app_base.html")]
119
- // pub struct WebAppBase<'a> {
120
- // pub content: Option<String>,
121
- // pub breadcrumbs: Breadcrumbs<'a>,
122
- // pub head: Head,
123
- // pub dropdown_nav: StaticNav,
124
- // pub product_left_nav: crate::components::navigation::left_nav::web_app::Menu,
125
- // pub body_components: Vec<Component>,
126
- // pub cluster: Cluster,
127
- // pub product_banners_high: Vec<ProductBanner>,
128
- // pub product_banner_medium: ProductBanner,
129
- // pub product_banner_marketing: ProductBanner,
130
- // }
131
-
132
- // impl<'a> WebAppBase<'a> {
133
- // pub fn new(title: &str, context: &crate::guards::Cluster) -> Self {
134
- // let head = Head::new().title(title).context(&context.context.head_items);
135
- // let cluster = context.context.cluster.clone();
136
-
137
- // let all_product_high_level = context
138
- // .notifications
139
- // .clone()
140
- // .unwrap_or_else(|| vec![])
141
- // .into_iter()
142
- // .filter(|n: &Notification| n.level == NotificationLevel::ProductHigh)
143
- // .enumerate()
144
- // .map(|(i, n)| ProductBanner::from_notification(Some(&n)).set_show_modal_on_load(i == 0))
145
- // .collect::<Vec<ProductBanner>>();
146
-
147
- // WebAppBase {
148
- // head,
149
- // cluster,
150
- // dropdown_nav: context.context.deployment_dropdown.clone(),
151
- // product_left_nav: context.context.product_left_nav.clone(),
152
- // product_banners_high: all_product_high_level,
153
- // product_banner_medium: ProductBanner::from_notification(Notification::next_product_of_level(
154
- // context,
155
- // NotificationLevel::ProductMedium,
156
- // )),
157
- // product_banner_marketing: ProductBanner::from_notification(Notification::next_product_of_level(
158
- // context,
159
- // NotificationLevel::ProductMarketing,
160
- // )),
161
- // ..Default::default()
162
- // }
163
- // }
164
-
165
- // pub fn breadcrumbs(&mut self, breadcrumbs: Vec<NavLink<'a>>) -> &mut Self {
166
- // self.breadcrumbs.path = breadcrumbs.clone();
167
- // self
168
- // }
169
-
170
- // pub fn disable_upper_nav(&mut self) -> &mut Self {
171
- // let links: Vec<StaticNavLink> = self
172
- // .product_left_nav
173
- // .items
174
- // .links
175
- // .iter()
176
- // .map(|item| item.to_owned().disabled(true))
177
- // .collect();
178
- // self.product_left_nav = crate::components::navigation::left_nav::web_app::Menu {
179
- // back: self.product_left_nav.back.clone(),
180
- // items: StaticNav { links },
181
- // };
182
- // self
183
- // }
184
-
185
- // pub fn content(&mut self, content: &str) -> &mut Self {
186
- // self.content = Some(content.to_owned());
187
- // self
188
- // }
189
-
190
- // pub fn body_components(&mut self, components: Vec<Component>) -> &mut Self {
191
- // self.body_components = components;
192
- // self
193
- // }
194
-
195
- // pub fn breadcrumbs_from_uri(
196
- // &mut self,
197
- // org_dropdown: Vec<StaticNavLink>,
198
- // database_dropdown: Vec<StaticNavLink>,
199
- // uri: &str,
200
- // ) -> &mut Self {
201
- // let uri = if uri.starts_with("/") {
202
- // uri.chars().skip(1).collect::<String>()
203
- // } else {
204
- // uri.to_string()
205
- // };
206
-
207
- // let start_index = match (org_dropdown.is_empty(), database_dropdown.is_empty()) {
208
- // (true, true) => 0,
209
- // (false, true) => 1,
210
- // _ => 2,
211
- // };
212
-
213
- // let mut uris = uri
214
- // .split("/")
215
- // .skip(start_index)
216
- // .enumerate()
217
- // .map(|(i, part)| {
218
- // let path = uri
219
- // .split("/")
220
- // .into_iter()
221
- // .take(1 + i + start_index)
222
- // .collect::<Vec<&str>>()
223
- // .join("/");
224
- // let mut out = "/".to_owned();
225
- // out.push_str(&path);
226
-
227
- // NavLink::new(part, &out)
228
- // })
229
- // .collect::<Vec<NavLink>>();
230
-
231
- // if let Some(last) = uris.clone().into_iter().next_back() {
232
- // uris.pop();
233
- // uris.push(last.active());
234
- // }
235
-
236
- // self.breadcrumbs = Breadcrumbs {
237
- // organizations: org_dropdown,
238
- // databases: database_dropdown,
239
- // path: uris,
240
- // };
241
-
242
- // self
243
- // }
244
-
245
- // pub fn render<T>(&mut self, template: T) -> String
246
- // where
247
- // T: sailfish::TemplateOnce,
248
- // {
249
- // self.content = Some(template.render_once().unwrap());
250
- // (*self).clone().into()
251
- // }
252
- // }
253
-
254
- // impl<'a> From<WebAppBase<'a>> for String {
255
- // fn from(layout: WebAppBase) -> String {
256
- // layout.render_once().unwrap()
257
- // }
258
- // }
259
-
260
117
#[ derive( TemplateOnce ) ]
261
118
#[ template( path ="content/article.html" ) ]
262
119
pub struct Article {