Update html layout

- add messages fragment
  - extract error and success message list from edit.html
  - extract error message list from create.html
  - add messages.html

- update edit account
  - update AccountController
    - update postEditAccount for validation
    - update getEditAccount for roleGroups
  - update validation for AccountForm for edit
  - add EditGroup
  - update Account.Response.toAccountForm()
  - update edit.html

- update create account
  - update AccountController
    - update postCreateAccount for validation
    - update getCreateAccount for role group
  - add validation to AccountForm
  - add PasswordMatchValidator
  - add annotation PasswordMatch
  - add CreateGroup
  - add temporary getRoles() in AccountRegistryService
  - update AccountForm.toAccountRequest() in Mapping
  - change management.css
    - add ::selection
    - add Selected Option Styling
  - add passwordMatchCheck to management.js
  - update create.html

- update user
  - add makeLocalTime in management.js
  - update users.html
  - update Pagination
    - add size of items
    - rename size to show

- update goodbye.html

- update logout.html

- update login.html

- update welcome.html

- update index.html

- update layout
  - update management.css
  - update management.js
  - update layout.html
This commit is contained in:
2025-03-01 16:04:56 +01:00
parent 4c6c7dd9d8
commit 4c4baa95dd
22 changed files with 807 additions and 344 deletions

View File

@@ -1,9 +1,19 @@
package ltd.hlaeja.form
import jakarta.validation.constraints.NotEmpty
import ltd.hlaeja.controller.validation.CreateGroup
import ltd.hlaeja.controller.validation.EditGroup
import ltd.hlaeja.controller.validation.PasswordMatch
@PasswordMatch(groups = [CreateGroup::class, EditGroup::class])
data class AccountForm(
val username: String,
val role: String,
val enabled: Boolean = false,
val password: CharSequence? = null,
val passwordConfirm: CharSequence? = null,
@field:NotEmpty(message = "Username cannot be empty", groups = [CreateGroup::class, EditGroup::class])
var username: String,
@field:NotEmpty(message = "At least one role must be selected", groups = [CreateGroup::class, EditGroup::class])
var roles: List<String> = emptyList(),
var enabled: Boolean = false,
@field:NotEmpty(message = "Password cannot be empty", groups = [CreateGroup::class])
var password: CharSequence? = null,
@field:NotEmpty(message = "Password confirmation cannot be empty", groups = [CreateGroup::class])
var passwordConfirm: CharSequence? = null,
)