diff --git a/app/src/main/kotlin/views/BaseView.kt b/app/src/main/kotlin/views/BaseView.kt index 7bdb077..f911cf3 100644 --- a/app/src/main/kotlin/views/BaseView.kt +++ b/app/src/main/kotlin/views/BaseView.kt @@ -13,7 +13,7 @@ class BaseView(staticFileResolver: StaticFileResolver) : View(staticFileResolver ) { section("text-center my-2 p-2") { h1("text-5xl casual") { - span("text-teal-300") { +"Simplenotes " } + span("text-teal-300") { +"SimpleNotes " } +"- access your notes anywhere" } } diff --git a/app/src/main/kotlin/views/NoteView.kt b/app/src/main/kotlin/views/NoteView.kt index a06eb1e..13d69ff 100644 --- a/app/src/main/kotlin/views/NoteView.kt +++ b/app/src/main/kotlin/views/NoteView.kt @@ -143,7 +143,6 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver } if (!shared) { noteActionForm(note) - publicPrivateForm(note) if (note.public) { p("my-4") { @@ -169,8 +168,20 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver span("flex space-x-2 justify-end mb-4") { a( href = "/notes/${note.uuid}/edit", - classes = "btn btn-teal" + classes = "btn btn-green" ) { +"Edit" } + form(method = FormMethod.post, classes = "inline") { + button( + type = ButtonType.submit, + name = if (note.public) "private" else "public", + classes = "btn btn-teal" + ) { + if (note.public) + +"Private ?" + else + +"Public ?" + } + } form(method = FormMethod.post, classes = "inline") { button( type = ButtonType.submit, @@ -180,22 +191,4 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver } } } - - private fun DIV.publicPrivateForm(note: PersistedNote) { - span("flex space-x-2 justify-end mb-4") { - - form(method = FormMethod.post, classes = "ml-auto ") { - button( - type = ButtonType.submit, - name = if (note.public) "private" else "public", - classes = "btn btn-teal" - ) { - if (note.public) - +"This note is public, do you want to make it private ?" - else - +"This note is private, do you want to make it public ?" - } - } - } - } } diff --git a/app/src/main/kotlin/views/SettingView.kt b/app/src/main/kotlin/views/SettingView.kt index 530fda7..05a313e 100644 --- a/app/src/main/kotlin/views/SettingView.kt +++ b/app/src/main/kotlin/views/SettingView.kt @@ -26,22 +26,23 @@ class SettingView(staticFileResolver: StaticFileResolver) : View(staticFileResol } } - section("m-4 p-4 bg-gray-800 rounded flex justify-around") { + section("m-4 p-2 bg-gray-800 rounded flex flex-wrap justify-around items-end") { - form(method = FormMethod.post, action = "/export") { + form(classes = "m-2", method = FormMethod.post, action = "/export") { button(name = "display", classes = "inline btn btn-teal block", type = submit) { +"Display my data" } } - form(method = FormMethod.post, action = "/export") { + form(classes = "m-2", method = FormMethod.post, action = "/export") { - listOf("json", "zip").forEach { format -> - div { + div { + listOf("json", "zip").forEach { format -> radioInput(name = "format") { id = format attributes["value"] = format - if(format == "json") attributes["checked"] = "" + if (format == "json") attributes["checked"] = "" + else attributes["class"] = "ml-4" } label(classes = "ml-2") { attributes["for"] = format diff --git a/app/src/main/kotlin/views/components/DeletedNoteTable.kt b/app/src/main/kotlin/views/components/DeletedNoteTable.kt index 9953a61..bbda3a2 100644 --- a/app/src/main/kotlin/views/components/DeletedNoteTable.kt +++ b/app/src/main/kotlin/views/components/DeletedNoteTable.kt @@ -25,8 +25,8 @@ fun FlowContent.deletedNoteTable(notes: List) = div("over td("text-center") { +updatedAt.toTimeAgo() } td { tags(tags) } td("text-center") { - form(classes = "inline", method = post, action = "/notes/deleted/$uuid") { - button(classes = "btn btn-red", type = submit, name = "delete") { + form(method = post, action = "/notes/deleted/$uuid") { + button(classes = "btn btn-red mb-2", type = submit, name = "delete") { +"Delete permanently" } button(classes = "ml-2 btn btn-green", type = submit, name = "restore") {