PR with too many features #58

Merged
BobdaFett merged 56 commits from feat/admin-page into main 2026-02-10 14:31:49 +00:00
5 changed files with 40 additions and 14 deletions
Showing only changes of commit caec4fb017 - Show all commits

No files matched your search

+6 -1
View File
@@ -1,5 +1,5 @@
use leptos::prelude::*;
use crate::components::{OutlinedTextField, Select, TextFieldType, ValidatedForm};
use crate::components::{Loading, OutlinedTextField, Select, TextFieldType, ValidatedForm};
use crate::pages::student::form_setup::use_student_form;
#[component]
@@ -12,6 +12,10 @@ pub fn StudentDemographicsPage() -> impl IntoView {
let controller = use_student_form("demographics");
view! {
<Show
when=move || controller.data_resource.get().is_some()
fallback=Loading
>
<div class="flex flex-1" />
<div class="flex flex-col flex-2 mt-6">
<ValidatedForm title="Student Demographic Form" on_submit=controller.submit_action>
@@ -75,5 +79,6 @@ pub fn StudentDemographicsPage() -> impl IntoView {
</ValidatedForm>
</div>
<div class="flex flex-1" />
</Show>
}
}
+6 -1
View File
@@ -1,5 +1,5 @@
use leptos::prelude::*;
use crate::components::{MultiEntry, OutlinedTextField, TextFieldType, ValidatedForm};
use crate::components::{Loading, MultiEntry, OutlinedTextField, TextFieldType, ValidatedForm};
use crate::input;
use crate::pages::student::form_setup::use_student_form;
@@ -8,6 +8,10 @@ pub fn StudentExtracurricularsPage() -> impl IntoView {
let controller = use_student_form("demographics");
view! {
<Show
when=move || controller.data_resource.get().is_some()
fallback=Loading
>
<div class="flex flex-1" />
<div class="flex flex-col flex-2 mt-6">
<ValidatedForm title="Extracurricular Information" on_submit=controller.submit_action>
@@ -38,5 +42,6 @@ pub fn StudentExtracurricularsPage() -> impl IntoView {
</ValidatedForm>
</div>
<div class="flex flex-1" />
</Show>
}
}
+10 -5
View File
@@ -1,5 +1,5 @@
use leptos::prelude::*;
use crate::components::{OutlinedTextField, TextFieldType, ValidatedForm};
use crate::components::{Loading, OutlinedTextField, TextFieldType, ValidatedForm};
use crate::pages::student::form_setup::use_student_form;
#[component]
@@ -7,6 +7,10 @@ pub fn StudentFamilyPage() -> impl IntoView {
let controller = use_student_form("family");
view! {
<Show
when=move || controller.data_resource.get().is_some()
fallback=Loading
>
<div class="flex flex-1" />
<div class="flex flex-col flex-2 mt-6">
<ValidatedForm title="Family Information" on_submit=controller.submit_action>
@@ -65,7 +69,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
<OutlinedTextField
label="Parent/Guardian 2 Name:"
data_map=controller.data_map
data_member="parent_one_name"
data_member="parent_two_name"
placeholder="John Smith"
input_type=TextFieldType::Text
required=false
@@ -74,7 +78,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
<OutlinedTextField
label="Parent/Guardian 2 Relationship:"
data_map=controller.data_map
data_member="parent_one_relationship"
data_member="parent_two_relationship"
placeholder="Mother/Father"
input_type=TextFieldType::Text
required=false
@@ -83,7 +87,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
<OutlinedTextField
label="Parent/Guardian 2 Occupation:"
data_map=controller.data_map
data_member="parent_one_occupation"
data_member="parent_two_occupation"
placeholder="Milkman"
input_type=TextFieldType::Text
required=false
@@ -91,7 +95,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
<OutlinedTextField
label="Parent/Guardian 2 Employer:"
data_map=controller.data_map
data_member="parent_one_employer"
data_member="parent_two_employer"
placeholder="Example Employer"
input_type=TextFieldType::Text
required=false
@@ -99,5 +103,6 @@ pub fn StudentFamilyPage() -> impl IntoView {
</ValidatedForm>
</div>
<div class="flex flex-1" />
</Show>
}
}
+8 -3
View File
@@ -1,5 +1,5 @@
use leptos::prelude::*;
use crate::components::{OutlinedTextField, Select, TextFieldType, ValidatedForm};
use crate::components::{Loading, OutlinedTextField, Select, TextFieldType, ValidatedForm};
use crate::pages::student::form_setup::use_student_form;
#[component]
@@ -10,6 +10,10 @@ pub fn StudentUniversityPage() -> impl IntoView {
// major, study field, intended career, college_acceptance
view! {
<Show
when=move || controller.data_resource.get().is_some()
fallback=Loading
>
<div class="flex flex-1" />
<div class="flex flex-col flex-2 mt-6">
<ValidatedForm title="University Information" on_submit=controller.submit_action>
@@ -19,7 +23,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
data_map=controller.data_map
data_member="college_name"
placeholder="University of Example"
input_type=TextFieldType::Number
input_type=TextFieldType::Text
required=true
/>
<OutlinedTextField
@@ -44,7 +48,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
data_map=controller.data_map
data_member="college_zip"
placeholder="12345"
input_type=TextFieldType::Number
input_type=TextFieldType::Text
required=true
/>
<Select
@@ -69,5 +73,6 @@ pub fn StudentUniversityPage() -> impl IntoView {
</ValidatedForm>
</div>
<div class="flex flex-1" />
</Show>
}
}
+10 -4
View File
@@ -1,20 +1,25 @@
use std::collections::HashMap;
use leptos::prelude::*;
use crate::components::{MultiEntry, ValidatedForm};
use crate::components::{Loading, MultiEntry, ValidatedForm};
use crate::input;
use crate::pages::student::form_setup::use_student_form;
#[component]
pub fn StudentWorkExperiencePage() -> impl IntoView {
let data_map = RwSignal::new(HashMap::new());
let controller = use_student_form("workexp");
view! {
<Show
when=move || controller.data_resource.get().is_some()
fallback=Loading
>
<div class="flex flex-1" />
<div class="flex flex-col flex-2 mt-6">
<ValidatedForm title="Student Work Experience" on_submit=move || {}>
<ValidatedForm title="Student Work Experience" on_submit=controller.submit_action>
<MultiEntry
label="Work Experience:"
description="Leave blank if not applicable."
data_map=data_map
data_map=controller.data_map
data_member="extracurricular"
schema=vec![
input!(Text, "job_title", "Job Title:", true, "Waiter, Cashier, etc..."),
@@ -27,5 +32,6 @@ pub fn StudentWorkExperiencePage() -> impl IntoView {
</ValidatedForm>
</div>
<div class="flex flex-1" />
</Show>
}
}