summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/base.rs.html26
-rw-r--r--templates/error.rs.html24
-rw-r--r--templates/login.rs.html15
-rw-r--r--templates/signup.rs.html13
-rw-r--r--templates/users.rs.html12
5 files changed, 90 insertions, 0 deletions
diff --git a/templates/base.rs.html b/templates/base.rs.html
new file mode 100644
index 0000000..5b1a324
--- /dev/null
+++ b/templates/base.rs.html
@@ -0,0 +1,26 @@
+@use super::statics::*;
+
+@(authenticated: bool, body: Content)
+
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link rel="stylesheet" type="text/css" href="/static/@style_css.name" />
+ <title>pinussy</title>
+</head>
+
+<body>
+ <nav>
+ @if authenticated {
+ logout
+ } else {
+ <a href="/login">log in</a>
+ }
+ </nav>
+ @:body()
+</body>
+
+</html> \ No newline at end of file
diff --git a/templates/error.rs.html b/templates/error.rs.html
new file mode 100644
index 0000000..cebb935
--- /dev/null
+++ b/templates/error.rs.html
@@ -0,0 +1,24 @@
+@use super::statics::*;
+@use actix_web::http::StatusCode;
+
+@(code: StatusCode, message: &str)
+
+<!doctype html>
+<html lang="en" class="error">
+
+<head>
+ <title>Error @code.as_u16(): @code.canonical_reason().unwrap_or("error")</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link rel="stylesheet" type="text/css" href="/static/@style_css.name" />
+</head>
+
+<body>
+ <main>
+ <h1>@code.canonical_reason().unwrap_or("error")</h1>
+
+ <p>@message</p>
+ <p>oopsie!</p>
+ </main>
+</body>
+
+</html> \ No newline at end of file
diff --git a/templates/login.rs.html b/templates/login.rs.html
new file mode 100644
index 0000000..349263c
--- /dev/null
+++ b/templates/login.rs.html
@@ -0,0 +1,15 @@
+@use super::base_html;
+
+@()
+
+@:base_html(false, {
+<form action="/login" method="post">
+ <label for="username">username:</label>
+ <input type="text" id="username" name="username" required="true" />
+ <label for="username">password:</label>
+ <input type="text" id="password" name="password" required="true" />
+ <label for="rememberme">remember me:</label>
+ <input type="checkbox" id="rememberme" name="rememberme" />
+ <button type="submit">log in</button>
+</form>
+}) \ No newline at end of file
diff --git a/templates/signup.rs.html b/templates/signup.rs.html
new file mode 100644
index 0000000..354dae6
--- /dev/null
+++ b/templates/signup.rs.html
@@ -0,0 +1,13 @@
+@use super::base_html;
+
+@()
+
+@:base_html(false, {
+<form action="/signup" method="post">
+ <label for="username">username:</label>
+ <input type="text" id="username" name="username" required="true" />
+ <label for="username">password:</label>
+ <input type="text" id="password" name="password" required="true" />
+ <button type="submit">sign up</button>
+</form>
+}) \ No newline at end of file
diff --git a/templates/users.rs.html b/templates/users.rs.html
new file mode 100644
index 0000000..9b9be30
--- /dev/null
+++ b/templates/users.rs.html
@@ -0,0 +1,12 @@
+@use super::base_html;
+@use crate::User;
+
+@(users: Vec<User>)
+
+@:base_html(false, {
+<ul>
+@for user in users {
+ <li>@user.username</li>
+}
+</ul>
+}) \ No newline at end of file