Add ktlint plugin

This commit is contained in:
2020-10-26 17:21:48 +01:00
parent 7995a0b3e0
commit c709f2b44d
40 changed files with 128 additions and 88 deletions
@@ -1,7 +1,6 @@
package be.simplenotes.views
import be.simplenotes.types.LoggedInUser
import be.simplenotes.views.components.noteListHeader
import be.simplenotes.types.PersistedNote
import be.simplenotes.types.PersistedNoteMetadata
import be.simplenotes.views.components.*
@@ -38,7 +37,9 @@ class NoteView(styles: String) : View(styles) {
|tags: []
|---
|
""".trimMargin("|")
""".trimMargin(
"|"
)
}
submitButton("Save")
}
@@ -128,7 +129,7 @@ class NoteView(styles: String) : View(styles) {
+"You are viewing a public note "
}
hr { }
hr { }
}
div("flex items-center justify-between mb-4") {
@@ -151,7 +152,7 @@ class NoteView(styles: String) : View(styles) {
+"/notes/public/${note.uuid}"
}
}
hr { }
hr { }
}
}
@@ -182,8 +183,9 @@ class NoteView(styles: String) : View(styles) {
button(
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"
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"
}
@@ -28,9 +28,11 @@ class SettingView(styles: String) : View(styles) {
section("m-4 p-2 bg-gray-800 rounded flex flex-wrap justify-around items-end") {
form(classes = "m-2", method = FormMethod.post, action = "/export") {
button(name = "display",
button(
name = "display",
classes = "inline btn btn-teal block",
type = submit) { +"Display my data" }
type = submit
) { +"Display my data" }
}
form(classes = "m-2", method = FormMethod.post, action = "/export") {
@@ -22,7 +22,7 @@ abstract class View(private val styles: String) {
meta(name = "viewport", content = "width=device-width, initial-scale=1")
title("$title - SimpleNotes")
description?.let { meta(name = "description", content = it) }
link(rel = "preload", href = "/recursive-0.0.1.woff2"){
link(rel = "preload", href = "/recursive-0.0.1.woff2") {
attributes["as"] = "font"
attributes["type"] = "font/woff2"
attributes["crossorigin"] = "anonymous"
@@ -4,7 +4,9 @@ import kotlinx.html.*
internal class SUMMARY(consumer: TagConsumer<*>) :
HTMLTag(
"summary", consumer, emptyMap(),
"summary",
consumer,
emptyMap(),
inlineTag = true,
emptyTag = false
),
@@ -7,4 +7,6 @@ import java.util.*
private val prettyTime = PrettyTime()
internal fun LocalDateTime.toTimeAgo(): String = prettyTime.format(Date.from(atZone(ZoneId.systemDefault()).toInstant()))
internal fun LocalDateTime.toTimeAgo(): String = prettyTime.format(
Date.from(atZone(ZoneId.systemDefault()).toInstant())
)