repos
/ analytics-django master

analytics-django

mirror archived upstream

Self-hostable website analytics on Django: a straightforward collector API, dashboards, a world map, and PDF reports.

analyticsdjangodockerhandcodedpythonself-hostedsqliteviteweb-analytics

7.9 KB · 165 lines · HTML Raw History
  1{% load static %}
  2
  3<!doctype html>
  4<html lang="en">
  5
  6<head>
  7  <meta charset="utf-8">
  8  <meta name="viewport" content="width=device-width, initial-scale=1">
  9  <title>{% block title %}{{ title }}{% endblock %} · Analytics</title>
 10  <meta name="description" content="{% block description %}{{ description }}{% endblock %}">
 11  <link rel="canonical" href="{{ canonical }}">
 12
 13  {% if BASE_URL %}
 14  <base href="{{ BASE_URL }}">
 15  {% endif %}
 16
 17  <link rel="icon" type="image/svg+xml" href="{% url 'favicon' %}">
 18
 19  {% block extra_head %}{% endblock %}
 20
 21  <link href="{% static 'base.css' %}" rel="stylesheet">
 22  {% block extra_css %}{% endblock %}
 23
 24  {% include 'includes/collector.html' %}
 25</head>
 26
 27<body>
 28  {% include 'includes/messages.html' %}
 29
 30  {% block nav %}
 31  <nav class="navbar navbar-dark navbar-expand-md d-print-none">
 32    <div class="container">
 33      <a class="navbar-brand" href="/">
 34        <span class="logo" aria-hidden="true">
 35          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
 36            <rect x="6"  y="38" width="10" height="22" rx="1.5" fill="#6b9e78"/>
 37            <rect x="20" y="28" width="10" height="32" rx="1.5" fill="#6b9e78"/>
 38            <rect x="34" y="18" width="10" height="42" rx="1.5" fill="#6b9e78"/>
 39            <rect x="48" y="8"  width="10" height="52" rx="1.5" fill="#6b9e78"/>
 40            <rect x="48" y="8"  width="10" height="6"  rx="1.5" fill="#c9a84c"/>
 41          </svg>
 42        </span>
 43        <span class="brand-text">Analytics</span>
 44        <span class="brand-dot" aria-hidden="true"></span>
 45      </a>
 46      <button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navMain" aria-controls="navMain" aria-expanded="false" aria-label="Toggle navigation">
 47        <span class="navbar-toggler-icon"></span>
 48      </button>
 49      <div class="collapse navbar-collapse" id="navMain">
 50        <ul class="navbar-nav ms-3">
 51          {% if user.is_authenticated %}
 52          <li class="nav-item"><a class="nav-link {% if request.path == '/properties/' %}active{% endif %}" href="/properties/">Properties</a></li>
 53          <li class="nav-item"><a class="nav-link {% if request.path == '/accounts/profile/' %}active{% endif %}" href="/accounts/profile/">Profile</a></li>
 54          <li class="nav-item"><a class="nav-link {% if request.path == '/documentation/' %}active{% endif %}" href="/documentation/">Docs</a></li>
 55          {% else %}
 56          <li class="nav-item"><a class="nav-link {% if request.path == '/' %}active{% endif %}" href="/">Home</a></li>
 57          <li class="nav-item"><a class="nav-link {% if request.path == '/documentation/' %}active{% endif %}" href="/documentation/">Docs</a></li>
 58          <li class="nav-item"><a class="nav-link {% if request.path == '/changelog/' %}active{% endif %}" href="/changelog/">Changelog</a></li>
 59          {% endif %}
 60        </ul>
 61        <ul class="navbar-nav ms-auto">
 62          {% if user.is_authenticated %}
 63          <li class="nav-item d-flex align-items-center">
 64            <form method="post" action="{% url 'logout' %}" class="d-inline">
 65              {% csrf_token %}
 66              <button type="submit" class="btn btn-sm btn-outline-light">Logout</button>
 67            </form>
 68          </li>
 69          {% else %}
 70          <li class="nav-item d-flex align-items-center">
 71            <a href="/accounts/login/" class="btn btn-sm btn-outline-light">Login</a>
 72          </li>
 73          {% endif %}
 74        </ul>
 75      </div>
 76    </div>
 77  </nav>
 78  {% endblock %}
 79
 80  {% block breadcrumb_wrapper %}
 81  <div class="breadcrumb-bar py-2 overflow-auto d-print-none">
 82    <div class="container">
 83      {% block breadcrumbs %}{% endblock %}
 84    </div>
 85  </div>
 86  {% endblock %}
 87
 88  <main>
 89    {% block main %}{% endblock %}
 90  </main>
 91
 92  {% block footer %}
 93  <footer class="d-print-none">
 94    <div class="container">
 95      <div class="row links">
 96        <div class="col-12 col-lg-6 mb-4 mb-lg-0">
 97          <div class="h5 mb-3">// Analytics</div>
 98          <p>Self-hosted web analytics by <a href="https://isaacbythewood.com/">Isaac Bythewood</a>.
 99            Page views, clicks, scrolls, sessions, custom events. GeoIP maps,
