simplex/layouts/main.moon
2018-04-24 22:02:41 -07:00

42 lines
1.9 KiB
Plaintext

import Widget from require "lapis.html"
csrf = require "lapis.csrf"
config = require("lapis.config").get!
class extends Widget
content: =>
html_5 ->
head ->
meta charset: "utf-8"
meta name: "viewport", content: "width=device-width, initial-scale=1"
title(@title or "Simplex Task Manager")
-- Milligram CSS framework
link rel: "stylesheet", href: "https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"
link rel: "stylesheet", href: "https://cdn.rawgit.com/necolas/normalize.css/master/normalize.css"
link rel: "stylesheet", href: "https://cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css"
-- JQuery
script src: "https://code.jquery.com/jquery-3.3.1.min.js", integrity: "sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=", crossorigin: "anonymous"
-- custom JS/CSS
script src: "/static/main.js"
link rel: "stylesheet", href: "/static/main.css"
body ->
div class: "container", ->
div class: "row", ->
div class: "column column-25 btns", ->
if @user
a class: "button", href: @url_for("index"), "Tasks"
else
a class: "button", href: @url_for("index"), "About"
a class: "button", href: @url_for("docs_v1"), "API Docs"
div class: "column column-100", ->
h1(@title or "Simplex")
div class: "column column-25 btns", ->
if @user
a class: "button", href: @url_for("user_me"), "You"
a class: "button", href: @url_for("user_logout"), "Log Out"
else
a class: "button", href: @url_for("user_login", nil, redirect: @url_for(@route_name)), "Log In"
a class: "button", href: @url_for("user_new", nil, redirect: @url_for(@route_name)), "New User"
@content_for "inner"