diff --git a/Dockerfile b/Dockerfile
index c24d621..85ace70 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
-FROM rust:1.86 AS builder
+FROM rust:1.90 AS builder
# Install node for tailwind capability
-RUN apt-get update -y && apt-get install -y --no-install-recommends clang libc6
+RUN apt-get update -y && apt-get install -y --no-install-recommends clang libc6 mold
RUN wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz
RUN tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
@@ -15,6 +15,7 @@ WORKDIR /app
COPY . .
# Setup fnm and build with leptos
+# If this doesn't work, we should use nvm as this is a proven solution.
RUN cargo binstall fnm -y \
&& fnm --version \
&& eval "$(fnm env)" \
@@ -26,7 +27,7 @@ RUN cargo binstall fnm -y \
# Start second phase of build - install ca-certs and copy all build outputs from previous step into a
# Debian image in the /app directory.
-FROM debian:bookworm-slim AS runtime
+FROM debian:trixie-slim AS runtime
WORKDIR /app
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends openssl ca-certificates \
@@ -46,6 +47,8 @@ COPY --from=builder /app/Cargo.toml /app/
ENV RUST_LOG="info"
ENV LEPTOS_SITE_ADDR="0.0.0.0:8080"
ENV LEPTOS_SITE_ROOT="site"
+# Staging URL for server.
+ENV LP_SITE_ORIGIN="http://testing-url.com"
EXPOSE 8080
# Don't forget about project_name
diff --git a/docker-compose.yml b/docker-compose.yml
index 02e8ee8..cc725fa 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,9 +1,6 @@
-
-services:
- leptos-watch:
- image: rust:1.86
+services:
+ scholarships-rs:
+ build: .
+ image: scholarships-rs-runner:latest
ports:
- - '3000:3000'
- volumes:
- - .:/app
- command: cargo leptos watch
+ - '8080:8080'
diff --git a/public/Book.png b/public/Book.png
new file mode 100644
index 0000000..939c4da
Binary files /dev/null and b/public/Book.png differ
diff --git a/public/Book_Style2.png b/public/Book_Style2.png
new file mode 100644
index 0000000..66f1f94
Binary files /dev/null and b/public/Book_Style2.png differ
diff --git a/public/Book_Style3.png b/public/Book_Style3.png
new file mode 100644
index 0000000..4fc3e06
Binary files /dev/null and b/public/Book_Style3.png differ
diff --git a/public/Bulb.png b/public/Bulb.png
new file mode 100644
index 0000000..2940e9e
Binary files /dev/null and b/public/Bulb.png differ
diff --git a/public/Bulb_Style2.png b/public/Bulb_Style2.png
new file mode 100644
index 0000000..6778936
Binary files /dev/null and b/public/Bulb_Style2.png differ
diff --git a/public/Calendar.png b/public/Calendar.png
new file mode 100644
index 0000000..b40ab22
Binary files /dev/null and b/public/Calendar.png differ
diff --git a/public/Calendar_Style2.png b/public/Calendar_Style2.png
new file mode 100644
index 0000000..38d570c
Binary files /dev/null and b/public/Calendar_Style2.png differ
diff --git a/public/Check.png b/public/Check.png
new file mode 100644
index 0000000..27c9cd4
Binary files /dev/null and b/public/Check.png differ
diff --git a/public/Check_Style2.png b/public/Check_Style2.png
new file mode 100644
index 0000000..4de2ba3
Binary files /dev/null and b/public/Check_Style2.png differ
diff --git a/public/Cog_Black.png b/public/Cog_Black.png
new file mode 100644
index 0000000..4c574b6
Binary files /dev/null and b/public/Cog_Black.png differ
diff --git a/public/Cog_Style3.png b/public/Cog_Style3.png
new file mode 100644
index 0000000..df5d926
Binary files /dev/null and b/public/Cog_Style3.png differ
diff --git a/public/Create.png b/public/Create.png
new file mode 100644
index 0000000..5b0118b
Binary files /dev/null and b/public/Create.png differ
diff --git a/public/Create_Black.png b/public/Create_Black.png
new file mode 100644
index 0000000..43cc0ed
Binary files /dev/null and b/public/Create_Black.png differ
diff --git a/public/Edit.png b/public/Edit.png
new file mode 100644
index 0000000..a691d08
Binary files /dev/null and b/public/Edit.png differ
diff --git a/public/Form.png b/public/Form.png
new file mode 100644
index 0000000..c534471
Binary files /dev/null and b/public/Form.png differ
diff --git a/public/Form_Black.png b/public/Form_Black.png
new file mode 100644
index 0000000..528abaf
Binary files /dev/null and b/public/Form_Black.png differ
diff --git a/public/Medal_Black.png b/public/Medal_Black.png
new file mode 100644
index 0000000..9c1e2a5
Binary files /dev/null and b/public/Medal_Black.png differ
diff --git a/public/PHS_Claw_Logo.png b/public/PHS_Claw_Logo.png
new file mode 100644
index 0000000..9bcb67b
Binary files /dev/null and b/public/PHS_Claw_Logo.png differ
diff --git a/public/PHS_Stacked_Acronym.png b/public/PHS_Stacked_Acronym.png
new file mode 100644
index 0000000..94b47ce
Binary files /dev/null and b/public/PHS_Stacked_Acronym.png differ
diff --git a/public/Person.png b/public/Person.png
new file mode 100644
index 0000000..35f5e14
Binary files /dev/null and b/public/Person.png differ
diff --git a/public/Person_Black.png b/public/Person_Black.png
new file mode 100644
index 0000000..76891b8
Binary files /dev/null and b/public/Person_Black.png differ
diff --git a/public/R15_logo.png b/public/R15_logo.png
new file mode 100644
index 0000000..802df65
Binary files /dev/null and b/public/R15_logo.png differ
diff --git a/public/R15_logo_colorMatchWhite.png b/public/R15_logo_colorMatchWhite.png
new file mode 100644
index 0000000..6842325
Binary files /dev/null and b/public/R15_logo_colorMatchWhite.png differ
diff --git a/public/Warning.png b/public/Warning.png
new file mode 100644
index 0000000..60efb17
Binary files /dev/null and b/public/Warning.png differ
diff --git a/public/Warning_Style2.png b/public/Warning_Style2.png
new file mode 100644
index 0000000..bc301e0
Binary files /dev/null and b/public/Warning_Style2.png differ
diff --git a/public/medal.png b/public/medal.png
new file mode 100644
index 0000000..0fc6b76
Binary files /dev/null and b/public/medal.png differ
diff --git a/public/square-user.svg b/public/square-user.svg
new file mode 100644
index 0000000..92f1016
--- /dev/null
+++ b/public/square-user.svg
@@ -0,0 +1,4 @@
+
+
\ No newline at end of file
diff --git a/src/app.rs b/src/app.rs
index ba7f12c..c242bdd 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -1,11 +1,11 @@
+use leptos::logging::log;
use leptos::prelude::*;
-use leptos_meta::{provide_meta_context, MetaTags, Stylesheet, Title};
+use leptos_meta::{MetaTags, Stylesheet, Title, provide_meta_context};
use leptos_oidc::{Auth, AuthParameters, AuthSignal, Challenge};
use leptos_router::{components::{Route, Router, Routes}, path};
+use crate::pages::{AboutPage, ComparisonTestPage, HomePage, LoanerPage, TestPage};
use url::Url;
-use crate::pages::{AboutPage, ComparisonTestPage, HomePage, ScholarshipInfoPage};
-
pub fn shell(options: LeptosOptions) -> impl IntoView {
view! {
@@ -29,12 +29,53 @@ pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
+ view! {
+ // injects a stylesheet into the document
+ // id=leptos means cargo-leptos will hot-reload this stylesheet
+
+
+ // sets the document title
+
+
+ // content for this welcome page
+
+
+
+ }
+}
+
+fn use_origin() -> String {
+ #[cfg(target_arch = "wasm32")] {
+ use leptos::web_sys;
+ // Just get the current URL origin.
+ web_sys::window()
+ .unwrap()
+ .location()
+ .origin()
+ .unwrap_or("http://localhost:3000/".to_string())
+ }
+
+ #[cfg(not(target_arch = "wasm32"))] {
+ // Read the expected origin out of an environment variable.
+ std::env::var("LP_SITE_ORIGIN").unwrap_or("http://localhost:3000/".to_string())
+ }
+}
+
+#[component]
+pub fn AppWithRoutes() -> impl IntoView {
+ provide_meta_context();
+
+ let current_origin = use_origin();
+ log!("Current origin: {}", current_origin);
+
// Authentication setup
let parameters = AuthParameters {
issuer: "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_Lfjuy5zaM".into(),
client_id: "10jr2h3vtpu9n7gj46pvg5qo2q".into(),
- redirect_uri: Url::parse("http://localhost:3000").unwrap().to_string(),
- post_logout_redirect_uri: Url::parse("http://localhost:3000").unwrap().to_string(),
+ redirect_uri: format!("{}/", use_origin()),
+ // redirect_uri: Url::parse(format!("{}", current_origin).as_str()).unwrap().to_string(),
+ // redirect_uri: Url::parse("http://localhost:3000").unwrap().to_string(),
+ post_logout_redirect_uri: current_origin,
scope: Some("openid%20profile%20email".into()),
audience: None,
challenge: Challenge::None,
@@ -56,19 +97,18 @@ pub fn App() -> impl IntoView {
// sets the document title
-
- // content for this welcome page
-
-
- // TODO Create a 404 page
-
-
-
-
-
-
-
-
+
+
+ // TODO Create a 404 page
+
+
+
+
+
+
+
+
}
}
diff --git a/src/components/banner.rs b/src/components/banner.rs
new file mode 100644
index 0000000..79b95ca
--- /dev/null
+++ b/src/components/banner.rs
@@ -0,0 +1,48 @@
+use leptos::prelude::*;
+use leptos_router::hooks::use_navigate;
+
+/// # Banner Component
+///
+/// This component displays a red banner at the top of the page with a title and a logo.
+/// Clicking the logo will redirect a user to specified page, preferably a home page.
+///
+/// Example usage:
+/// ```
+///
+/// ```
+#[component]
+pub fn Banner(
+ /// The title of the banner.
+ #[prop(into)]
+ title: String,
+ /// The file path or URL of a logo displayed at the top left of the banner.
+ #[prop(into)]
+ logo: String,
+ /// The route that the navigates user to a page (home page).
+ #[prop(into, default = String::from("/"))]
+ path: String,
+) -> impl IntoView {
+ let navigate = use_navigate();
+
+ let on_click = move |_| navigate(&path, Default::default());
+
+ view! {
+
+
+
+
+
})
+
+
+
{title.clone()}
+
+
+
+
+
+ }
+}
diff --git a/src/components/checkbox.rs b/src/components/checkbox.rs
index a245834..ba711dc 100644
--- a/src/components/checkbox.rs
+++ b/src/components/checkbox.rs
@@ -1,4 +1,5 @@
use crate::common::ValueType;
+use crate::components::utils::create_unique_id;
use leptos::prelude::*;
use std::collections::HashMap;
@@ -7,10 +8,13 @@ pub fn Checkbox(
#[prop()] checked: Signal,
#[prop(into)] on_change: Callback<(), ()>,
#[prop(into)] value: String,
+ #[prop(into)] name: String,
#[prop(default = RwSignal::new(false))] disabled: RwSignal,
) -> impl IntoView {
+ let id = create_unique_id(&name, &value);
+
view! {
-