adding statistics page for admin

This commit is contained in:
2025-09-14 17:07:05 +02:00
parent e947520be9
commit c4a5ed56b5
4 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
{% extends 'base.html' %} {% block content %}
<div id="admin-stats">
<h2>Database Statistics</h2>
<div class="stats-summary">
<p><strong>Total jobs:</strong> {{ stats.total_jobs }}</p>
<p><strong>Total keywords:</strong> {{ stats.total_keywords }}</p>
<p><strong>Total regions:</strong> {{ stats.total_regions }}</p>
</div>
<h3>Jobs per keyword</h3>
<table>
<thead>
<tr>
<th>Keyword</th>
<th>Count</th>
</tr>
</thead>
<tbody>
{% for row in stats.jobs_per_keyword %}
<tr>
<td>{{ row.keyword or '(empty)' }}</td>
<td>{{ row.count }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<h3>Jobs per region</h3>
<table>
<thead>
<tr>
<th>Region</th>
<th>Count</th>
</tr>
</thead>
<tbody>
{% for row in stats.jobs_per_region %}
<tr>
<td>{{ row.region or '(empty)' }}</td>
<td>{{ row.count }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}