style: rustfmt run

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

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!("home") view=student::StudentHomePage />
<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/athletics") view=student::StudentAthleticsPage />
<Route path=path!("additional/extracurriculars") view=student::StudentExtracurricularsPage />
<Route path=path!("additional/work-experience") view=student::StudentWorkExperiencePage />
<Route
path=path!("additional/extracurriculars")
view=student::StudentExtracurricularsPage
/>
<Route
path=path!("additional/work-experience")
view=student::StudentWorkExperiencePage
/>
</ParentRoute>
}
.into_inner()
+22 -25
View File
@@ -113,43 +113,40 @@ pub fn MultiEntry(
// Render the entries
<Show
when=move || !data_reactive.get().is_empty()
fallback=|| view! {
<div class="mx-auto">"You haven't added any entries yet."</div>
fallback=|| {
view! { <div class="mx-auto">"You haven't added any entries yet."</div> }
}
>
<For
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| {
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
// 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.
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
// time the map_signal is changed.
Effect::new(move |_| {
let child_map = map_signal.get(); // HashMap
data_reactive.update(|mut list| {
update_entry_list(&mut list, &child_map);
});
});
// HashMap
view! {
<Entry
data_map = map_signal
schema=schema
/>
}
view! { <Entry data_map=map_signal schema=schema /> }
}
/>
</Show>
</div>
<ActionButton on:click = add_entry>"Add entry"</ActionButton>
<ActionButton on:click=add_entry>"Add entry"</ActionButton>
</div>
}
}
@@ -194,11 +191,11 @@ fn Entry(
) -> impl IntoView {
view! {
<div class="flex flex-col flex-1 p-2 rounded-sm transition-shadow shadow-sm hover:shadow-lg/30">
{schema.get().iter()
.map(|input_type| {
input_type.clone().into_view(data_map.clone())
}).collect_view()
}
{schema
.get()
.iter()
.map(|input_type| { input_type.clone().into_view(data_map.clone()) })
.collect_view()}
</div>
}
}
+8 -9
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::hooks::use_location;
use crate::common::{SubTabInfo, TabInfo};
@@ -94,17 +93,13 @@ fn SidebarTab(
});
view! {
<div
<div
class="transition-all duration-300"
class=(["bg-transparent", "text-white"], move || !selected.get())
class=(["bg-white", "text-black"], move || selected.get())
>
<A href=move || path.get()>
<div
class="p-3 transition-bg font-bold"
>
{text}
</div>
<div class="p-3 transition-bg font-bold">{text}</div>
</A>
<div
class="grid transition-all ease-in-out"
@@ -135,7 +130,11 @@ fn SidebarSubTab(
});
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}
</A>
}
+1 -1
View File
@@ -14,7 +14,7 @@ pub fn AdminShell() -> impl IntoView {
<AdminLoginContext>
<Banner title="R15 Scholarships Admin" logo="/PHS_Stacked_Acronym.png" />
// We'll put the tabs here.
<TabSidebarList
<TabSidebarList
base_path="admin"
tabs=vec![
TabInfo::new("Home", "home", None),
+3 -1
View File
@@ -68,7 +68,9 @@ pub fn AdminUtilsPage() -> impl IntoView {
view! {
<div class="mx-auto px-6">
<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_dates>"Create Dates"</ActionButton>
</div>
+11 -5
View File
@@ -17,7 +17,8 @@ pub fn StudentAthleticsPage() -> impl IntoView {
data_map=data_map
data_member="athletic_participation"
schema=vec![
input!(Select, "sport_name", "Sport Name:", true, [
input!(
Select, "sport_name", "Sport Name:", true, [
"Football",
"Soccer",
"Cheerleading",
@@ -34,14 +35,19 @@ pub fn StudentAthleticsPage() -> impl IntoView {
"Softball",
"Tennis",
"Baseball"
]),
input!(Checkbox, "grades", "Grades Participated:", true, [
]
),
input!(
Checkbox, "grades", "Grades Participated:", true, [
"9th",
"10th",
"11th",
"12th"
]),
input!(Text, "achievements", "Special Achievements:", false, "Example 1, Example 2, etc...")
]
),
input!(
Text, "achievements", "Special Achievements:", false, "Example 1, Example 2, etc..."
),
]
/>
</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_weeks", "Number of weeks participated:", true, "3"),
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>
+14 -9
View File
@@ -18,15 +18,20 @@ pub fn StudentShell() -> impl IntoView {
tabs=vec![
TabInfo::new("Home", "home", None),
TabInfo::new("Demographics", "demographics", None),
TabInfo::new("Additional Info", "additional",
Some(vec![
SubTabInfo::new("Academics", "academics"),
SubTabInfo::new("Athletics", "athletics"),
SubTabInfo::new("Work Experience", "work-experience"),
SubTabInfo::new("Extracurriculars", "extracurriculars"),
SubTabInfo::new("University Info", "university"),
SubTabInfo::new("Parent Info", "parent-info")
])),
TabInfo::new(
"Additional Info",
"additional",
Some(
vec![
SubTabInfo::new("Academics", "academics"),
SubTabInfo::new("Athletics", "athletics"),
SubTabInfo::new("Work Experience", "work-experience"),
SubTabInfo::new("Extracurriculars", "extracurriculars"),
SubTabInfo::new("University Info", "university"),
SubTabInfo::new("Parent Info", "parent-info"),
],
),
),
]
/>
</Authenticated>