diff options
Diffstat (limited to 'views/http/base.twig')
-rw-r--r-- | views/http/base.twig | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/views/http/base.twig b/views/http/base.twig new file mode 100644 index 0000000..15ddafd --- /dev/null +++ b/views/http/base.twig @@ -0,0 +1,32 @@ +{% extends 'root.twig' %} + +{% block body %} +<div class="wrap"> + <header> + <nav> + <a href="/villages">Overview</a> + <a href="/logout">Logout</a> + </nav> + <span>Logged in as {{ session.user.username }}</span> + </header> + + <main> + {% block main %}{% endblock %} + </main> + + <footer></footer> + + <div class="global-timer"></div> + <script> + const timer = document.querySelectorAll('.global-timer'); + function setTime () { + const now = new Date(); + for (const t of timer) { + t.innerHTML = now; + } + } + setTime(); + setInterval(setTime, 1000); + </script> +</div> +{% endblock %} |