From 4938314889359ab9d636dd13aecf4b6d647080d4 Mon Sep 17 00:00:00 2001 From: Priec Date: Sat, 16 May 2026 21:46:02 +0200 Subject: [PATCH] about page --- ht_booking/README.md | 9 +- ht_booking/assets/i18n/en/main.ftl | 11 +- ht_booking/assets/i18n/sk/main.ftl | 11 +- ht_booking/assets/views/about.html | 51 +++++++ ht_booking/assets/views/admin/about_form.html | 43 ++++++ ht_booking/assets/views/base.html | 2 + ht_booking/migration/src/lib.rs | 2 + .../migration/src/m20260516_120000_about.rs | 29 ++++ ht_booking/src/app.rs | 2 + ht_booking/src/controllers/about.rs | 141 ++++++++++++++++++ ht_booking/src/controllers/mod.rs | 1 + ht_booking/src/models/_entities/about.rs | 21 +++ ht_booking/src/models/_entities/mod.rs | 1 + ht_booking/src/models/_entities/prelude.rs | 1 + ht_booking/src/models/about.rs | 28 ++++ ht_booking/src/models/mod.rs | 1 + 16 files changed, 348 insertions(+), 6 deletions(-) create mode 100644 ht_booking/assets/views/about.html create mode 100644 ht_booking/assets/views/admin/about_form.html create mode 100644 ht_booking/migration/src/m20260516_120000_about.rs create mode 100644 ht_booking/src/controllers/about.rs create mode 100644 ht_booking/src/models/_entities/about.rs create mode 100644 ht_booking/src/models/about.rs diff --git a/ht_booking/README.md b/ht_booking/README.md index 43b9bdd..0f3f480 100644 --- a/ht_booking/README.md +++ b/ht_booking/README.md @@ -1,9 +1,10 @@ -# Welcome to Loco :train: +# Tenis Rajec — tenisrajec.sk -[Loco](https://loco.rs) is a web and API framework running on Rust. +Booking site for the tennis courts in Rajec. Visitors browse the weekly court +calendar and an *About* page; the single admin manages courts, bookings and the +About-page content. -This is the **SaaS starter** which includes a `User` model and authentication based on JWT. -It also include configuration sections that help you pick either a frontend or a server-side template set up for your fullstack server. +Built with [Loco](https://loco.rs), a web framework running on Rust. ## Quick Start diff --git a/ht_booking/assets/i18n/en/main.ftl b/ht_booking/assets/i18n/en/main.ftl index fa525c0..4a55042 100644 --- a/ht_booking/assets/i18n/en/main.ftl +++ b/ht_booking/assets/i18n/en/main.ftl @@ -1,4 +1,4 @@ -brand = Tennis Court Booking +brand = Tenis Rajec nav-calendar = Calendar nav-admin = Admin login admin-title = Admin @@ -63,3 +63,12 @@ hour-from = From hour-to = Until repeat-weeks = Repeat for (weeks) repeat-hint = 1 books a single week. A higher number repeats the same hours every following week. +nav-about = About +about-title = About us +about-edit = Edit page +back-to-about = Back to About +about-heading = Heading +about-body = Description +about-address = Address +about-phone = Phone +about-email = Email diff --git a/ht_booking/assets/i18n/sk/main.ftl b/ht_booking/assets/i18n/sk/main.ftl index bb663be..c181600 100644 --- a/ht_booking/assets/i18n/sk/main.ftl +++ b/ht_booking/assets/i18n/sk/main.ftl @@ -1,4 +1,4 @@ -brand = Rezervácia tenisového kurtu +brand = Tenis Rajec nav-calendar = Kalendár nav-admin = Prihlásenie admina admin-title = Admin @@ -63,3 +63,12 @@ hour-from = Od hour-to = Do repeat-weeks = Opakovať (počet týždňov) repeat-hint = 1 rezervuje jeden týždeň. Vyššie číslo opakuje rovnaké hodiny každý ďalší týždeň. +nav-about = O nás +about-title = O nás +about-edit = Upraviť stránku +back-to-about = Späť na stránku O nás +about-heading = Nadpis +about-body = Popis +about-address = Adresa +about-phone = Telefón +about-email = E-mail diff --git a/ht_booking/assets/views/about.html b/ht_booking/assets/views/about.html new file mode 100644 index 0000000..d5d660c --- /dev/null +++ b/ht_booking/assets/views/about.html @@ -0,0 +1,51 @@ +{% extends "base.html" %} + +{% block title %}{{ t(key="about-title", lang=lang) }}{% endblock title %} + +{% block content %} +
+
+

+ {% if title %}{{ title }}{% else %}{{ t(key="about-title", lang=lang) }}{% endif %} +

+ {% if logged_in | default(value=false) %} + {{ t(key="about-edit", lang=lang) }} + {% endif %} +
+ +
+
+ {% if body %} +

{{ body }}

+ {% endif %} + + {% if address or phone or email %} +
+ {% if address %} +
+
{{ t(key="about-address", lang=lang) }}
+
{{ address }}
+
+ {% endif %} + {% if phone %} +
+
{{ t(key="about-phone", lang=lang) }}
+
+ {{ phone }} +
+
+ {% endif %} + {% if email %} +
+
{{ t(key="about-email", lang=lang) }}
+
+ {{ email }} +
+
+ {% endif %} +
+ {% endif %} +
+
+
+{% endblock content %} diff --git a/ht_booking/assets/views/admin/about_form.html b/ht_booking/assets/views/admin/about_form.html new file mode 100644 index 0000000..c32e6e8 --- /dev/null +++ b/ht_booking/assets/views/admin/about_form.html @@ -0,0 +1,43 @@ +{% extends "base.html" %} + +{% block title %}{{ t(key="about-edit", lang=lang) }}{% endblock title %} + +{% block content %} +
+
+

{{ t(key="about-edit", lang=lang) }}

+ « {{ t(key="back-to-about", lang=lang) }} +
+ +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + {{ t(key="cancel", lang=lang) }} +
+
+
+
+
+{% endblock content %} diff --git a/ht_booking/assets/views/base.html b/ht_booking/assets/views/base.html index 266f97e..54b62dd 100644 --- a/ht_booking/assets/views/base.html +++ b/ht_booking/assets/views/base.html @@ -93,6 +93,7 @@