style: rustfmt run
This commit is contained in:
1 parent
7ba22e5d24
commit
0ca00664b0
7 files changed
+66
-49
No files matched your search
+9
-3
@@ -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()
|
||||
|
||||
@@ -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| {
|
||||
// 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.
|
||||
let map_signal = RwSignal::new(
|
||||
entry_map.as_map().unwrap_or_default().unwrap_or_default(),
|
||||
);
|
||||
Effect::new(move |_| {
|
||||
let child_map = map_signal.get(); // HashMap
|
||||
data_reactive.update(|mut list| {
|
||||
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.
|
||||
|
||||
view! {
|
||||
<Entry
|
||||
data_map = map_signal
|
||||
schema=schema
|
||||
/>
|
||||
}
|
||||
// This effect updates the data_reactive list with the map_signal values, every
|
||||
// time the map_signal is changed.
|
||||
// HashMap
|
||||
|
||||
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>
|
||||
}
|
||||
}
|
||||
@@ -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};
|
||||
@@ -100,11 +99,7 @@ fn SidebarTab(
|
||||
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>
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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![
|
||||
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")
|
||||
])),
|
||||
SubTabInfo::new("Parent Info", "parent-info"),
|
||||
],
|
||||
),
|
||||
),
|
||||
]
|
||||
/>
|
||||
</Authenticated>
|
||||
|
||||
Reference in new issue
Block a user