summaryrefslogtreecommitdiff
path: root/sw/templates/base.html
diff options
context:
space:
mode:
authorTom Harley2021-07-30 18:35:08 +0000
committerTom Harley2021-07-30 18:35:08 +0000
commitc77d6a4d4a1d628788be73491aa7fa4e4fdcff05 (patch)
tree90f92c373b085818243835c323fa6e1884854ce9 /sw/templates/base.html
parentAdd more inbox/outbox tests (diff)
downloadswap-c77d6a4d4a1d628788be73491aa7fa4e4fdcff05.tar.gz
swap-c77d6a4d4a1d628788be73491aa7fa4e4fdcff05.zip

Add templates

Rather than using jsonify on a dict, the system now uses render_template on json documents. This gives the ability to extend previous files (which might be useful for activitypub features), and also enables using different templates for different filetypes.

Supplied are templates for accessing inboxes and outboxes in JSON-LD and HTML.

The “items” field in get_user_inbox_page.json and get_user_outbox_page.json might be currently borked.

Diffstat (limited to 'sw/templates/base.html')
-rw-r--r--sw/templates/base.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/sw/templates/base.html b/sw/templates/base.html
new file mode 100644
index 0000000..4f2acf1
--- /dev/null
+++ b/sw/templates/base.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<title>{% block title %}{% endblock %}</title>
+<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
+<nav>
+ <ul>
+ {% if g.user %}
+ <li><span>{{ g.user['username'] }}</span></li>
+ <li><a href="{{ url_for('auth.logout') }}">Log Out</a></li>
+ {% else %}
+ <li><a href="{{ url_for('auth.register') }}">Register</a></li>
+ <li><a href="{{ url_for('auth.login') }}">Log In</a></li>
+ {% endif %}
+ </ul>
+</nav>
+<section class="content">
+ <header>
+ {% block header %}{% endblock %}
+ </header>
+ {% block content %}{% endblock %}
+</section>