{% 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
{% for item in top_useragents %} {% endfor %}
Platform % of sessions
{{ item.useragent|ua_parse }} {% percentage item.sessions total_useragents %}  {{ item.sessions }}
{% endif %} {% if top_viewport_dimensions %}
Top screen sizes
{% for item in top_viewport_dimensions %} {% endfor %}
Dimensions % of sessions
{{ item.viewport_dimensions }} {% percentage item.sessions total_viewport_dimensions %}  {{ item.sessions }}
{% endif %}
{% endif %}
New users
{% if not new_users %}
No new users this month
{% else %} {% for user in new_users %} {% endfor %}
User Date joined
{{ user|preferred_user_id }} {{ user.date_joined|date:"j M" }}
{% endif %}
{% comment %} Many projects won't have django-invitations installed so this html is only used when they do {% endcomment %} {% if invitations %}
Active invitations
{% if invitations|length == 0 %}
No active invitations
{% else %} {% for invitation in invitations %} {% endfor %}
Recipient Datetime sent
{{ invitation.email }} {{ invitation.sent|date:"j M h:i" }}
{% endif %}
{% endif %}
{% endif %}
{% block daily_stats %}
{% if month_has_whistles %}

{{ day_str }}

Sessions
{% 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 %}