diff --git a/src/app.rs b/src/app.rs index dfdd2e2..476f7d5 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,4 +1,4 @@ -use crate::pages::{ProviderPortal, ScholarshipInfoPage, ProviderContactPage, LoanerShell, LoanerFallback, LoanerBorrowForm, LoanerReturnForm, AuthCallbackPage, ApplicantsPageFallback, AdminShell, AdminHomePage, AdminProviderPage, AdminScholarshipPage, StudentShell, StudentHomePage, StudentDemographicsPage, AdditionalPage, AdminUtilsPage}; +use crate::pages::{ProviderPortal, ScholarshipInfoPage, ProviderContactPage, LoanerShell, LoanerFallback, LoanerBorrowForm, LoanerReturnForm, AuthCallbackPage, ApplicantsPageFallback, AdminShell, AdminHomePage, AdminProviderPage, AdminScholarshipPage, StudentShell, StudentHomePage, StudentDemographicsPage, AdditionalPage, AdminUtilsPage, StudentAthleticsPage}; use leptos::prelude::*; use leptos_meta::{MetaTags, Stylesheet, Title, provide_meta_context}; use leptos_oidc::AuthSignal; @@ -124,7 +124,8 @@ fn StudentRoutes() -> impl MatchNestedRoutes + Clone { - + + } .into_inner() diff --git a/src/components/tabs/sidebar.rs b/src/components/tabs/sidebar.rs index 2ab23b2..72ca9ef 100644 --- a/src/components/tabs/sidebar.rs +++ b/src/components/tabs/sidebar.rs @@ -1,4 +1,5 @@ -use leptos::prelude::*; +use leptos::logging::log; +use leptos::prelude::*; use leptos_router::components::{Outlet, A}; use leptos_router::hooks::use_location; use crate::common::{SubTabInfo, TabInfo}; @@ -48,6 +49,7 @@ use crate::common::{SubTabInfo, TabInfo}; /// ``` #[component] pub fn TabSidebarList( + #[prop(into)] base_path: Signal, #[prop(into)] tabs: Signal>, ) -> impl IntoView { // Create a series of tabs based on a given list of names and paths. @@ -60,7 +62,7 @@ pub fn TabSidebarList( key=|info| info.text.clone() let(TabInfo { text, path, sub_paths }) > - + @@ -73,19 +75,24 @@ pub fn TabSidebarList( #[component] fn SidebarTab( + #[prop(into)] base_path: Signal, #[prop(into)] text: Signal, #[prop(into)] path: Signal, #[prop(into)] sub_paths: Signal>, ) -> impl IntoView { let location = use_location(); + let full_path = Memo::new(move |_| { + format!("/{}/{}", base_path.get(), path.get()) + }); + let selected = Memo::new(move |_| { let current_path = location.pathname.get(); // There's extra logic here as well, but for now this works. - current_path.starts_with(&path.get()) + current_path.starts_with(&full_path.get()) }); - + view! {
- +
@@ -119,22 +126,17 @@ fn SidebarTab( #[component] fn SidebarSubTab( + #[prop(into)] parent_path: Signal, #[prop(into)] text: Signal, #[prop(into)] path: Signal, - #[prop(into)] visible: Signal, ) -> impl IntoView { - let selected = Memo::new(move |_| { - visible.get() + let full_path = Memo::new(move |_| { + format!("{}/{}", parent_path.get(), path.get()) }); - + view! { - -
- {text} -
+
+ {text} } } diff --git a/src/pages/admin/shell.rs b/src/pages/admin/shell.rs index 84add78..d52b219 100644 --- a/src/pages/admin/shell.rs +++ b/src/pages/admin/shell.rs @@ -14,12 +14,15 @@ pub fn AdminShell() -> impl IntoView { // We'll put the tabs here. - + } } diff --git a/src/pages/student/athletics_page.rs b/src/pages/student/athletics_page.rs new file mode 100644 index 0000000..7158069 --- /dev/null +++ b/src/pages/student/athletics_page.rs @@ -0,0 +1,13 @@ +use leptos::prelude::*; + +#[component] +pub fn StudentAthleticsPage() -> impl IntoView { + view! { +
+
"Student Athletics Form"
+
+ "This is just a placeholder for now. This will display the athletics form." +
+
+ } +} \ No newline at end of file diff --git a/src/pages/student/mod.rs b/src/pages/student/mod.rs index 8354f08..99cf238 100644 --- a/src/pages/student/mod.rs +++ b/src/pages/student/mod.rs @@ -2,8 +2,10 @@ mod shell; mod home_page; mod demographics_page; mod additional_page; +mod athletics_page; pub use shell::*; pub use home_page::*; pub use demographics_page::*; -pub use additional_page::*; \ No newline at end of file +pub use additional_page::*; +pub use athletics_page::*; \ No newline at end of file diff --git a/src/pages/student/shell.rs b/src/pages/student/shell.rs index d006bd0..1422671 100644 --- a/src/pages/student/shell.rs +++ b/src/pages/student/shell.rs @@ -13,19 +13,22 @@ pub fn StudentShell() -> impl IntoView { - +