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
							
								
									b4bfe3b5b3
								
							
						
					
					
						commit
						b29207e882
					
				@ -96,6 +96,7 @@ impl Component for App {
 | 
				
			|||||||
        html! {
 | 
					        html! {
 | 
				
			||||||
            <div class="container">
 | 
					            <div class="container">
 | 
				
			||||||
                <h1>{ "LLDAP" }</h1>
 | 
					                <h1>{ "LLDAP" }</h1>
 | 
				
			||||||
 | 
					                {self.view_banner()}
 | 
				
			||||||
                <Router<AppRoute>
 | 
					                <Router<AppRoute>
 | 
				
			||||||
                  render = Router::render(move |switch: AppRoute| {
 | 
					                  render = Router::render(move |switch: AppRoute| {
 | 
				
			||||||
                      match switch {
 | 
					                      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 {
 | 
					    fn is_admin(&self) -> bool {
 | 
				
			||||||
        match &self.user_info {
 | 
					        match &self.user_info {
 | 
				
			||||||
            None => false,
 | 
					            None => false,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user