PR with too many features #58
No files matched your search
+8
-2
@@ -128,8 +128,14 @@ fn StudentRoutes() -> impl MatchNestedRoutes + Clone {
|
|||||||
<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()
|
||||||
|
|||||||
@@ -113,37 +113,34 @@ 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| {
|
||||||
// The map_signal is the map used for the internal element. This signal will
|
let map_signal = RwSignal::new(
|
||||||
// keep track of the individual entry's data, and whenever it is changed,
|
entry_map.as_map().unwrap_or_default().unwrap_or_default(),
|
||||||
// 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 |_| {
|
Effect::new(move |_| {
|
||||||
let child_map = map_signal.get(); // HashMap
|
let child_map = map_signal.get();
|
||||||
data_reactive.update(|mut list| {
|
data_reactive
|
||||||
|
.update(|mut list| {
|
||||||
update_entry_list(&mut list, &child_map);
|
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! {
|
// This effect updates the data_reactive list with the map_signal values, every
|
||||||
<Entry
|
// time the map_signal is changed.
|
||||||
data_map = map_signal
|
// HashMap
|
||||||
schema=schema
|
|
||||||
/>
|
view! { <Entry data_map=map_signal schema=schema /> }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Show>
|
</Show>
|
||||||
@@ -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>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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",
|
||||||
|
"additional",
|
||||||
|
Some(
|
||||||
|
vec![
|
||||||
SubTabInfo::new("Academics", "academics"),
|
SubTabInfo::new("Academics", "academics"),
|
||||||
SubTabInfo::new("Athletics", "athletics"),
|
SubTabInfo::new("Athletics", "athletics"),
|
||||||
SubTabInfo::new("Work Experience", "work-experience"),
|
SubTabInfo::new("Work Experience", "work-experience"),
|
||||||
SubTabInfo::new("Extracurriculars", "extracurriculars"),
|
SubTabInfo::new("Extracurriculars", "extracurriculars"),
|
||||||
SubTabInfo::new("University Info", "university"),
|
SubTabInfo::new("University Info", "university"),
|
||||||
SubTabInfo::new("Parent Info", "parent-info")
|
SubTabInfo::new("Parent Info", "parent-info"),
|
||||||
])),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
/>
|
/>
|
||||||
</Authenticated>
|
</Authenticated>
|
||||||
|
|||||||
Reference in new issue
Block a user