Initial commit: simpleblog

This commit is contained in:
2026-11-14 17:05:01 +00:00
commit 31c4580da4
91 changed files with 53494 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
{% extends "admin/base.html" %}
{% block admin_content %}
<div class="admin-panel">
<h1>Visitor history</h1>
<table class="admin-table">
<tbody>
<tr><th>Visitor ID</th><td><code>{{ visitor.visitor_id }}</code></td></tr>
<tr><th>Browser</th><td>{{ visitor.browser or "&mdash;" }}</td></tr>
<tr><th>Operating system</th><td>{{ visitor.os or "&mdash;" }}</td></tr>
<tr><th>Device</th><td>{{ visitor.device }}</td></tr>
<tr><th>Location</th><td>{% if visitor.city or visitor.country %}{% if visitor.country_code %}<span class="location-flag">{{ visitor.country_code|country_flag }}</span> {% endif %}{{ visitor.city or "—" }}{% if visitor.region %}, {{ visitor.region }}{% endif %}{% if visitor.country %}, {{ visitor.country }}{% endif %}{% if visitor.latitude is not none %} <span class="muted">({{ "%.2f"|format(visitor.latitude) }}, {{ "%.2f"|format(visitor.longitude) }})</span>{% endif %}{% else %}&mdash;{% endif %}</td></tr>
<tr><th>Source</th><td><span class="term">{{ visitor.source }}</span></td></tr>
<tr><th>Referrer domain</th><td>{{ visitor.referrer_domain or "direct (no referrer)" }}</td></tr>
<tr><th>Raw referrer</th><td>{{ visitor.referrer or "&mdash;" }}</td></tr>
<tr><th>First seen</th><td>{{ parse_date(visitor.first_seen) }}</td></tr>
<tr><th>Last seen</th><td>{{ parse_date(visitor.last_seen) }}</td></tr>
</tbody>
</table>
</div>
<div class="admin-panel">
<h2>Pages visited ({{ visits|length }})</h2>
<table class="admin-table">
<thead><tr><th>Page</th><th>Title</th><th>When</th></tr></thead>
<tbody>
{% for v in visits %}
<tr>
<td><code>{{ v.page_path }}</code></td>
<td>{{ v.title or "(untitled)" }}</td>
<td>{{ parse_date(v.timestamp) }}</td>
</tr>
{% else %}
<tr><td colspan="3" class="empty-state">This visitor has not visited any page yet.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}