100            UTM attribution, PDF reports. No cookies you don't control, no data
101            pipeline you can't audit.</p>
102        </div>
103        <div class="col-6 col-lg-2 offset-lg-2">
104          <div class="h5 mb-3">// Pages</div>
105          <ul class="list-unstyled">
106            <li class="mb-2"><a href="/" class="link-footer">Home</a></li>
107            <li class="mb-2"><a href="/documentation/" class="link-footer">Documentation</a></li>
108            <li class="mb-2"><a href="/changelog/" class="link-footer">Changelog</a></li>
109            <li class="mb-2"><a href="https://github.com/overshard/analytics-django" class="link-footer" target="_blank">Source</a></li>
110          </ul>
111        </div>
112        <div class="col-6 col-lg-2">
113          <div class="h5 mb-3">// Accounts</div>
114          <ul class="list-unstyled">
115            {% if user.is_authenticated %}
116            <li class="mb-2"><a href="/properties/" class="link-footer">Properties</a></li>
117            <li class="mb-2"><a href="/accounts/profile/" class="link-footer">Profile</a></li>
118            <li class="mb-2">
119              <form method="post" action="{% url 'logout' %}" class="d-inline">
120                {% csrf_token %}
121                <button type="submit" class="btn btn-link link-footer p-0 align-baseline text-start">Logout</button>
122              </form>
123            </li>
124            {% else %}
125            <li class="mb-2"><a href="/accounts/login/" class="link-footer">Login</a></li>
126            <li class="mb-2"><a href="/accounts/password-reset/" class="link-footer">Password reset</a></li>
127            {% endif %}
128          </ul>
129        </div>
130      </div>
131    </div>
132  </footer>
133
134  <div class="footer-bar d-print-none">
135    <div class="container">
136      <div class="row align-items-center">
137        <div class="col-sm-6 d-flex align-items-center justify-content-center justify-content-sm-start order-1 order-sm-0">
138          <small>&copy; {% now 'Y' %} Isaac Bythewood · Some rights reserved · <a href="https://db-ip.com" class="link-footer" target="_blank" rel="noopener">IP Geolocation by DB-IP</a></small>
139        </div>
140        <div class="col-sm-6 d-flex justify-content-center justify-content-sm-end py-3 py-sm-0">
141          <a href="https://github.com/overshard/analytics-django" target="_blank" class="footer-bar-link" aria-label="GitHub">
142            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
143              <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
144            </svg>
145          </a>
146          <a href="https://isaacbythewood.com/" target="_blank" class="logo logo-sm ms-3" aria-label="Isaac Bythewood">
147            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
148              <rect x="6"  y="38" width="10" height="22" rx="1.5" fill="#6b9e78"/>
149              <rect x="20" y="28" width="10" height="32" rx="1.5" fill="#6b9e78"/>
150              <rect x="34" y="18" width="10" height="42" rx="1.5" fill="#6b9e78"/>
151              <rect x="48" y="8"  width="10" height="52" rx="1.5" fill="#6b9e78"/>
152              <rect x="48" y="8"  width="10" height="6"  rx="1.5" fill="#c9a84c"/>
153            </svg>
154          </a>
155        </div>
156      </div>
157    </div>
158  </div>
159  {% endblock %}
160
161  <script type="module" src="{% static 'base.js' %}"></script>
162  {% block extra_js %}{% endblock %}
163</body>
164</html>