{# fortunaisk/templates/fortunaisk/admin.html #} {% extends "fortunaisk/base.html" %} {% load i18n humanize fortunaisk_tags static %} {% block page_title %} {% trans "Admin Dashboard" %} {% endblock page_title %} {% block details %}

{% trans "Admin Dashboard" %}

{% trans "Monitor your lotteries and manage the system with fortune on your side." %}

{# Financial Summary #}
{% trans "Financial Summary" %}

{{ stats.total_tickets_sold|intcomma }} {% trans "Tickets Sold" %}

{{ stats.total_participants|intcomma }} {% trans "Participants" %}

{{ stats.total_prizes_distributed|floatformat:2|intcomma }} ISK {% trans "Prizes Distributed" %}

{{ stats.tax_collected|floatformat:2|intcomma }} ISK {% trans "Tax Collected" %}

{# Total Lotteries & Average Participation stacked #}
{% trans "Total Lotteries" %}
{{ stats.total_lotteries|intcomma }}
{% trans "Average Participation" %}
{{ stats.avg_participation|floatformat:2 }}
{# Active Anomalies & History stacked #}

{% trans "Automatic Lotteries" %}

{% if autolotteries %}
{% for autolottery in autolotteries %} {% endfor %}
{% trans "Name" %} {% trans "Frequency" %} {% trans "Ticket Price (ISK)" %} {% trans "Duration" %} {% trans "Payment Receiver" %} {% trans "Number of Winners" %} {% trans "Is Active" %} {% trans "Actions" %}
{{ autolottery.name }} {{ autolottery.frequency }} {{ autolottery.get_frequency_unit_display }} {{ autolottery.ticket_price|floatformat:2|intcomma }} {{ autolottery.duration_value }} {{ autolottery.get_duration_unit_display }} {% if autolottery.payment_receiver %} {{ autolottery.payment_receiver.corporation_name }} {% else %} {% trans "Unknown Corporation" %} {% endif %} {{ autolottery.winner_count }} {% if autolottery.is_active %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %} {# Pause/Play toggle #}
{% csrf_token %} {% if autolottery.is_active %} {% else %} {% endif %}
{% else %}
{% trans "No automatic lotteries found." %}
{% endif %}

{% trans "Active Lotteries" %}

{% if active_lotteries %}
{% for lottery in active_lotteries %} {% endfor %}
{% trans "Reference" %} {% trans "Status" %} {% trans "Ticket Price (ISK)" %} {% trans "Total Pot (ISK)" %} {% trans "Tax Collected (ISK)" %} {% trans "Participants" %} {% trans "Tickets Sold" %} {% trans "Actions" %}
{{ lottery.lottery_reference }} {% if lottery.status == "active" %} {% trans "Active" %} {% elif lottery.status == "pending" %} {% trans "Pending" %} {% elif lottery.status == "completed" %} {% trans "Completed" %} {% else %} {% trans "Cancelled" %} {% endif %} {{ lottery.ticket_price|floatformat:2|intcomma }} {{ lottery.total_pot|floatformat:2|intcomma }} {{ lottery.tax_collected|floatformat:2|intcomma }} {{ lottery.participant_count|intcomma }} {{ lottery.tickets_sold|intcomma }} {% trans "Dashboard" %}
{% else %}
{% trans "No active lotteries found." %}
{% endif %}

{% trans "Prizes to Distribute" %}

{% if winners %}
{% for winner in winners %} {% if not winner.distributed %} {% endif %} {% endfor %}
{% trans "Lottery Reference" %} {% trans "User" %} {% trans "Character" %} {% trans "Prize Amount (ISK)" %} {% trans "Won At" %} {% trans "Distributed" %} {% trans "Actions" %}
{{ winner.ticket.lottery.lottery_reference }} {{ winner.ticket.user.username }} {% if winner.character %} {{ winner.character }} {% else %} {% trans "N/A" %} {% endif %} {{ winner.prize_amount|floatformat:2|intcomma }} {{ winner.won_at|date:"Y-m-d H:i" }} {% trans "No" %}
{% csrf_token %}
{% else %}
{% trans "No prizes to distribute at the moment." %}
{% endif %}
{% endblock details %}