From 9e9129aa3a69828865aa15a4fef928940efd0dee Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 11 Oct 2021 16:36:13 +0200 Subject: [PATCH] app: Add navigation banner Unstyled as of yet. --- app/src/components/app.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/src/components/app.rs b/app/src/components/app.rs index 7a5c608..96b15a3 100644 --- a/app/src/components/app.rs +++ b/app/src/components/app.rs @@ -96,6 +96,7 @@ impl Component for App { html! {

{ "LLDAP" }

+ {self.view_banner()} render = Router::render(move |switch: AppRoute| { match switch { @@ -180,6 +181,31 @@ impl App { } } + fn view_banner(&self) -> Html { + if !self.is_admin() { + html!{} + } else { + html!{ + <> +
+ + {"Users"} + +
+
+ + {"Groups"} + +
+ + } + } + } + fn is_admin(&self) -> bool { match &self.user_info { None => false,