{% extends "base.html" %}
{% block title %}
    {{ title }}
{% endblock title %}
{% load static %}
{% partialdef purchase-name %}
    {% if purchase.type != 'game' %}
        {{ purchase.name }} ({{ purchase.edition.name }} {{ purchase.get_type_display }})
    {% else %}
        {{ purchase.edition.name }}
    {% endif %}
{% endpartialdef %}
{% block content %}
    
        
            
        
        Playtime
        
            
                
                    | Hours | 
                    {{ total_hours }} | 
                
                
                    | Sessions | 
                    {{ total_sessions }} | 
                
                
                    | Days | 
                    {{ unique_days }} ({{ unique_days_percent }}%) | 
                
                
                    | Games | 
                    {{ total_games }} | 
                
                
                    | Games ({{ year }}) | 
                    {{ total_2023_games }} | 
                
                
                    | Finished | 
                    {{ all_finished_this_year_count }} | 
                
                
                    | Finished ({{ year }}) | 
                    {{ this_year_finished_this_year_count }} | 
                
                
                    | Longest session | 
                    {{ longest_session_time }} ({{ longest_session_game }}) | 
                
                
                    | Most sessions | 
                    {{ highest_session_count }} ({{ highest_session_count_game }}) | 
                
                
                    | Highest session average | 
                    
                        {{ highest_session_average }} ({{ highest_session_average_game }})
                     | 
                
                
                    | First play | 
                    {{ first_play_name }} ({{ first_play_date }}) | 
                
                
                    | Last play | 
                    {{ last_play_name }} ({{ last_play_date }}) | 
                
            
        
        Playtime per month
        
            
                {% for month in month_playtimes %}
                    
                        | {{ month.month | date:"F" }} | 
                        {{ month.playtime }} | 
                    
                {% endfor %}
            
        
        Purchases
        
            
                
                    | Total | 
                    {{ all_purchased_this_year_count }} | 
                
                
                    | Refunded | 
                    
                        {{ all_purchased_refunded_this_year_count }} ({{ refunded_percent }}%)
                     | 
                
                
                    | Dropped | 
                    
                        {{ dropped_count }} ({{ dropped_percentage }}%)
                     | 
                
                
                    | Unfinished | 
                    
                        {{ purchased_unfinished_count }} ({{ unfinished_purchases_percent }}%)
                     | 
                
                
                    | Backlog Decrease | 
                    {{ backlog_decrease_count }} | 
                
                
                    | Spendings ({{ total_spent_currency }}) | 
                    {{ total_spent }} ({{ spent_per_game }}/game) | 
                
            
        
        Top games by playtime
        
            
                
                    | Name | 
                    Playtime (hours) | 
                
            
            
                {% for game in top_10_games_by_playtime %}
                    
                        | 
                            {{ game.name }}
                         | 
                        {{ game.formatted_playtime }} | 
                    
                {% endfor %}
            
        
        Platforms by playtime
        
            
                
                    | Platform | 
                    Playtime (hours) | 
                
            
            
                {% for item in total_playtime_per_platform %}
                    
                        | {{ item.platform_name }} | 
                        {{ item.formatted_playtime }} | 
                    
                {% endfor %}
            
        
        Finished
        
            
                
                    | Name | 
                    Date | 
                
            
            
                {% for purchase in all_finished_this_year %}
                    
                        | 
                            
                                {% partial purchase-name %}
                            
                         | 
                        {{ purchase.date_finished | date:"d/m/Y" }} | 
                    
                {% endfor %}
            
        
        Finished ({{ year }} games)
        
            
                
                    | Name | 
                    Date | 
                
            
            
                {% for purchase in this_year_finished_this_year %}
                    
                        | 
                            {{ purchase.edition.name }}
                         | 
                        {{ purchase.date_finished | date:"d/m/Y" }} | 
                    
                {% endfor %}
            
        
        Bought and Finished ({{ year }})
        
            
                
                    | Name | 
                    Date | 
                
            
            
                {% for purchase in purchased_this_year_finished_this_year %}
                    
                        | 
                            {{ purchase.edition.name }}
                         | 
                        {{ purchase.date_finished | date:"d/m/Y" }} | 
                    
                {% endfor %}
            
        
        Unfinished Purchases
        
            
                
                    | Name | 
                    Price ({{ total_spent_currency }}) | 
                    Date | 
                
            
            
                {% for purchase in purchased_unfinished %}
                    
                        | 
                            
                               {% partial purchase-name %}
                            
                         | 
                        {{ purchase.price }} | 
                        {{ purchase.date_purchased | date:"d/m/Y" }} | 
                    
                {% endfor %}
            
        
        All Purchases
        
            
                
                    | Name | 
                    Price ({{ total_spent_currency }}) | 
                    Date | 
                
            
            
                {% for purchase in all_purchased_this_year %}
                    
                        | 
                            
                               {% partial purchase-name %}
                            
                         | 
                        {{ purchase.price }} | 
                        {{ purchase.date_purchased | date:"d/m/Y" }} | 
                    
                {% endfor %}
            
        
     
{% endblock content %}