More buttons

This commit is contained in:
Hubert Van De Walle 2020-08-14 16:12:17 +02:00
parent 90f6709885
commit fb49d45677
3 changed files with 19 additions and 9 deletions

View File

@ -104,18 +104,16 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
} }
} }
} }
span("flex justify-end mb-4") { span("flex space-x-2 justify-end mb-4") {
a( a(
href = "/notes/${note.uuid}/edit", href = "/notes/${note.uuid}/edit",
classes = "mx-2 bg-teal-500 hover:bg-teal-600 focus:bg-teal-600" + classes = "btn btn-teal"
" focus:outline-none text-white font-bold py-2 px-4 rounded"
) { +"Edit" } ) { +"Edit" }
form(method = FormMethod.post, classes = "inline") { form(method = FormMethod.post, classes = "inline") {
button( button(
type = ButtonType.submit, type = ButtonType.submit,
name = "delete", name = "delete",
classes = "mx-2 bg-red-500 hover:bg-red-600 focus:bg-red-600" + classes = "btn btn-red"
" focus:outline-none text-white font-bold py-2 px-4 rounded"
) { +"Delete" } ) { +"Delete" }
} }
} }

View File

@ -6,18 +6,18 @@ import kotlinx.html.*
fun BODY.navbar(jwtPayload: JwtPayload?) { fun BODY.navbar(jwtPayload: JwtPayload?) {
nav("nav bg-teal-700 shadow-md flex items-center justify-between px-4") { nav("nav bg-teal-700 shadow-md flex items-center justify-between px-4") {
a(href = "/", classes = "text-2xl text-gray-100 font-bold") { +"SimpleNotes" } a(href = "/", classes = "text-2xl text-gray-100 font-bold") { +"SimpleNotes" }
ul { ul("space-x-2") {
if (jwtPayload != null) { if (jwtPayload != null) {
li("inline text-gray-100 ml-2 text-md font-semibold") { li("inline text-gray-100 text-md font-semibold") {
a(href = "/notes") { +"Notes" } a(href = "/notes") { +"Notes" }
} }
li("inline ml-2") { li("inline") {
form(classes = "inline", action = "/logout", method = FormMethod.post) { form(classes = "inline", action = "/logout", method = FormMethod.post) {
button(type = ButtonType.submit, classes = "btn btn-green") { +"Logout" } button(type = ButtonType.submit, classes = "btn btn-green") { +"Logout" }
} }
} }
} else { } else {
li("inline pl-2") { li("inline") {
a(href = "/login", classes = "btn btn-green") { +"Sign In" } a(href = "/login", classes = "btn btn-green") { +"Sign In" }
} }
} }

View File

@ -34,6 +34,18 @@
} }
} }
.btn-red {
@apply bg-red-500 text-white;
&:focus {
@apply bg-red-600;
}
&:hover {
@apply bg-red-600;
}
}
.nav { .nav {
height: 64px; height: 64px;
} }