progress
This commit is contained in:
1 parent
b6c68f5045
commit
6ab9a59597
7 files changed
+142
-94
No files matched your search
@@ -22,7 +22,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
booksRepo.allTags()
|
||||
}
|
||||
|
||||
var tabCount = 1
|
||||
div(classes = "flex flex-col m-8") {
|
||||
form {
|
||||
attributes.hx {
|
||||
@@ -30,6 +29,9 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
target = "#response"
|
||||
swap = "innerHTML"
|
||||
}
|
||||
input(type = InputType.hidden, name = "bookId") {
|
||||
value = book.id.toString()
|
||||
}
|
||||
|
||||
div(classes = "flex flex-row mb-5 h-9") {
|
||||
div(classes = "w-30 content-center") {
|
||||
@@ -37,7 +39,7 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
select(classes = "$cssTextInput w-40") {
|
||||
name = "type"
|
||||
tabIndex = tabCount++.toString()
|
||||
autoFocus = true
|
||||
|
||||
for (type in BookType.entries) {
|
||||
option {
|
||||
@@ -55,7 +57,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
input(classes = "$cssTextInput w-150") {
|
||||
name = "title"
|
||||
tabIndex = tabCount++.toString()
|
||||
value = book.title
|
||||
}
|
||||
|
||||
@@ -66,7 +67,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
input(classes = "$cssTextInput w-150") {
|
||||
name = "originaltitle"
|
||||
tabIndex = tabCount++.toString()
|
||||
value = book.originalTitle ?: ""
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
input(classes = "$cssTextInput w-150") {
|
||||
name = "subtitle"
|
||||
tabIndex = tabCount++.toString()
|
||||
value = book.subTitle ?: ""
|
||||
}
|
||||
}
|
||||
@@ -87,7 +86,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
select(classes = "$cssTextInput w-16") {
|
||||
name = "language"
|
||||
tabIndex = tabCount++.toString()
|
||||
|
||||
for (language in Languages.entries) {
|
||||
option {
|
||||
@@ -104,7 +102,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
input(classes = "$cssTextInput w-16") {
|
||||
name = "year"
|
||||
tabIndex = tabCount++.toString()
|
||||
value = book.year.toString()
|
||||
}
|
||||
|
||||
@@ -113,7 +110,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
input(classes = "$cssTextInput w-16") {
|
||||
name = "originalyear"
|
||||
tabIndex = tabCount++.toString()
|
||||
value = book.originalYear?.toString() ?: ""
|
||||
}
|
||||
|
||||
@@ -124,7 +120,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
input(classes = "$cssTextInput w-40") {
|
||||
name = "isbn"
|
||||
tabIndex = tabCount++.toString()
|
||||
value = book.isbn
|
||||
}
|
||||
|
||||
@@ -133,7 +128,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
select(classes = "$cssTextInput w-74") {
|
||||
name = "publisher"
|
||||
tabIndex = tabCount++.toString()
|
||||
|
||||
option {
|
||||
value = "0"
|
||||
@@ -141,16 +135,20 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
for (pub in publishers) {
|
||||
option {
|
||||
if (pub == book.publisher)
|
||||
if (pub.id == book.publisher.id)
|
||||
selected = true
|
||||
value = pub.id.toString()
|
||||
+pub.name
|
||||
}
|
||||
}
|
||||
}
|
||||
a(classes = cssFormIcon) {
|
||||
tabIndex = tabCount++.toString()
|
||||
button(classes = cssFormIcon) {
|
||||
title = "Verlag hinzufügen"
|
||||
// TODO
|
||||
onClick = "document.getElementById('publisherDialog').showModal()"
|
||||
// attributes["command"] = "show-modal"
|
||||
// attributes["commandfor"] = "publisherDialog" //id
|
||||
|
||||
materialSymbolFormButton("add_box")
|
||||
}
|
||||
|
||||
@@ -162,7 +160,6 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
select(classes = "$cssTextInput w-98") {
|
||||
name = "series"
|
||||
tabIndex = tabCount++.toString()
|
||||
|
||||
option {
|
||||
value = "0"
|
||||
@@ -170,15 +167,14 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
for (serie in series) {
|
||||
option {
|
||||
if (serie == book.series)
|
||||
if (book.series != null && serie.id == book.series.id)
|
||||
selected = true
|
||||
value = serie.id.toString()
|
||||
+serie.name
|
||||
}
|
||||
}
|
||||
}
|
||||
a(classes = cssFormIcon) {
|
||||
tabIndex = tabCount++.toString()
|
||||
button(classes = cssFormIcon) {
|
||||
title = "Serie hinzufügen"
|
||||
materialSymbolFormButton("add_box")
|
||||
}
|
||||
@@ -188,24 +184,23 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
}
|
||||
input(classes = "$cssTextInput w-16") {
|
||||
name = "seriesindex"
|
||||
tabIndex = tabCount++.toString()
|
||||
value = book.seriesIndex?.toString() ?: ""
|
||||
}
|
||||
}
|
||||
|
||||
div(classes = "flex flex-row mb-5") {
|
||||
div(classes = "flex flex-row mb-7") {
|
||||
div(classes = "w-30 content-center") {
|
||||
+"Künstler"
|
||||
}
|
||||
div(classes = "overflow-auto px-1 pb-1 h-40") {
|
||||
tabIndex = "-1" // overflow setzt sonst einen Tabstopp
|
||||
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()
|
||||
button(classes = cssFormIcon) {
|
||||
title = "Künstler hinzufügen"
|
||||
materialSymbolFormButton("add_box")
|
||||
}
|
||||
@@ -223,41 +218,88 @@ fun FlowContent.bookEdit(book: Book, booksRepo: BookRepository) {
|
||||
+role.role
|
||||
}
|
||||
td(classes = "border-t-1 $borderTable px-2 py-1") {
|
||||
a(classes = cssFormIcon) {
|
||||
tabIndex = tabCount++.toString()
|
||||
button(classes = cssFormIcon) {
|
||||
// href = "${navBooksEdit.second}/${book.id}"
|
||||
materialSymbolFormButton("Edit")
|
||||
}
|
||||
a(classes = cssFormIcon) {
|
||||
tabIndex = tabCount++.toString()
|
||||
button(classes = cssFormIcon) {
|
||||
materialSymbolFormButton("Delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
div(classes = "ml-10 pr-8 content-center") {
|
||||
+"Tags"
|
||||
}
|
||||
div(classes = "overflow-auto px-1 pb-1 h-40") {
|
||||
tabIndex = "-1" // overflow setzt sonst einen Tabstopp
|
||||
table {
|
||||
thead(classes = "$cssFixedTHead ") {
|
||||
tr {
|
||||
th(classes = "py-3 px-2") { +"Tag" }
|
||||
th(classes = "py-3 px-2") {
|
||||
button(classes = cssFormIcon) {
|
||||
title = "Tag hinzufügen"
|
||||
materialSymbolFormButton("add_box")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
for (tag in book.tags) {
|
||||
tr {
|
||||
td(classes = "border-t-1 $borderTable px-2 py-1") {
|
||||
+tag.tag
|
||||
}
|
||||
td(classes = "border-t-1 $borderTable px-2 py-1") {
|
||||
button(classes = cssFormIcon) {
|
||||
materialSymbolFormButton("Delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// artists tags
|
||||
// | | | |
|
||||
// | | | |
|
||||
|
||||
}
|
||||
|
||||
div(classes = "flex flex-row mb-5 h-9") {
|
||||
// evtl. switch
|
||||
// Teil von Sammelband _____v / enthält (-> Link)
|
||||
// comment
|
||||
|
||||
div(classes = "flex flex-row mb-5") {
|
||||
div(classes = "w-30 content-center") {
|
||||
+"Kommentar"
|
||||
}
|
||||
textArea(classes = "$cssTextInput w-150 h-18 resize-none") {
|
||||
name = "comment"
|
||||
spellCheck = true
|
||||
+book.comments
|
||||
}
|
||||
}
|
||||
// TODO parent
|
||||
// evtl. switch oder <detail>
|
||||
// Teil von Sammelband _____v / enthält (-> Link)
|
||||
|
||||
div(classes = "flex flex-row mb-5 mr-2 justify-end") {
|
||||
button(classes = "$cssButtonStd block mt-8 mr-10") {
|
||||
type = ButtonType.button
|
||||
onClick =
|
||||
"window.history.back()"
|
||||
+"Abbrechen"
|
||||
}
|
||||
button(classes = "$cssButtonPri block mt-8") {
|
||||
type = ButtonType.submit
|
||||
+"Speichern"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
button(classes = "$cssButtonPri block mt-8") {
|
||||
tabIndex = tabCount++.toString()
|
||||
type = ButtonType.submit
|
||||
+"Save"
|
||||
// TODO
|
||||
dialog {
|
||||
id = "publisherDialog"
|
||||
attributes["closedby"] = "any"
|
||||
div {
|
||||
+"Test-Verlag"
|
||||
}
|
||||
}
|
||||
div {
|
||||
|
||||
Reference in new issue
Block a user