UI improvements

This commit is contained in:
Hubert Van De Walle 2020-08-23 00:10:50 +02:00
parent 4ffa565626
commit d70663b898
5 changed files with 10 additions and 8 deletions

View File

@ -87,7 +87,7 @@ class UserController(
Response(OK).html(html) Response(OK).html(html)
}, },
{ token -> { token ->
Response.redirect("/").loginCookie(token, request.isSecure()) Response.redirect("/notes").loginCookie(token, request.isSecure())
} }
) )
} }

View File

@ -29,7 +29,7 @@ class BaseView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
<div class="flex justify-between mb-4"> <div class="flex justify-between mb-4">
<h1 class="text-2xl underline">Notes</h1> <h1 class="text-2xl underline">Notes</h1>
<span> <span>
<span class="underline font-semibold">Trash (3)</span> <span class="btn btn-teal pointer-events-none">Trash (3)</span>
<span class="ml-2 btn btn-green pointer-events-none">New</span> <span class="ml-2 btn btn-green pointer-events-none">New</span>
</span> </span>
</div> </div>

View File

@ -24,7 +24,7 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
"Register" "Register"
) { ) {
+"Already have an account? " +"Already have an account? "
a(href = "/login", classes = "no-underline text-blue-500 font-bold") { +"Sign In" } a(href = "/login", classes = "no-underline text-blue-500 hover:text-blue-400 font-bold") { +"Sign In" }
} }
fun login( fun login(
@ -34,7 +34,9 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
new: Boolean = false, new: Boolean = false,
) = accountForm("Login", "Login page", 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? " +"Don't have an account yet? "
a(href = "/register", classes = "no-underline text-blue-500 font-bold") { +"Create an account" } a(href = "/register", classes = "no-underline text-blue-500 hover:text-blue-400 font-bold") {
+"Create an account"
}
} }
private fun accountForm( private fun accountForm(
@ -50,8 +52,8 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
) = renderPage(title = title, description, jwtPayload = jwtPayload) { ) = renderPage(title = title, description, jwtPayload = jwtPayload) {
div("centered container mx-auto flex justify-center items-center") { div("centered container mx-auto flex justify-center items-center") {
div("w-full md:w-1/2 lg:w-1/3 m-4") { div("w-full md:w-1/2 lg:w-1/3 m-4") {
h1("font-semibold text-lg mb-6 text-center") { +h1 }
div("p-8 mb-6") { div("p-8 mb-6") {
h1("font-semibold text-lg mb-6 text-center") { +h1 }
if (new) alert(Alert.Success, "Your account has been created") if (new) alert(Alert.Success, "Your account has been created")
error?.let { alert(Alert.Warning, error) } error?.let { alert(Alert.Warning, error) }
form(method = FormMethod.post) { form(method = FormMethod.post) {

View File

@ -10,7 +10,7 @@ fun DIV.noteListHeader(numberOfDeletedNotes: Int, query: String = "") {
span { span {
a( a(
href = "/notes/trash", href = "/notes/trash",
classes = "underline font-semibold" classes = "btn btn-teal"
) { +"Trash ($numberOfDeletedNotes)" } ) { +"Trash ($numberOfDeletedNotes)" }
a( a(
href = "/notes/new", href = "/notes/new",

View File

@ -6,7 +6,7 @@
@apply text-2xl text-gray-100 font-bold; @apply text-2xl text-gray-100 font-bold;
&:hover { &:hover {
@apply text-blue-300 underline font-extrabold; @apply text-blue-300 font-extrabold;
--CASL: 1; --CASL: 1;
} }
} }
@ -26,7 +26,7 @@
@apply text-gray-100 font-semibold; @apply text-gray-100 font-semibold;
&:hover { &:hover {
@apply underline text-blue-300 font-bold; @apply text-blue-300 font-bold;
--CASL: 1; --CASL: 1;
} }
} }