feat: begin implementation of student forms

This commit is contained in:
alphafetus committed 2026-01-28 14:36:48 -05:00
1 parent 3b9e2598b4
commit 765322bcca
8 files changed
+138 -6

No files matched your search

+79
View File
@@ -0,0 +1,79 @@
use std::collections::HashMap;
use leptos::prelude::*;
use crate::components::{OutlinedTextField, Select, TextFieldType, ValidatedForm};
#[component]
pub fn StudentDemographicsPage() -> impl IntoView {
// This page should show a form that the students need to fill out.
// It's a simple form, really nothing more than a contact form.
// I'm going to test out creating this form without using a panel - we'll just use the page as
// it is with a specially spaced invisible div instead of a shaded container.
let data_map = RwSignal::new(HashMap::new());
view! {
<div class="flex flex-1" />
<div class="flex flex-col flex-2 mt-6">
<ValidatedForm title="Student Demographic Form" on_submit=move || {}>
// Inputs here.
<OutlinedTextField
label="First Name:"
data_map=data_map
data_member="first_name"
placeholder="John"
input_type=TextFieldType::Text
required=true
/>
<OutlinedTextField
label="Last Name:"
data_map=data_map
data_member="last_name"
placeholder="Smith"
input_type=TextFieldType::Text
required=true
/>
// There must be a date of birth selection field here.
<OutlinedTextField
label="Student ID Number:"
data_map=data_map
data_member="id_number"
placeholder="Your 7 digit number..."
input_type=TextFieldType::Number
required=true
/>
<OutlinedTextField
label="Preferred Email:"
data_map=data_map
data_member="email"
placeholder="me@example.com"
input_type=TextFieldType::Email(vec!["*".to_string()])
required=true
/>
<OutlinedTextField
label="Preferred Phone Number:"
data_map=data_map
data_member="phone_number"
placeholder="000-000-0000"
input_type=TextFieldType::Text
required=true
/>
<OutlinedTextField
label="Street Address:"
data_map=data_map
data_member="street_address"
placeholder="234 Judd Rd"
input_type=TextFieldType::Text
required=true
/>
<Select
label="Town:"
value_list=vec!["Southbury".to_string(), "Middlebury".to_string()]
data_map=data_map
data_member="town"
required=true
/>
</ValidatedForm>
</div>
<div class="flex flex-1" />
}
}
+11
View File
@@ -0,0 +1,11 @@
use leptos::prelude::*;
#[component]
pub fn StudentHomePage() -> impl IntoView {
view! {
<div class="flex flex-1 flex-col gap-4 items-center m-4">
<div class="font-bold text-3xl">"Student Home Page"</div>
<div class="text-lg">"This is just a placeholder for now. We'll show some redirect buttons."</div>
</div>
}
}
+7
View File
@@ -0,0 +1,7 @@
mod shell;
mod home_page;
mod demographics_page;
pub use shell::*;
pub use home_page::*;
pub use demographics_page::*;
+20
View File
@@ -0,0 +1,20 @@
use leptos::prelude::*;
use crate::common::TabInfo;
use crate::components::{Banner, TabSidebarList};
use crate::components::login::StudentLoginContext;
#[component]
pub fn StudentShell() -> impl IntoView {
// Create login context
view! {
<StudentLoginContext>
<Banner title="R15 Student Scholarship Application" logo="/PHS_Stacked_Acronym.png" />
// We'll put the tabs here.
<TabSidebarList tabs=vec![
TabInfo::new("Home", "/students/home"),
TabInfo::new("Demographics", "/students/demographics"),
TabInfo::new("Additional Info", "/students/additional"),
] />
</StudentLoginContext>
}
}