Change public/private button css

This commit is contained in:
Hubert Van De Walle 2020-10-23 08:26:03 +02:00
parent ead1932d48
commit 4ff97044f0

View File

@ -165,24 +165,29 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
} }
private fun DIV.noteActionForm(note: PersistedNote) { private fun DIV.noteActionForm(note: PersistedNote) {
span("flex space-x-2 justify-end mb-4") { form(method = FormMethod.post, classes = "inline flex space-x-2 justify-end mb-4") {
a( a(
href = "/notes/${note.uuid}/edit", href = "/notes/${note.uuid}/edit",
classes = "btn btn-green" classes = "btn btn-green"
) { +"Edit" } ) { +"Edit" }
form(method = FormMethod.post, classes = "inline") { span {
button( button(
type = ButtonType.submit, type = ButtonType.submit,
name = if (note.public) "private" else "public", name = if (note.public) "private" else "public",
classes = "btn btn-teal" classes = "font-semibold border-b-4 ${if (note.public) "border-teal-200" else "border-green-500"}" +
" p-2 rounded-l bg-teal-200 text-gray-800"
) { ) {
if (note.public) +"Private"
+"Private ?" }
else button(
+"Public ?" type = ButtonType.submit,
name = if (note.public) "private" else "public",
classes = "font-semibold border-b-4 ${if (!note.public) "border-teal-200" else "border-green-500"}" +
" p-2 rounded-r bg-teal-200 text-gray-800"
) {
+"Public"
} }
} }
form(method = FormMethod.post, classes = "inline") {
button( button(
type = ButtonType.submit, type = ButtonType.submit,
name = "delete", name = "delete",
@ -191,4 +196,3 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
} }
} }
} }
}