simplex/layouts/main.moon

40 lines
1.8 KiB
Plaintext
Raw Normal View History

import Widget from require "lapis.html"
csrf = require "lapis.csrf"
class extends Widget
content: =>
html_5 ->
head ->
meta charset: "utf-8"
meta name: "viewport", content: "width=device-width, initial-scale=1"
2018-04-25 05:02:41 +00:00
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"
2018-04-24 17:20:50 +00:00
-- custom JS/CSS
script src: "/static/main.js"
link rel: "stylesheet", href: "/static/main.css"
body ->
2018-04-24 17:07:49 +00:00
div class: "container", ->
2018-05-01 23:55:25 +00:00
h1(@title or "Simplex")
2018-04-25 03:44:44 +00:00
div class: "row", ->
2018-05-01 23:55:25 +00:00
div class: "column btns", ->
2018-04-25 04:00:29 +00:00
if @user
a class: "button", href: @url_for("index"), "Tasks"
else
a class: "button", href: @url_for("index"), "About"
2018-04-25 03:55:12 +00:00
a class: "button", href: @url_for("docs_v1"), "API Docs"
2018-05-01 23:55:25 +00:00
2018-04-25 03:44:44 +00:00
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"
2018-04-24 17:07:49 +00:00
@content_for "inner"