mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
app: Add navigation banner
Unstyled as of yet.
This commit is contained in:
parent
7d21cc5126
commit
9e9129aa3a
@ -96,6 +96,7 @@ impl Component for App {
|
||||
html! {
|
||||
<div class="container">
|
||||
<h1>{ "LLDAP" }</h1>
|
||||
{self.view_banner()}
|
||||
<Router<AppRoute>
|
||||
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!{
|
||||
<>
|
||||
<div>
|
||||
<NavButton
|
||||
classes="btn btn-primary"
|
||||
route=AppRoute::ListUsers>
|
||||
{"Users"}
|
||||
</NavButton>
|
||||
</div>
|
||||
<div>
|
||||
<NavButton
|
||||
classes="btn btn-primary"
|
||||
route=AppRoute::ListGroups>
|
||||
{"Groups"}
|
||||
</NavButton>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn is_admin(&self) -> bool {
|
||||
match &self.user_info {
|
||||
None => false,
|
||||
|
Loading…
Reference in New Issue
Block a user