diff --git a/file-service/src/pages.rs b/file-service/src/pages.rs index e12feec..e68aabe 100644 --- a/file-service/src/pages.rs +++ b/file-service/src/pages.rs @@ -4,32 +4,35 @@ use file_service::{FileHandle, FileInfo, ReadFileError}; pub fn auth(_message: Option) -> build_html::HtmlPage { build_html::HtmlPage::new() - .with_title("Authentication") + .with_title("Sign In") .with_stylesheet("/css") .with_container( Container::new(ContainerType::Div) .with_attributes([("class", "authentication-page")]) + .with_container(auth_form()), + ) +} + +fn auth_form() -> Container { + Container::default() + .with_attributes([("class", "card authentication-form")]) + .with_html( + Form::new() + .with_path("/auth") + .with_method("post") .with_container( Container::new(ContainerType::Div) - .with_attributes([("class", "card authentication-form")]) .with_html( - Form::new() - .with_path("/auth") - .with_method("post") - .with_container( - Container::new(ContainerType::Div) - .with_attributes([("class", "authentication-form__label")]) - .with_html(Label::new("for-token-input", "Authentication")), - ) - .with_container( - Container::new(ContainerType::Div) - .with_attributes([("class", "authentication-form__input")]) - .with_html( - Input::new("password", "password") - .with_id("for-token-input") - .with_attributes([("size", "50")]), - ), - ), + Input::new("password", "password") + .with_id("for-token-input") + .with_attributes([ + ("size", "50"), + ("class", "authentication-form__input"), + ]), + ) + .with_html( + Button::new("Sign In") + .with_attributes([("class", "authentication-form__button")]), ), ), )