{# fortunaisk/templates/fortunaisk/lottery_history.html #} {% extends "fortunaisk/base.html" %} {% load i18n humanize fortunaisk_tags my_filters static %} {% block page_title %} {% trans "Lottery History" %} {% endblock page_title %} {% block details %}

{% trans "Lottery History" %}

{% trans "Explore past lotteries, see their winners, and review total payouts." %}

{# Keep per_page when filtering #} {% for status in allowed_statuses %}
{% endfor %}
{# Keep current statuses when changing per_page #} {% for s in selected_statuses %} {% endfor %}
{% if page_obj %}
{% for lottery in page_obj %}
{{ lottery.lottery_reference }}

{% trans "Ticket Price" %}: {{ lottery.ticket_price|floatformat:2|intcomma }} ISK

{% trans "Start Date" %}: {{ lottery.start_date|date:"Y-m-d H:i" }}

{% trans "End Date" %}: {{ lottery.end_date|date:"Y-m-d H:i" }}

{% trans "Status" %}: {% if lottery.status == "completed" %} {{ lottery.get_status_display }} {% elif lottery.status == "cancelled" %} {{ lottery.get_status_display }} {% elif lottery.status == "pending" %} {{ lottery.get_status_display }} {% else %} {{ lottery.get_status_display }} {% endif %}

{% trans "Participants" %}: {{ lottery.ticket_purchases.count }}

{% trans "Total Pot" %}: {{ lottery.total_pot|floatformat:2|intcomma }} ISK

{% trans "Winners" %}: {% with winners_list=lottery.winners %} {% if winners_list %}
    {% for winner in winners_list %}
  • {{ winner.character.character_name|default:winner.ticket.user.username }} ({{ winner.prize_amount|floatformat:2|intcomma }} ISK)
  • {% endfor %}
{% else %} {% trans "No winner" %} {% endif %} {% endwith %}
{% if perms.fortunaisk.admin %} {% endif %}
{% endfor %}
{% else %}
{% trans "No past lotteries found." %}
{% endif %}
{% endblock details %}