summary refs log tree commit diff stats
path: root/templates
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2022-06-09 21:12:03 +0530
committerAndinus <andinus@nand.sh>2022-06-09 21:12:03 +0530
commit2085b4cac3a86d59360531d48251c8ab39dec0dd (patch)
tree53cabc820312da2abff2bbb9b44132b61302cad1 /templates
parent48df36de5aa962b32d3313d6a9d2ace6a5fdac11 (diff)
downloadcrater-2085b4cac3a86d59360531d48251c8ab39dec0dd.tar.gz
Initial Gallery version
- Handles login, logout, simple directories.
Diffstat (limited to 'templates')
-rw-r--r--templates/base.crotmp14
-rw-r--r--templates/gallery.crotmp22
-rw-r--r--templates/login.crotmp15
3 files changed, 51 insertions, 0 deletions
diff --git a/templates/base.crotmp b/templates/base.crotmp
new file mode 100644
index 0000000..f200241
--- /dev/null
+++ b/templates/base.crotmp
@@ -0,0 +1,14 @@
+<:macro page($title)>
+<!doctype html>
+<html lang="en">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <title><$title> - Crater</title>
+        <link rel="stylesheet" href="/resources/css/style.css">
+    </head>
+    <body>
+        <:body>
+    </body>
+</html>
+</:macro>
diff --git a/templates/gallery.crotmp b/templates/gallery.crotmp
new file mode 100644
index 0000000..a47804f
--- /dev/null
+++ b/templates/gallery.crotmp
@@ -0,0 +1,22 @@
+<:use 'templates/base.crotmp'>
+<|page(.title)>
+<div class="gallery">
+    <@gallery : $i>
+
+    <?{ $i.<type> eq 'img' }>
+    <img src="<$i.<src>>">
+    </?>
+
+    <?{ $i.<type> eq 'text' }>
+    <div class="text">
+        <$i.<text>>
+    </div>
+    </?>
+
+    <?{ $i.<type> eq 'heading' }>
+    <h1 class="heading"><$i.<text>></h1>
+    </?>
+
+    </@>
+</div>
+</|>
diff --git a/templates/login.crotmp b/templates/login.crotmp
new file mode 100644
index 0000000..3dbee24
--- /dev/null
+++ b/templates/login.crotmp
@@ -0,0 +1,15 @@
+<:use 'templates/base.crotmp'>
+<|page('Log In')>
+<form method="post" action="/login">
+    <?.error>
+    <div class="alert" role="alert">
+        <.error>
+    </div>
+    </?>
+
+    <input type="pass" name="pass" id="pass" placeholder="Password" required>
+    <br>
+    <input type="submit" value="Log In" />
+</form>
+</div>
+</|>