Vaihe 1/1: users-moduuli, kirjautuminen ja käyttäjähallinta

- shared-moduuli: DomainError, EmailAddress, UnitOfWork, tapahtumat,
  TimestampedModel, daisyUI-lomakerenderöinti ja yhteiset pohjat
- users-moduuli Clean Architecture -kerroksin: oma käyttäjämalli
  (AUTH_USER_MODEL), roolit ja oikeudet, harjoittelija-, vastuuhenkilö-
  ja viimeisen pääkäyttäjän säännöt
- kirjautuminen sähköpostilla, yritysten rajoitus, "muista minut",
  istunnon katkaisu kun tunnus poistetaan käytöstä tai harjoittelu päättyy
- kertakäyttöiset salasanalinkit (72 h / 60 min, uusi mitätöi vanhan),
  salasanasääntö ja create_admin-komento
- käyttäjähallinta: lista (HTMX-haku), lomakkeet ja kopioitava linkki
- Tailwind 4 + daisyUI 5 + HTMX + Alpine npm-buildilla, suomennokset
- testit: domain, application (fakeilla), integraatio ja selaintestit
  (axe, vaalea/tumma, 1920/320 px); ruff, mypy ja import-linter
- dokumentit päivitetty toteutuksen mukaisiksi

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-29 13:20:24 +02:00
co-authored by Claude Opus 5.5
parent ba7a7ecfcf
commit e7b2745916
113 changed files with 5558 additions and 98 deletions
+499
View File
@@ -0,0 +1,499 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-29 12:10+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: .\apps\users\infrastructure\password.py:15
#, python-format
msgid "The password must be at least %(min)d characters long."
msgstr "Salasanassa on oltava vähintään %(min)d merkkiä."
#: .\apps\users\infrastructure\password.py:21
msgid "The password must contain an upper case letter."
msgstr "Salasanassa on oltava iso kirjain."
#: .\apps\users\infrastructure\password.py:22
msgid "The password must contain a lower case letter."
msgstr "Salasanassa on oltava pieni kirjain."
#: .\apps\users\infrastructure\password.py:23
msgid "The password must contain a digit."
msgstr "Salasanassa on oltava numero."
#: .\apps\users\infrastructure\password.py:26
msgid "The password must contain a special character."
msgstr "Salasanassa on oltava erikoismerkki."
#: .\apps\users\infrastructure\password.py:36
#, python-format
msgid ""
"At least %(min)d characters, including upper and lower case letters, a digit "
"and a special character."
msgstr "Vähintään %(min)d merkkiä, joista on oltava iso ja pieni kirjain, numero ja erikoismerkki."
#: .\apps\users\presentation\forms.py:22 .\apps\users\presentation\forms.py:52
#: .\apps\users\presentation\forms.py:66
#: .\apps\users\presentation\templates\users\partials\user_table.html:9
msgid "Email"
msgstr "Sähköposti"
#: .\apps\users\presentation\forms.py:25
msgid "Remember me"
msgstr "Muista minut"
#: .\apps\users\presentation\forms.py:29 .\apps\users\presentation\forms.py:30
msgid "The email address or password is incorrect."
msgstr "Sähköpostiosoite tai salasana on väärin."
#: .\apps\users\presentation\forms.py:31
msgid "Too many login attempts. Try again in a few minutes."
msgstr "Liian monta kirjautumisyritystä. Yritä uudelleen muutaman minuutin kuluttua."
#: .\apps\users\presentation\forms.py:65
#: .\apps\users\presentation\templates\users\partials\user_table.html:8
msgid "Name"
msgstr "Nimi"
#: .\apps\users\presentation\forms.py:67 .\apps\users\presentation\forms.py:110
#: .\apps\users\presentation\templates\users\partials\user_table.html:10
msgid "Role"
msgstr "Rooli"
#: .\apps\users\presentation\forms.py:68 .\apps\users\presentation\forms.py:115
#: .\apps\users\presentation\templates\users\partials\user_table.html:23
msgid "Active"
msgstr "Aktiivinen"
#: .\apps\users\presentation\forms.py:70
#: .\apps\users\presentation\templates\users\partials\user_table.html:12
msgid "Last day"
msgstr "Viimeinen päivä"
#: .\apps\users\presentation\forms.py:73
msgid "The intern cannot log in after this day."
msgstr "Harjoittelija ei voi kirjautua tämän päivän jälkeen."
#: .\apps\users\presentation\forms.py:76
#: .\apps\users\presentation\templates\users\partials\user_table.html:13
msgid "Supervisor"
msgstr "Vastuuhenkilö"
#: .\apps\users\presentation\forms.py:87
msgid "Choose a supervisor"
msgstr "Valitse vastuuhenkilö"
#: .\apps\users\presentation\forms.py:108
msgid "Search"
msgstr "Haku"
#: .\apps\users\presentation\forms.py:110
msgid "All roles"
msgstr "Kaikki roolit"
#: .\apps\users\presentation\forms.py:113
#: .\apps\users\presentation\templates\users\partials\user_table.html:11
msgid "Status"
msgstr "Tila"
#: .\apps\users\presentation\forms.py:115
msgid "All"
msgstr "Kaikki"
#: .\apps\users\presentation\forms.py:115
#: .\apps\users\presentation\templates\users\partials\user_table.html:24
msgid "Inactive"
msgstr "Ei aktiivinen"
#: .\apps\users\presentation\labels.py:8
msgid "Admin"
msgstr "Pääkäyttäjä"
#: .\apps\users\presentation\labels.py:9
msgid "Management"
msgstr "Johto"
#: .\apps\users\presentation\labels.py:10
msgid "Employee"
msgstr "Työntekijä"
#: .\apps\users\presentation\labels.py:11
msgid "Intern"
msgstr "Harjoittelija"
#: .\apps\users\presentation\labels.py:12
msgid "Subcontractor"
msgstr "Alihankkija"
#: .\apps\users\presentation\labels.py:18
msgid "Enter a name (at most 150 characters)."
msgstr "Anna nimi (enintään 150 merkkiä)."
#: .\apps\users\presentation\labels.py:19
msgid "Enter a valid email address."
msgstr "Anna kelvollinen sähköpostiosoite."
#: .\apps\users\presentation\labels.py:20
msgid "A user with this email address already exists."
msgstr "Tällä sähköpostiosoitteella on jo käyttäjä."
#: .\apps\users\presentation\labels.py:21
msgid "An intern must have an end date."
msgstr "Harjoittelijalla on oltava viimeinen päivä."
#: .\apps\users\presentation\labels.py:22
msgid "An intern must have a supervisor."
msgstr "Harjoittelijalla on oltava vastuuhenkilö."
#: .\apps\users\presentation\labels.py:23
msgid "The supervisor must be an active management or employee user."
msgstr "Vastuuhenkilön on oltava aktiivinen johdon jäsen tai työntekijä."
#: .\apps\users\presentation\labels.py:25
msgid ""
"This is the last active admin. It cannot be deactivated or moved to another "
"role."
msgstr "Tämä on viimeinen aktiivinen pääkäyttäjä. Sitä ei voi poistaa käytöstä eikä siirtää toiseen rooliin."
#: .\apps\users\presentation\labels.py:28
msgid "This user supervises active interns. Change their supervisor first."
msgstr "Käyttäjä on aktiivisten harjoittelijoiden vastuuhenkilö. Vaihda ensin heidän vastuuhenkilönsä."
#: .\apps\users\presentation\labels.py:30
msgid "The user was not found."
msgstr "Käyttäjää ei löytynyt."
#: .\apps\users\presentation\labels.py:31
msgid "The change could not be saved."
msgstr "Muutosta ei voitu tallentaa."
#: .\apps\users\presentation\templates\users\email\password_link.txt:1
#, python-format
msgid "Hello %(name)s,"
msgstr "Hei %(name)s,"
#: .\apps\users\presentation\templates\users\email\password_link.txt:3
msgid "You asked for a link for setting a new password."
msgstr "Pyysit linkkiä uuden salasanan asettamiseen."
#: .\apps\users\presentation\templates\users\email\password_link.txt:3
msgid ""
"An account has been created or a new password link has been requested for "
"you."
msgstr "Sinulle on luotu käyttäjätunnus tai pyydetty uusi salasanalinkki."
#: .\apps\users\presentation\templates\users\email\password_link.txt:4
msgid "Set your password with this link:"
msgstr "Aseta salasanasi tällä linkillä:"
#: .\apps\users\presentation\templates\users\email\password_link.txt:8
#, python-format
msgid "The link can be used once and it is valid until %(expires)s."
msgstr "Linkin voi käyttää kerran, ja se on voimassa %(expires)s asti."
#: .\apps\users\presentation\templates\users\email\password_link.txt:9
msgid "If you did not expect this message, you can ignore it."
msgstr "Jos et odottanut tätä viestiä, voit jättää sen huomiotta."
#: .\apps\users\presentation\templates\users\email\password_link_subject.txt:1
msgid "Set a new password"
msgstr "Aseta uusi salasana"
#: .\apps\users\presentation\templates\users\email\password_link_subject.txt:1
msgid "Set your password"
msgstr "Aseta salasanasi"
#: .\apps\users\presentation\templates\users\forgot_password.html:2
#: .\apps\users\presentation\templates\users\forgot_password.html:4
#: .\apps\users\presentation\templates\users\login.html:16
msgid "Forgot your password?"
msgstr "Unohtuiko salasana?"
#: .\apps\users\presentation\templates\users\forgot_password.html:5
msgid ""
"Enter your email address. We will send you a link for setting a new password."
msgstr "Anna sähköpostiosoitteesi. Lähetämme sinulle linkin uuden salasanan asettamiseen."
#: .\apps\users\presentation\templates\users\forgot_password.html:9
msgid "Send link"
msgstr "Lähetä linkki"
#: .\apps\users\presentation\templates\users\forgot_password.html:11
msgid "Back to login"
msgstr "Takaisin kirjautumiseen"
#: .\apps\users\presentation\templates\users\form.html:2
#: .\apps\users\presentation\templates\users\form.html:8
#: .\apps\users\presentation\templates\users\password_link_page.html:9
msgid "Edit user"
msgstr "Muokkaa käyttäjää"
#: .\apps\users\presentation\templates\users\form.html:2
#: .\apps\users\presentation\templates\users\form.html:6
#: .\apps\users\presentation\templates\users\form.html:8
#: .\apps\users\presentation\templates\users\list.html:6
msgid "New user"
msgstr "Uusi käyttäjä"
#: .\apps\users\presentation\templates\users\form.html:4
msgid "Breadcrumbs"
msgstr "Murupolku"
#: .\apps\users\presentation\templates\users\form.html:5
#: .\apps\users\presentation\templates\users\list.html:2
#: .\apps\users\presentation\templates\users\list.html:5
#: .\apps\users\presentation\templates\users\partials\user_table.html:5
#: .\templates\base.html:56
msgid "Users"
msgstr "Käyttäjät"
#: .\apps\users\presentation\templates\users\form.html:20
msgid "An intern must have a last day and a supervisor."
msgstr "Harjoittelijalla on oltava viimeinen päivä ja vastuuhenkilö."
#: .\apps\users\presentation\templates\users\form.html:26
#: .\templates\components\confirm_dialog.html:8
msgid "Cancel"
msgstr "Peruuta"
#: .\apps\users\presentation\templates\users\form.html:27
msgid "Save"
msgstr "Tallenna"
#: .\apps\users\presentation\templates\users\form.html:35
#: .\apps\users\presentation\templates\users\password_link_page.html:2
msgid "Password link"
msgstr "Salasanalinkki"
#: .\apps\users\presentation\templates\users\form.html:36
msgid ""
"Creates a new link for setting the password. The link is emailed to the user "
"and shown here for copying. Earlier links stop working."
msgstr "Luo uuden linkin salasanan asettamiseen. Linkki lähetetään käyttäjälle sähköpostilla ja näytetään tässä kopioitavaksi. Aiemmat linkit lakkaavat toimimasta."
#: .\apps\users\presentation\templates\users\form.html:37
msgid "Create password link"
msgstr "Luo salasanalinkki"
#: .\apps\users\presentation\templates\users\form.html:42
msgid "Create a new password link?"
msgstr "Luodaanko uusi salasanalinkki?"
#: .\apps\users\presentation\templates\users\form.html:43
msgid "Earlier links of this user stop working."
msgstr "Käyttäjän aiemmat linkit lakkaavat toimimasta."
#: .\apps\users\presentation\templates\users\form.html:44
msgid "Create link"
msgstr "Luo linkki"
#: .\apps\users\presentation\templates\users\list.html:9
msgid "Filter users"
msgstr "Suodata käyttäjiä"
#: .\apps\users\presentation\templates\users\list.html:17
msgid "Filter"
msgstr "Suodata"
#: .\apps\users\presentation\templates\users\login.html:2
#: .\apps\users\presentation\templates\users\login.html:4
#: .\apps\users\presentation\templates\users\login.html:14
msgid "Log in"
msgstr "Kirjaudu"
#: .\apps\users\presentation\templates\users\login.html:7
msgid ""
"Your access has ended: the account has been deactivated or the internship "
"has ended. Contact the admin if you think this is a mistake."
msgstr "Käyttöoikeutesi on päättynyt: tunnus on poistettu käytöstä tai harjoittelu on päättynyt. Ota yhteyttä pääkäyttäjään, jos tämä on mielestäsi virhe."
#: .\apps\users\presentation\templates\users\partials\password_link.html:4
#, python-format
msgid "The link has been emailed to %(email)s."
msgstr "Linkki on lähetetty osoitteeseen %(email)s."
#: .\apps\users\presentation\templates\users\partials\password_link.html:6
msgid "Sending the email failed."
msgstr "Sähköpostin lähetys epäonnistui."
#: .\apps\users\presentation\templates\users\partials\password_link.html:7
msgid "Deliver the link to the user in another way."
msgstr "Toimita linkki käyttäjälle muuta kautta."
#: .\apps\users\presentation\templates\users\partials\password_link.html:9
#, python-format
msgid "Valid until %(expires)s."
msgstr "Voimassa %(expires)s asti."
#: .\apps\users\presentation\templates\users\partials\password_link.html:11
msgid "Link"
msgstr "Linkki"
#: .\apps\users\presentation\templates\users\partials\password_link.html:15
#: .\apps\users\presentation\templates\users\partials\password_link.html:19
msgid "Link copied"
msgstr "Linkki kopioitu"
#: .\apps\users\presentation\templates\users\partials\password_link.html:16
msgid "Copy"
msgstr "Kopioi"
#: .\apps\users\presentation\templates\users\partials\user_table.html:2
#, python-format
msgid "%(counter)s user found"
msgid_plural "%(counter)s users found"
msgstr[0] "%(counter)s käyttäjä löytyi"
msgstr[1] "%(counter)s käyttäjää löytyi"
#: .\apps\users\presentation\templates\users\partials\user_table.html:30
msgid "No users match the filters."
msgstr "Hakuehtoja vastaavia käyttäjiä ei löytynyt."
#: .\apps\users\presentation\templates\users\partials\user_table.html:36
msgid "Pages"
msgstr "Sivut"
#: .\apps\users\presentation\templates\users\partials\user_table.html:39
msgid "Previous"
msgstr "Edellinen"
#: .\apps\users\presentation\templates\users\partials\user_table.html:41
#, python-format
msgid "Page %(n)s / %(total)s"
msgstr "Sivu %(n)s / %(total)s"
#: .\apps\users\presentation\templates\users\partials\user_table.html:44
msgid "Next"
msgstr "Seuraava"
#: .\apps\users\presentation\templates\users\password_link_page.html:4
#, python-format
msgid "Password link for %(name)s"
msgstr "Salasanalinkki: %(name)s"
#: .\apps\users\presentation\templates\users\password_link_page.html:10
msgid "Back to users"
msgstr "Takaisin käyttäjiin"
#: .\apps\users\presentation\templates\users\set_password.html:2
#: .\apps\users\presentation\templates\users\set_password.html:4
#: .\apps\users\presentation\templates\users\set_password.html:8
msgid "Set password"
msgstr "Aseta salasana"
#: .\apps\users\presentation\templates\users\set_password_invalid.html:2
#: .\apps\users\presentation\templates\users\set_password_invalid.html:4
msgid "The link is not valid"
msgstr "Linkki ei ole voimassa"
#: .\apps\users\presentation\templates\users\set_password_invalid.html:5
msgid ""
"The link has expired, it has already been used, or a newer link has been "
"created. Request a new link or ask the admin to create one."
msgstr "Linkki on vanhentunut, sitä on jo käytetty tai sen jälkeen on luotu uusi linkki. Tilaa uusi linkki tai pyydä pääkäyttäjää luomaan se."
#: .\apps\users\presentation\templates\users\set_password_invalid.html:6
msgid "Request a new link"
msgstr "Tilaa uusi linkki"
#: .\apps\users\presentation\views.py:58
msgid ""
"If the address belongs to a user who may log in, a link for setting the "
"password has been sent to it. The link is valid for 60 minutes."
msgstr "Jos osoite kuuluu käyttäjälle, joka saa kirjautua, siihen on lähetetty linkki salasanan asettamiseen. Linkki on voimassa 60 minuuttia."
#: .\apps\users\presentation\views.py:95
msgid "Your password has been set. You can now log in."
msgstr "Salasana on asetettu. Voit nyt kirjautua."
#: .\apps\users\presentation\views.py:144
msgid "User created."
msgstr "Käyttäjä luotu."
#: .\apps\users\presentation\views.py:196
msgid "Changes saved."
msgstr "Muutokset tallennettu."
#: .\templates\403.html:2 .\templates\403.html:4
msgid "Access denied"
msgstr "Ei käyttöoikeutta"
#: .\templates\403.html:5
msgid "You do not have permission to view this page."
msgstr "Sinulla ei ole oikeutta tähän sivuun."
#: .\templates\403.html:6 .\templates\404.html:6
msgid "Back to home"
msgstr "Takaisin etusivulle"
#: .\templates\404.html:2 .\templates\404.html:4
msgid "Page not found"
msgstr "Sivua ei löydy"
#: .\templates\404.html:5
msgid "The page you requested does not exist."
msgstr "Pyytämääsi sivua ei ole olemassa."
#: .\templates\base.html:20
msgid "Skip to content"
msgstr "Siirry sisältöön"
#: .\templates\base.html:23
msgid "Show menu"
msgstr "Näytä valikko"
#: .\templates\base.html:26
msgid "Open menu"
msgstr "Avaa valikko"
#: .\templates\base.html:38
msgid "Log out"
msgstr "Kirjaudu ulos"
#: .\templates\base.html:50
msgid "Close menu"
msgstr "Sulje valikko"
#: .\templates\base.html:51
msgid "Main menu"
msgstr "Päävalikko"
#: .\templates\base.html:53 .\templates\home.html:2
msgid "Home"
msgstr "Etusivu"
#: .\templates\base.html:55
msgid "Administration"
msgstr "Hallinto"
#: .\templates\components\field.html:10
msgid "(required)"
msgstr "(pakollinen)"
#: .\templates\components\theme_toggle.html:5
msgid "Dark theme"
msgstr "Tumma teema"
#: .\templates\home.html:4
#, python-format
msgid "Welcome, %(name)s"
msgstr "Tervetuloa, %(name)s"
#: .\templates\home.html:5
msgid "The dashboard will be built in a later step."
msgstr "Työpöytä rakennetaan myöhemmässä vaiheessa."