{% extends 'silent_mammoth_whistle/base.html' %}
{% load static whistle_helpers %}
{% block title %}Activity overview{% endblock %}
{% block extra_styles %}
#body {
max-width: fit-content;
margin: 0 auto;
display: flex;
gap: var(--sl-spacing-x-large);
flex-wrap: wrap;
}
{% endblock %}
{% block content %}
{% comment %} Next and previous buttons for changing daily sessions uses hx-boost. We use hx-preserve here to stop the monthly data (mostly the chart) being recreated. {% endcomment %}
{{ chart_period }}
Monthly stats
{% comment %} This if statement hides daily stats as well as they're not relevant if the month doesn't even show {% endcomment %}
{% if not month_has_whistles %}
No whistles for this month
{% else %}
Sessions per day
{% include "silent_mammoth_whistle/_chart_javascript.html" %}
{% if top_useragents or top_viewport_dimensions %}
{% if top_useragents %}
Top platforms
Platform |
% of sessions |
{% for item in top_useragents %}
{{ item.useragent|ua_parse }} |
{% percentage item.sessions total_useragents %} {{ item.sessions }} |
{% endfor %}
{% endif %}
{% if top_viewport_dimensions %}
Top screen sizes
Dimensions |
% of sessions |
{% for item in top_viewport_dimensions %}
{{ item.viewport_dimensions }} |
{% percentage item.sessions total_viewport_dimensions %} {{ item.sessions }} |
{% endfor %}
{% endif %}
{% endif %}
New users
{% if not new_users %}
No new users this month
{% else %}
User |
Date joined |
{% for user in new_users %}
{{ user|preferred_user_id }} |
{{ user.date_joined|date:"j F" }} |
{% endfor %}
{% endif %}
{% endif %}
{% block daily_stats %}
{% if month_has_whistles %}
{% if authed_whistles_per_user|length == 0 and unauthed_whistles_per_user|length == 0 %}
No whistles
{% else %}
{% if authed_whistles_per_user|length > 0 %}
{% include "silent_mammoth_whistle/_whistles_per_user_table.html" with is_authenticated=True whistles_per_user=authed_whistles_per_user %}
{% endif %}
{% if unauthed_whistles_per_user|length > 0 %}
{% include "silent_mammoth_whistle/_whistles_per_user_table.html" with is_authenticated=False whistles_per_user=unauthed_whistles_per_user %}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{% endblock %}