aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2020-11-16 08:46:37 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2020-11-16 08:46:37 +0100
commit74f9c6a49fad7fd6dba3d56ec525dc6ece1894d1 (patch)
tree2a58c36e3e201eee6f6f7bbe10cabb083d26dd08
parentd856f5bd3d79c92d01336b9cb28548f28c71a56b (diff)
Basic template from lesanaweb, to improve upon
-rw-r--r--templates/web/base.html30
-rw-r--r--templates/web/entry.html18
-rw-r--r--templates/web/index.html32
3 files changed, 80 insertions, 0 deletions
diff --git a/templates/web/base.html b/templates/web/base.html
new file mode 100644
index 0000000..98139fe
--- /dev/null
+++ b/templates/web/base.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0"/>
+ <title>{% block title %}{% endblock %}</title>
+ <style>
+ body {
+ margin: 5% auto;
+ background: #f2f2f2;
+ color: #444444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+ font-size: 16px;
+ line-height: 1.8;
+ text-shadow: 0 1px 0 #ffffff;
+ max-width: 73%;
+ }
+ footer { margin-top: 2em; }
+ code {background: white;}
+ a {border-bottom: 1px solid #444444; color: #444444; text-decoration: none;}
+ a:hover {border-bottom: 0;}
+ dl { display: grid; grid-template-columns: auto 1fr; }
+ dt { font-weight: bold; }
+ </style>
+ {% block extraheader %}{% endblock %}
+ </head>
+ <body>
+ {% block content %}{% endblock %}
+ </body>
+</html>
diff --git a/templates/web/entry.html b/templates/web/entry.html
new file mode 100644
index 0000000..df641d0
--- /dev/null
+++ b/templates/web/entry.html
@@ -0,0 +1,18 @@
+{% extends "base.html" %}
+
+{% block title %}{{ entry }}{% endblock %}
+
+{% block content %}
+ <header>
+ <h1>{{ settings.name }}</h1>
+ <nav><a href="{{ url_for('index') }}">home</a></nav>
+ </header>
+ <h3>{{ entry }}</h3>
+ <dl>
+ {% for k,v in entry.data.items() %}
+ <dt>{{ k }}</dt>
+ <dd>{{ v }}</dd>
+ {% endfor %}
+ </dl>
+{% endblock %}
+
diff --git a/templates/web/index.html b/templates/web/index.html
new file mode 100644
index 0000000..1d1d869
--- /dev/null
+++ b/templates/web/index.html
@@ -0,0 +1,32 @@
+{% extends "base.html" %}
+
+{% block title %}{{ settings.name }}{% endblock %}
+
+{% block content %}
+ <header>
+ <h1>{{ settings.name }}</h1>
+ <aside><form method="get" action="{{ url_for('search') }}"><input name="q" value="{{ q }}"><input type="submit" value="Search"></form></aside>
+ </header>
+ <ul>
+ {% for entry in entries %}
+ <li id="{{ entry.eid }}">
+ <a href="{{ url_for('entry', eid=entry.eid) }}">{{ entry }}</a>
+ </li>
+ {% endfor %}
+ </dl>
+ {% if entries|count == 0 %}
+ <h4>no results</h4>
+ {% endif %}
+ <footer>
+ <nav>
+ {% if entries|count > 0 %}
+ {% if q %}
+ <a href="{{ url_for('search', q=q, p=page+1) }}">more</a>
+ {% else %}
+ <a href="{{ url_for('index', p=page+1) }}">more</a>
+ {% endif %}
+ {% endif %}
+ </nav>
+ </footer>
+{% endblock %}
+