summaryrefslogtreecommitdiff
path: root/views/http/base.twig
blob: 15ddafd0ce768c03a3ff6de5c1e1f7dcb4c74a3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 %}