Frontend now built with CSS. Improves about page.

This commit is contained in:
Dominik Picheta 2018-05-20 13:32:43 +01:00
commit 4f2f95efb5
6 changed files with 27 additions and 8 deletions

View file

@ -31,7 +31,8 @@ task backend, "Compiles and runs the forum backend":
task runbackend, "Runs the forum backend":
exec "./src/forum"
task frontend, "Builds the necessary JS frontend":
task frontend, "Builds the necessary JS frontend (with CSS)":
exec "nimble c -r src/frontend/buildcss"
exec "nimble js src/frontend/forum.nim"
mkDir "public/js"
cpFile "src/frontend/nimcache/forum.js", "public/js/forum.js"

View file

@ -243,7 +243,7 @@ $views-color: #545d70;
}
}
.posts {
.posts, .about {
@extend .grid-md;
@extend .container;
margin: 0;
@ -634,4 +634,9 @@ hr {
.modal-container .modal-body {
max-height: 60vh;
}
}
.license-text {
text-align: left;
font-size: 80%;
}

View file

@ -40,5 +40,5 @@ when defined(js):
result = buildHtml():
section(class="container grid-xl"):
tdiv(id="about"):
tdiv(class="about"):
verbatim(state.content)

View file

@ -0,0 +1,9 @@
import sass, os
when isMainModule:
compileFile(
getCurrentDir() / "public" / "css" / "nimforum.scss",
getCurrentDir() / "public" / "css" / "nimforum.css"
)
echo("Compiled CSS")

View file

@ -1,4 +0,0 @@
import sass
when isMainModule:
compileFile("nimforum.scss", "nimforum.css")

View file

@ -84,4 +84,12 @@ when defined(js):
button(class="btn",
onClick=(ev: Event, n: VNode) =>
(state.onLogIn(); state.shown = false)):
text "Log in"
text "Log in"
p(class="license-text text-gray"):
text "By registering, you agree to the "
a(href=makeUri("/about/license"),
onClick=(ev: Event, n: VNode) =>
(state.shown = false; anchorCB(ev, n))):
text "content license"
text "."