From 85962a8ff2b13fb85ddf91ff76dd5d13a1fb53ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C3=A9mis?= Date: Thu, 9 Jan 2025 19:43:17 +0100 Subject: [PATCH] halfway done with the registration form --- README.md | 4 ++ assets/site.css | 96 ++++++++++++++++++++++++++++++-- src/main.rs | 17 +++++- templates/base.html.tera | 6 +- templates/index.html.tera | 13 ++--- templates/register.html.tera | 77 +++++++++++++++++++++++++ templates/show_profile.html.tera | 3 + 7 files changed, 202 insertions(+), 14 deletions(-) create mode 100644 templates/register.html.tera create mode 100644 templates/show_profile.html.tera diff --git a/README.md b/README.md index fd84a1a..625decb 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,7 @@ a profile is - behaviour - microchipped - and whatever else i think of + +# TODOs + +- privacy policy and GDPR notice diff --git a/assets/site.css b/assets/site.css index 74b3cc0..91a75cd 100644 --- a/assets/site.css +++ b/assets/site.css @@ -32,24 +32,112 @@ background-color: var(--clr-surface-tonal-a0); } +* { + box-sizing: border-box; +} + +body { + margin-bottom: 2em; +} + +h1>a { + text-decoration: none; + color: var(--clr-txt-on-dark); +} + input, select, -button { +button, +a.btn { border: 2pt solid var(--clr-surface-tonal-a50); border-radius: 4pt; padding: 4pt 8pt; color: var(--clr-txt-on-dark); background-color: var(--clr-surface-tonal-a10); + text-decoration: none; } input:hover, select:hover, -button:hover { +button:hover, +a.btn:hover { border-color: var(--clr-primary-a0); } +header, +main { + padding-left: 1em; + padding-right: 1em; +} + +header { + display: flex; + justify-content: space-between; + align-items: center; +} + +section { + margin-top: 2em; +} + +.split { + display: flex; + flex-direction: row; + text-align: center; + align-items: center; +} +.split>* { + flex: 1; + padding-left: 2em; + padding-right: 2em; +} +.split>*:not(:first-child) { + border-left: 2pt solid var(--clr-primary-a0); +} + +.raised { + background-color: var(--clr-surface-tonal-a10); + padding: 1em; + border-radius: 4pt; +} + +.fields>*:not(:last-child) { + margin-bottom: 1em; +} +.fields>*>* { + display: block; + width: 100% +} +.fields label { + font-weight: bold; + margin-bottom: 4pt; +} + +p.note { + margin: 2pt 0 0 0; + font-size: .9em; +} + +#stray-form { + display: flex; + flex-direction: column; + align-items: center; + gap: 1em; +} +#stray-form>h2 { + margin-bottom: 0; +} input#ident { font-family: monospace; - width: 7ch; - font-size: 1.4em; + width: 6ch; + font-size: 1.6em; + box-sizing: content-box; +} +#pregen_ids>button { + font-family: monospace; + font-size: 1.6em; + margin: 2pt; +} +#stray-form>button { + font-size: 1em; } diff --git a/src/main.rs b/src/main.rs index 800dbfd..51f2e68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,10 +8,25 @@ fn index() -> Template { Template::render("index", context! {}) } +#[get("/register")] +fn show_register() -> Template { + Template::render("register", context! {}) +} + +#[get("/profile?")] +fn show_profile(ident: &str) -> Template { + Template::render( + "show_profile", + context! { + ident, + }, + ) +} + #[launch] fn rocket() -> _ { rocket::build() .attach(Template::fairing()) .mount("/assets", FileServer::from(relative!("/assets"))) - .mount("/", routes![index]) + .mount("/", routes![index, show_profile, show_register]) } diff --git a/templates/base.html.tera b/templates/base.html.tera index 1cf036e..1adde1b 100644 --- a/templates/base.html.tera +++ b/templates/base.html.tera @@ -7,7 +7,11 @@
-

Doll.Tags

+

Doll.Tags

+ +
diff --git a/templates/index.html.tera b/templates/index.html.tera index aa2e359..6f1cf21 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -1,14 +1,11 @@ {% extends "base" %} {% block title %}Found a stray? - {% endblock title %} {% block main %} -
+

Found a stray?

+ + - - - - - -
-
+ + {% endblock main %} diff --git a/templates/register.html.tera b/templates/register.html.tera new file mode 100644 index 0000000..689ecc2 --- /dev/null +++ b/templates/register.html.tera @@ -0,0 +1,77 @@ +{% extends "base" %} +{% block title %}Register a new tag - {% endblock title %} +{% block main %} +

Register a new tag

+ + + +
+

Now, to the registration!

+ +
+
+

Firstly, the tag's ID

+

+ You may enter your own, but in case of collision it will not be usable.
+ To that end, here's a few free ones you may also pick from. +

+ +
+
+

+ +
+
+

Or pick one of those pre-generated ones

+ +
+ + + + + +
+
+
+
+ +
+

Names and contact info

+ +
+
+ + +

Remember: names only mean what you want them to!

+
+
+ + +
+
+ + +

Optional, will make the handler's name clickable.

+
+
+ +
+

Entity description and notable features

+
+
+
+ + +{% endblock main %} diff --git a/templates/show_profile.html.tera b/templates/show_profile.html.tera new file mode 100644 index 0000000..2566a9a --- /dev/null +++ b/templates/show_profile.html.tera @@ -0,0 +1,3 @@ +{% extends "base" %} +{% block main %} +{% endblock main %}