diff --git a/app/src/main/kotlin/views/BaseView.kt b/app/src/main/kotlin/views/BaseView.kt index bb08441..7e5baca 100644 --- a/app/src/main/kotlin/views/BaseView.kt +++ b/app/src/main/kotlin/views/BaseView.kt @@ -7,7 +7,10 @@ import kotlinx.html.div import org.intellij.lang.annotations.Language class BaseView(staticFileResolver: StaticFileResolver) : View(staticFileResolver) { - fun renderHome(jwtPayload: JwtPayload?) = renderPage(title = "Home", jwtPayload = jwtPayload) { + fun renderHome(jwtPayload: JwtPayload?) = renderPage( + title = "Home", + description = "A fast and simple note taking website", + jwtPayload = jwtPayload) { section("text-center my-2 p-2") { h1("text-5xl") { span("text-teal-300") { +"Simplenotes " } diff --git a/app/src/main/kotlin/views/NoteView.kt b/app/src/main/kotlin/views/NoteView.kt index fa32c63..009c126 100644 --- a/app/src/main/kotlin/views/NoteView.kt +++ b/app/src/main/kotlin/views/NoteView.kt @@ -17,7 +17,6 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver validationErrors: List = emptyList(), ) = renderPage(title = "New note", jwtPayload = jwtPayload) { div("container mx-auto p-4") { - // TODO: error error?.let { alert(Alert.Warning, error) } validationErrors.forEach { alert(Alert.Warning, it.dataPath.substringAfter('.') + ": " + it.message) diff --git a/app/src/main/kotlin/views/UserView.kt b/app/src/main/kotlin/views/UserView.kt index 507e7f8..7ca9374 100644 --- a/app/src/main/kotlin/views/UserView.kt +++ b/app/src/main/kotlin/views/UserView.kt @@ -15,7 +15,13 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver jwtPayload: JwtPayload?, error: String? = null, validationErrors: List = emptyList(), - ) = accountForm("Register", jwtPayload, error, validationErrors, "Create an account", "Register") { + ) = accountForm("Register", + "Registration page", + jwtPayload, + error, + validationErrors, + "Create an account", + "Register") { +"Already have an account? " a(href = "/login", classes = "no-underline text-blue-500 font-bold") { +"Sign In" } } @@ -25,13 +31,14 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver error: String? = null, validationErrors: List = emptyList(), new: Boolean = false, - ) = accountForm("Login", jwtPayload, error, validationErrors, "Sign In", "Sign In", new) { + ) = accountForm("Login", "Login page", jwtPayload, error, validationErrors, "Sign In", "Sign In", new) { +"Don't have an account yet? " a(href = "/register", classes = "no-underline text-blue-500 font-bold") { +"Create an account" } } private fun accountForm( title: String, + description: String, jwtPayload: JwtPayload?, error: String? = null, validationErrors: List = emptyList(), @@ -39,7 +46,7 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver submit: String, new: Boolean = false, footer: FlowContent.() -> Unit, - ) = renderPage(title = title, jwtPayload = jwtPayload) { + ) = renderPage(title = title, description, jwtPayload = jwtPayload) { div("centered container mx-auto flex justify-center items-center") { div("w-full md:w-1/2 lg:w-1/3 m-4") { h1("font-semibold text-lg mb-6 text-center") { +h1 } diff --git a/app/src/main/resources/static/robots.txt b/app/src/main/resources/static/robots.txt index 1f53798..e223f09 100644 --- a/app/src/main/resources/static/robots.txt +++ b/app/src/main/resources/static/robots.txt @@ -1,2 +1,3 @@ User-agent: * +Allow: /$ Disallow: /