This commit is contained in:
Hartmut Bauer committed 2026-10-11 01:06:16 +02:00
1 parent d84861949f
commit b6c68f5045
14 files changed
+296 -49

No files matched your search

+89 -24
View File
@@ -22,6 +22,7 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
booksRepo.allTags()
}
var tabCount = 1
div(classes = "flex flex-col m-8") {
form {
attributes.hx {
@@ -31,44 +32,62 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "w-30 ") {
div(classes = "w-30 content-center") {
+"Typ"
}
select(classes = "$cssTextInput w-40") {
name = "type"
tabIndex = tabCount++.toString()
for (type in BookType.entries) {
option {
if (type == book.type)
selected = true
value = type.ordinal.toString()
+type.name
}
}
}
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "w-30 content-center") {
+"Titel:"
}
input(classes = "$cssTextInput w-150") {
name = "title"
tabIndex = "1"
tabIndex = tabCount++.toString()
value = book.title
}
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "w-30 ") {
div(classes = "w-30 content-center") {
+"Originaltitel:"
}
input(classes = "$cssTextInput w-150") {
name = "originaltitle"
tabIndex = "2"
tabIndex = tabCount++.toString()
value = book.originalTitle ?: ""
}
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "w-30 ") {
div(classes = "w-30 content-center") {
+"Untertitel:"
}
input(classes = "$cssTextInput w-150") {
name = "subtitle"
tabIndex = "3"
tabIndex = tabCount++.toString()
value = book.subTitle ?: ""
}
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "w-30") {
div(classes = "w-30 content-center") {
+"Sprache"
}
select(classes = "$cssTextInput w-16") {
name = "language"
tabIndex = "4"
tabIndex = tabCount++.toString()
for (language in Languages.entries) {
option {
@@ -80,41 +99,41 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
}
}
div(classes = "ml-9 pr-3 ") {
div(classes = "ml-9 pr-3 content-center") {
+"Erscheinungsjahr:"
}
input(classes = "$cssTextInput w-16") {
name = "year"
tabIndex = "5"
tabIndex = tabCount++.toString()
value = book.year.toString()
}
div(classes = "ml-8 pr-3") {
div(classes = "ml-8 pr-3 content-center") {
+"Jahr der Originalausgabe:"
}
input(classes = "$cssTextInput w-16") {
name = "originalyear"
tabIndex = "6"
tabIndex = tabCount++.toString()
value = book.originalYear?.toString() ?: ""
}
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "w-30") {
div(classes = "w-30 content-center") {
+"ISBN"
}
input(classes = "$cssTextInput w-40") {
name = "isbn"
tabIndex = "7"
tabIndex = tabCount++.toString()
value = book.isbn
}
div(classes = "ml-14 pr-3") {
div(classes = "ml-14 pr-3 content-center") {
+"Verlag"
}
select(classes = "$cssTextInput w-74") {
name = "publisher"
tabIndex = "8"
tabIndex = tabCount++.toString()
option {
value = "0"
@@ -130,7 +149,7 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
}
}
a(classes = cssFormIcon) {
tabIndex = "9"
tabIndex = tabCount++.toString()
title = "Verlag hinzufügen"
materialSymbolFormButton("add_box")
}
@@ -138,12 +157,12 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "w-30") {
div(classes = "w-30 content-center") {
+"Serie"
}
select(classes = "$cssTextInput w-98") {
name = "series"
tabIndex = "10"
tabIndex = tabCount++.toString()
option {
value = "0"
@@ -159,22 +178,68 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
}
}
a(classes = cssFormIcon) {
tabIndex = "11"
tabIndex = tabCount++.toString()
title = "Serie hinzufügen"
materialSymbolFormButton("add_box")
}
div(classes = "ml-13 pr-3 ") {
div(classes = "ml-13 pr-3 content-center") {
+"Index"
}
input(classes = "$cssTextInput w-16") {
name = "seriesindex"
tabIndex = "12"
tabIndex = tabCount++.toString()
value = book.seriesIndex?.toString() ?: ""
}
}
div(classes = "flex flex-row mb-5 h-9") {
div(classes = "flex flex-row mb-5") {
div(classes = "w-30 content-center") {
+"Künstler"
}
div(classes = "overflow-auto px-1 pb-1 h-40") {
table {
thead(classes = "$cssFixedTHead ") {
tr {
th(classes = "py-3 px-2") { +"Name" }
th(classes = "py-3 px-2") { +"Rolle" }
th(classes = "py-3 px-2") {
a(classes = cssFormIcon) {
tabIndex = tabCount++.toString()
title = "Künstler hinzufügen"
materialSymbolFormButton("add_box")
}
}
}
}
tbody {
for ((artist, role) in book.artists) {
tr {
td(classes = "border-t-1 $borderTable px-2 py-1") {
+"${artist.name}, ${artist.givenName}"
}
td(classes = "border-t-1 $borderTable px-2 py-1") {
+role.role
}
td(classes = "border-t-1 $borderTable px-2 py-1") {
a(classes = cssFormIcon) {
tabIndex = tabCount++.toString()
// href = "${navBooksEdit.second}/${book.id}"
materialSymbolFormButton("Edit")
}
a(classes = cssFormIcon) {
tabIndex = tabCount++.toString()
materialSymbolFormButton("Delete")
}
}
}
}
}
}
}
// artists tags
// | | | |
// | | | |
@@ -190,7 +255,7 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
button(classes = "$cssButtonPri block mt-8") {
tabIndex = "20"
tabIndex = tabCount++.toString()
type = ButtonType.submit
+"Save"
}