style: rustfmt run

This commit is contained in:
alphafetus committed 2026-02-02 16:51:13 -05:00
1 parent 7ba22e5d24
commit 0ca00664b0
7 files changed
+69 -52

No files matched your search

+9 -3
View File
@@ -125,11 +125,17 @@ fn StudentRoutes() -> impl MatchNestedRoutes + Clone {
<Route path=path!("callback") view=AuthCallbackPage /> <Route path=path!("callback") view=AuthCallbackPage />
<Route path=path!("home") view=student::StudentHomePage /> <Route path=path!("home") view=student::StudentHomePage />
<Route path=path!("demographics") view=student::StudentDemographicsPage /> <Route path=path!("demographics") view=student::StudentDemographicsPage />
<Route path=path!("additional") view=student::AdditionalPage/> <Route path=path!("additional") view=student::AdditionalPage />
<Route path=path!("additional/academics") view=student::StudentAcademicsPage /> <Route path=path!("additional/academics") view=student::StudentAcademicsPage />
<Route path=path!("additional/athletics") view=student::StudentAthleticsPage /> <Route path=path!("additional/athletics") view=student::StudentAthleticsPage />
<Route path=path!("additional/extracurriculars") view=student::StudentExtracurricularsPage /> <Route
<Route path=path!("additional/work-experience") view=student::StudentWorkExperiencePage /> path=path!("additional/extracurriculars")
view=student::StudentExtracurricularsPage
/>
<Route
path=path!("additional/work-experience")
view=student::StudentWorkExperiencePage
/>
</ParentRoute> </ParentRoute>
} }
.into_inner() .into_inner()
+22 -25
View File
@@ -113,43 +113,40 @@ pub fn MultiEntry(
// Render the entries // Render the entries
<Show <Show
when=move || !data_reactive.get().is_empty() when=move || !data_reactive.get().is_empty()
fallback=|| view! { fallback=|| {
<div class="mx-auto">"You haven't added any entries yet."</div> view! { <div class="mx-auto">"You haven't added any entries yet."</div> }
} }
> >
<For <For
each=move || data_reactive.get() each=move || data_reactive.get()
key=|entry| get_uuid_from_map(&entry.as_map().unwrap().unwrap()) // Entries MUST be given a unique ID. This is absolutely ridiculous. // Entries MUST be given a unique ID. This is absolutely ridiculous.
key=|entry| get_uuid_from_map(&entry.as_map().unwrap().unwrap())
children=move |mut entry_map| { children=move |mut entry_map| {
let map_signal = RwSignal::new(
entry_map.as_map().unwrap_or_default().unwrap_or_default(),
);
Effect::new(move |_| {
let child_map = map_signal.get();
data_reactive
.update(|mut list| {
update_entry_list(&mut list, &child_map);
});
});
// The map_signal is the map used for the internal element. This signal will // The map_signal is the map used for the internal element. This signal will
// keep track of the individual entry's data, and whenever it is changed, // keep track of the individual entry's data, and whenever it is changed,
// the parent data_map will also be updated to reflect these changes. // the parent data_map will also be updated to reflect these changes.
let map_signal = RwSignal::new(entry_map
.as_map()
.unwrap_or_default()
.unwrap_or_default());
// This effect updates the data_reactive list with the map_signal values, every // This effect updates the data_reactive list with the map_signal values, every
// time the map_signal is changed. // time the map_signal is changed.
Effect::new(move |_| { // HashMap
let child_map = map_signal.get(); // HashMap
data_reactive.update(|mut list| {
update_entry_list(&mut list, &child_map);
});
});
view! { view! { <Entry data_map=map_signal schema=schema /> }
<Entry
data_map = map_signal
schema=schema
/>
}
} }
/> />
</Show> </Show>
</div> </div>
<ActionButton on:click = add_entry>"Add entry"</ActionButton> <ActionButton on:click=add_entry>"Add entry"</ActionButton>
</div> </div>
} }
} }
@@ -194,11 +191,11 @@ fn Entry(
) -> impl IntoView { ) -> impl IntoView {
view! { view! {
<div class="flex flex-col flex-1 p-2 rounded-sm transition-shadow shadow-sm hover:shadow-lg/30"> <div class="flex flex-col flex-1 p-2 rounded-sm transition-shadow shadow-sm hover:shadow-lg/30">
{schema.get().iter() {schema
.map(|input_type| { .get()
input_type.clone().into_view(data_map.clone()) .iter()
}).collect_view() .map(|input_type| { input_type.clone().into_view(data_map.clone()) })
} .collect_view()}
</div> </div>
} }
} }
+7 -8
View File
@@ -1,5 +1,4 @@
use leptos::logging::log; use leptos::prelude::*;
use leptos::prelude::*;
use leptos_router::components::{Outlet, A}; use leptos_router::components::{Outlet, A};
use leptos_router::hooks::use_location; use leptos_router::hooks::use_location;
use crate::common::{SubTabInfo, TabInfo}; use crate::common::{SubTabInfo, TabInfo};
@@ -100,11 +99,7 @@ fn SidebarTab(
class=(["bg-white", "text-black"], move || selected.get()) class=(["bg-white", "text-black"], move || selected.get())
> >
<A href=move || path.get()> <A href=move || path.get()>
<div <div class="p-3 transition-bg font-bold">{text}</div>
class="p-3 transition-bg font-bold"
>
{text}
</div>
</A> </A>
<div <div
class="grid transition-all ease-in-out" class="grid transition-all ease-in-out"
@@ -135,7 +130,11 @@ fn SidebarSubTab(
}); });
view! { view! {
<A href=move || full_path.get() {..} class="block p-3 pl-10 transition-all aria-[current]:font-bold"> <A
href=move || full_path.get()
{..}
class="block p-3 pl-10 transition-all aria-[current]:font-bold"
>
{text} {text}
</A> </A>
} }
+3 -1
View File
@@ -68,7 +68,9 @@ pub fn AdminUtilsPage() -> impl IntoView {
view! { view! {
<div class="mx-auto px-6"> <div class="mx-auto px-6">
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
<div class="self-centered text-lg mt-6">"This utility page provides buttons to initialize the corresponding lists of information."</div> <div class="self-centered text-lg mt-6">
"This utility page provides buttons to initialize the corresponding lists of information."
</div>
<ActionButton on:click=on_click_comparisons>"Create Comparisons"</ActionButton> <ActionButton on:click=on_click_comparisons>"Create Comparisons"</ActionButton>
<ActionButton on:click=on_click_dates>"Create Dates"</ActionButton> <ActionButton on:click=on_click_dates>"Create Dates"</ActionButton>
</div> </div>
+11 -5
View File
@@ -17,7 +17,8 @@ pub fn StudentAthleticsPage() -> impl IntoView {
data_map=data_map data_map=data_map
data_member="athletic_participation" data_member="athletic_participation"
schema=vec![ schema=vec![
input!(Select, "sport_name", "Sport Name:", true, [ input!(
Select, "sport_name", "Sport Name:", true, [
"Football", "Football",
"Soccer", "Soccer",
"Cheerleading", "Cheerleading",
@@ -34,14 +35,19 @@ pub fn StudentAthleticsPage() -> impl IntoView {
"Softball", "Softball",
"Tennis", "Tennis",
"Baseball" "Baseball"
]), ]
input!(Checkbox, "grades", "Grades Participated:", true, [ ),
input!(
Checkbox, "grades", "Grades Participated:", true, [
"9th", "9th",
"10th", "10th",
"11th", "11th",
"12th" "12th"
]), ]
input!(Text, "achievements", "Special Achievements:", false, "Example 1, Example 2, etc...") ),
input!(
Text, "achievements", "Special Achievements:", false, "Example 1, Example 2, etc..."
),
] ]
/> />
</ValidatedForm> </ValidatedForm>
+3 -1
View File
@@ -30,7 +30,9 @@ pub fn StudentExtracurricularsPage() -> impl IntoView {
input!(Number, "num_hours", "Number of hours completed:", true, "40"), input!(Number, "num_hours", "Number of hours completed:", true, "40"),
input!(Number, "num_weeks", "Number of weeks participated:", true, "3"), input!(Number, "num_weeks", "Number of weeks participated:", true, "3"),
input!(Text, "special_involvement", "Any special involvement:", false, ""), input!(Text, "special_involvement", "Any special involvement:", false, ""),
input!(Checkbox, "grades", "Grades Participated:", true, ["9th", "10th", "11th", "12th"]) input!(
Checkbox, "grades", "Grades Participated:", true, ["9th", "10th", "11th", "12th"]
),
] ]
/> />
</ValidatedForm> </ValidatedForm>
+14 -9
View File
@@ -18,15 +18,20 @@ pub fn StudentShell() -> impl IntoView {
tabs=vec![ tabs=vec![
TabInfo::new("Home", "home", None), TabInfo::new("Home", "home", None),
TabInfo::new("Demographics", "demographics", None), TabInfo::new("Demographics", "demographics", None),
TabInfo::new("Additional Info", "additional", TabInfo::new(
Some(vec![ "Additional Info",
SubTabInfo::new("Academics", "academics"), "additional",
SubTabInfo::new("Athletics", "athletics"), Some(
SubTabInfo::new("Work Experience", "work-experience"), vec![
SubTabInfo::new("Extracurriculars", "extracurriculars"), SubTabInfo::new("Academics", "academics"),
SubTabInfo::new("University Info", "university"), SubTabInfo::new("Athletics", "athletics"),
SubTabInfo::new("Parent Info", "parent-info") SubTabInfo::new("Work Experience", "work-experience"),
])), SubTabInfo::new("Extracurriculars", "extracurriculars"),
SubTabInfo::new("University Info", "university"),
SubTabInfo::new("Parent Info", "parent-info"),
],
),
),
] ]
/> />
</Authenticated> </Authenticated>