progress
This commit is contained in:
1 parent
e08a941c62
commit
3d165ee610
12 files changed
+116
-30
No files matched your search
@@ -136,6 +136,7 @@ fun FlowContent.bookEdit(
|
||||
}
|
||||
select(classes = "$cssTextInput w-74") {
|
||||
name = "publisher"
|
||||
id = "publisher"
|
||||
|
||||
option {
|
||||
value = "0"
|
||||
@@ -294,7 +295,7 @@ fun FlowContent.bookEdit(
|
||||
// evtl. switch oder <detail>
|
||||
// Teil von Sammelband _____v / enthält (-> Link)
|
||||
|
||||
div(classes = "flex flex-row mb-5 mr-2 justify-end") {
|
||||
div(classes = "flex flex-row mb-5 mr-2 justify-end w-180") {
|
||||
button(classes = "$cssButtonStd block mt-8 mr-10") {
|
||||
type = ButtonType.button
|
||||
onClick =
|
||||
@@ -316,13 +317,58 @@ fun FlowContent.bookEdit(
|
||||
id = "publisherDialog"
|
||||
// attributes["popover"] = "true"
|
||||
// attributes["closedby"] = "any"
|
||||
div {
|
||||
+"Test-Verlag"
|
||||
}
|
||||
button(classes = cssButtonStd) {
|
||||
attributes["commandfor"] = "publisherDialog"
|
||||
attributes["command"] = "close"
|
||||
+"Close"
|
||||
form {
|
||||
id = "publisherDialogForm"
|
||||
attributes.hx {
|
||||
post = "${navBooksEdit.second}/addpublisher"
|
||||
target = "#publisher"
|
||||
swap = "innerHTML"
|
||||
validate = true
|
||||
on(
|
||||
event = "after-request",
|
||||
script = "this.reset();document.getElementById('publisherDialog').close()"
|
||||
)
|
||||
}
|
||||
input(type = InputType.hidden, name = "sessionId") {
|
||||
value = session.sessionId
|
||||
}
|
||||
input(type = InputType.hidden, name = "bookId") {
|
||||
value = session.data.book.id.toString()
|
||||
}
|
||||
|
||||
div(classes = "flex flex-row mb-5 h-9") {
|
||||
div(classes = "content-center pr-6 text-nowrap") {
|
||||
+"Neuer Verlag:"
|
||||
}
|
||||
input(classes = "$cssTextInput w-75") {
|
||||
name = "newpublisher"
|
||||
required = true
|
||||
value = ""
|
||||
onBlur = """
|
||||
const select = document.getElementById('publisher')
|
||||
const optArray = Array.from(select.options)
|
||||
if (optArray.some(opt => opt.text.toLowerCase() === this.value.toLowerCase() )) {
|
||||
this.setCustomValidity('Dieser Verlag existiert bereits.');
|
||||
} else {
|
||||
this.setCustomValidity('');
|
||||
}
|
||||
"""
|
||||
}
|
||||
}
|
||||
div(classes = "flex flex-row mb-5 mr-2 justify-end") {
|
||||
button(classes = "$cssButtonStd block mt-8 mr-10") {
|
||||
type = ButtonType.button
|
||||
onClick =
|
||||
"document.getElementById('publisherDialogForm').reset()"
|
||||
attributes["commandfor"] = "publisherDialog"
|
||||
attributes["command"] = "close"
|
||||
+"Abbrechen"
|
||||
}
|
||||
button(classes = "$cssButtonPri block mt-8") {
|
||||
type = ButtonType.submit
|
||||
+"Speichern"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output { }
|
||||
|
||||
Reference in new issue
Block a user