diff options
| author | Fuwn <[email protected]> | 2020-11-19 23:53:52 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-11-19 23:53:52 +0000 |
| commit | 26b647ca3f006662676690e6b99bfbfb32167738 (patch) | |
| tree | 1815e651090e928341b7f88be6781028a400b19a /templates | |
| parent | feat: limitations in readme (diff) | |
| download | chan-26b647ca3f006662676690e6b99bfbfb32167738.tar.xz chan-26b647ca3f006662676690e6b99bfbfb32167738.zip | |
feat, chore (desc)
feat:
- add example database
- ADD BOARDS
- 404 page
- better ui (bootstrap)
chore:
- move structures to strucutres file
- various capitalizations
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/404.html.hbs | 24 | ||||
| -rw-r--r-- | templates/boards.html.hbs | 18 | ||||
| -rw-r--r-- | templates/header.html.hbs | 26 | ||||
| -rw-r--r-- | templates/index.html.hbs | 15 | ||||
| -rw-r--r-- | templates/layout.html.hbs | 28 | ||||
| -rw-r--r-- | templates/post.html.hbs | 35 | ||||
| -rw-r--r-- | templates/threads.html.hbs | 48 |
7 files changed, 144 insertions, 50 deletions
diff --git a/templates/404.html.hbs b/templates/404.html.hbs new file mode 100644 index 0000000..5940d43 --- /dev/null +++ b/templates/404.html.hbs @@ -0,0 +1,24 @@ +<title>chan - 404</title> + +{{> header }} + +<h1>Error 404: Resource not found...</h1> + +<pre> +⣿⣿⣷⡁⢆⠈⠕⢕⢂⢕⢂⢕⢂⢔⢂⢕⢄⠂⣂⠂⠆⢂⢕⢂⢕⢂⢕⢂⢕⢂ +⣿⣿⣿⡷⠊⡢⡹⣦⡑⢂⢕⢂⢕⢂⢕⢂⠕⠔⠌⠝⠛⠶⠶⢶⣦⣄⢂⢕⢂⢕ +⣿⣿⠏⣠⣾⣦⡐⢌⢿⣷⣦⣅⡑⠕⠡⠐⢿⠿⣛⠟⠛⠛⠛⠛⠡⢷⡈⢂⢕⢂ +⠟⣡⣾⣿⣿⣿⣿⣦⣑⠝⢿⣿⣿⣿⣿⣿⡵⢁⣤⣶⣶⣿⢿⢿⢿⡟⢻⣤⢑⢂ +⣾⣿⣿⡿⢟⣛⣻⣿⣿⣿⣦⣬⣙⣻⣿⣿⣷⣿⣿⢟⢝⢕⢕⢕⢕⢽⣿⣿⣷⣔ +⣿⣿⠵⠚⠉⢀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⢕⢕⢕⢕⢕⢕⣽⣿⣿⣿⣿ +⢷⣂⣠⣴⣾⡿⡿⡻⡻⣿⣿⣴⣿⣿⣿⣿⣿⣿⣷⣵⣵⣵⣷⣿⣿⣿⣿⣿⣿⡿ +⢌⠻⣿⡿⡫⡪⡪⡪⡪⣺⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ +⠣⡁⠹⡪⡪⡪⡪⣪⣾⣿⣿⣿⣿⠋⠐⢉⢍⢄⢌⠻⣿⣿⣿⣿⣿⣿⣿⣿⠏⠈ +⡣⡘⢄⠙⣾⣾⣾⣿⣿⣿⣿⣿⣿⡀⢐⢕⢕⢕⢕⢕⡘⣿⣿⣿⣿⣿⣿⠏⠠⠈ +⠌⢊⢂⢣⠹⣿⣿⣿⣿⣿⣿⣿⣿⣧⢐⢕⢕⢕⢕⢕⢅⣿⣿⣿⣿⡿⢋⢜⠠⠈ +⠄⠁⠕⢝⡢⠈⠻⣿⣿⣿⣿⣿⣿⣿⣷⣕⣑⣑⣑⣵⣿⣿⣿⡿⢋⢔⢕⣿⠠⠈ +⠨⡂⡀⢑⢕⡅⠂⠄⠉⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⢔⢕⢕⣿⣿⠠⠈ +⠄⠪⣂⠁⢕⠆⠄⠂⠄⠁⡀⠂⡀⠄⢈⠉⢍⢛⢛⢛⢋⢔⢕⢕⢕⣽⣿⣿⠠⠈ +</pre> + +<a href="/">Return home.</a> diff --git a/templates/boards.html.hbs b/templates/boards.html.hbs new file mode 100644 index 0000000..d86ba2b --- /dev/null +++ b/templates/boards.html.hbs @@ -0,0 +1,18 @@ +<title>chan - Boards</title> + +{{> header }} + +<h1>Boards</h1> + +<div class="col"></div> +<div class="col"> + <ul> + <p><ul>Unorganized Boards</ul></p> + {{ #each this }} + <li> + <a href="/board/{{ this.tag }}">{{ this.name }} <span class="badge badge-primary">New!</span> {{ #if this.nsfw }} <span class="badge badge-danger">NSFW!</span> {{ /if }}</p> + </li> + {{ /each }} + </ul> +</div> +<div class="col"></div> diff --git a/templates/header.html.hbs b/templates/header.html.hbs index 6057f69..28786e4 100644 --- a/templates/header.html.hbs +++ b/templates/header.html.hbs @@ -1,16 +1,16 @@ -<style> - * { - font-family: cursive; - } -</style> +{{> layout }} -<title>chan</title> +<ul class="nav justify-content-center"> + <li class="nav-item"> + <a class="nav-link" href="/"> + Home + </a> + </li> -<center> -<nav> - <p>chan</a> | - <a href="/">index</a> | - <a href="/post">post</a> | - <a href="/threads">threads</a> -</nav> + <li class="nav-item"> + <a class="nav-link" href="/boards"> + Boards + </a> + </li> +</ul> <br> diff --git a/templates/index.html.hbs b/templates/index.html.hbs index 92d2b35..ef756d0 100644 --- a/templates/index.html.hbs +++ b/templates/index.html.hbs @@ -1,5 +1,9 @@ +<title>chan - Home</title> + {{> header }} +<h1>chan</h1> + <pre> ⣿⣿⣷⡁⢆⠈⠕⢕⢂⢕⢂⢕⢂⢔⢂⢕⢄⠂⣂⠂⠆⢂⢕⢂⢕⢂⢕⢂⢕⢂ ⣿⣿⣿⡷⠊⡢⡹⣦⡑⢂⢕⢂⢕⢂⢕⢂⠕⠔⠌⠝⠛⠶⠶⢶⣦⣄⢂⢕⢂⢕ @@ -16,3 +20,14 @@ ⠨⡂⡀⢑⢕⡅⠂⠄⠉⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⢔⢕⢕⣿⣿⠠⠈ ⠄⠪⣂⠁⢕⠆⠄⠂⠄⠁⡀⠂⡀⠄⢈⠉⢍⢛⢛⢛⢋⢔⢕⢕⢕⣽⣿⣿⠠⠈ </pre> + +<div class="footer"> + <p> + Copyleft - <a href="/">chan</a> | + Made by <a href="https://github.com/fuwn">Fuwn</a> + </p> + + <p> + Fork me on <a href="https://github.com/fuwn/chan">GitHub</a>! + </p> +</div> diff --git a/templates/layout.html.hbs b/templates/layout.html.hbs new file mode 100644 index 0000000..a9c0dcc --- /dev/null +++ b/templates/layout.html.hbs @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> + <meta name="description" content="A simple `chan'-like board written in Rust."> + <meta name="author" content="Fuwn"> + + <!-- External --> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> + </head> + + <body> + <style> + * { + font-family: Arial, Helvetica, sans-serif + } + + .footer { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + text-align: center; + } + </style> + + <div class="container"> diff --git a/templates/post.html.hbs b/templates/post.html.hbs deleted file mode 100644 index 37c5ec6..0000000 --- a/templates/post.html.hbs +++ /dev/null @@ -1,35 +0,0 @@ -{{> header }} - -<form action="/api/v1/post" method="post"> - <table> - <tr> - <td>name</td> - <td> - <input name="name" type="text" placeholder="blank 4 `anonymous'"> - <input type="submit" value="post"> - </td> - </tr> - - <tr> - <td>comment</td> - <td> - <textarea name="comment" cols="48" rows="4" - wrap="soft" placeholder="comment" required></textarea> - </td> - </tr> - - <tr> - <td>verification</td> - <td> - <input type="checkbox" disabled> i'm not a robot - </td> - </tr> - - <tr> - <td>file</td> - <td> - <input type="file" disabled> - </td> - </tr> - </table> -</form> diff --git a/templates/threads.html.hbs b/templates/threads.html.hbs index 5a656f7..f9f1b85 100644 --- a/templates/threads.html.hbs +++ b/templates/threads.html.hbs @@ -1,13 +1,57 @@ +<title>chan - /{{ this.0.board }}/</title> + {{> header }} +<form action="/api/v1/post" method="post"> + <div class="form-group"> + <label for="name">Name <span class="badge badge-info">Optional</span></label> + <input class="form-control" name="name" type="text" + placeholder="Anonymous"> + </div> + + <div class="form-group"> + <label for="comment">Comment <span class="badge badge-warning">Required</span></label> + <textarea class="form-control" name="comment" cols="48" rows="4" + wrap="soft" placeholder="comment" required></textarea> + </div> + + <div class="form-group form-check"> + <input class="form-check-input" type="checkbox" disabled> + <label class="form-check-label">I'm not a robot. <span class="badge badge-warning">Required</span> <span class="badge badge-danger">Disabled</span></label> + </div> + + <div class="form-group"> + <label class="form-check-label">Image <span class="badge badge-info">Optional</span> <span class="badge badge-danger">Disabled</span></label> + <input class="form-control-file" type="file" disabled> + </div> + + <input type="hidden" name="board" value="{{ this.0.board }}"> + + <button type="submit" class="btn btn-primary">Post</button> +</form> +<br> + +<hr> + {{ #if this }} {{ #each this }} - <div class="post" style="width: 420px"> + <!-- <div class="post" style="width: 420px"> <h2>{{ this.name }}</h4> <p>{{ this.comment }}</p> + </div> --> + + <div class="card"> + <div class="card-body"> + <h2>{{ this.name }}</h4> + <p>{{ this.comment }}</p> + + <button class="btn btn-primary" disabled>View thread</button> + </div> </div> <br> {{ /each }} {{ else }} - <p>no posts today</p> + <div class="alert alert-primary" role="alert"> + No posts have been made today! + </div> {{ /if }} |