{% extends "base.html" %}
{% block title %}
    {{ title }}
{% endblock title %}
{% load static %}
{% partialdef purchase-name %}
{% if purchase.type != 'game' %}
    {% #gamelink game_id=purchase.edition.game.id %}
    {{ purchase.name }} ({{ purchase.edition.name }} {{ purchase.get_type_display }})
    {% /gamelink %}
{% else %}
    {% gamelink game_id=purchase.edition.game.id name=purchase.edition.name %}
{% endif %}
{% endpartialdef %}
{% block content %}
    
        
            
        
        Playtime
        
            
                
                    | Hours | {{ total_hours }} | 
                
                    | Sessions | {{ total_sessions }} | 
                
                    | Days | {{ unique_days }} ({{ unique_days_percent }}%) | 
                {% if total_games %}
                    
                        | Games | {{ total_games }} | 
                {% endif %}
                
                    | Games ({{ year }}) | {{ total_2023_games }} | 
                {% if all_finished_this_year_count %}
                    
                        | Finished | {{ all_finished_this_year_count }} | 
                {% endif %}
                
                    | Finished ({{ year }}) | {{ this_year_finished_this_year_count }} | 
                
                    | Longest session | {{ longest_session_time }} ({% gamelink game_id=longest_session_game.id name=longest_session_game.name %}) | 
                
                    | Most sessions | {{ highest_session_count }} ({% gamelink game_id=highest_session_count_game.id name=highest_session_count_game.name %}) | 
                
                    | Highest session average | {{ highest_session_average }} ({% gamelink game_id=highest_session_average_game.id name=highest_session_average_game.name %}) | 
                
                    | First play | {% gamelink game_id=first_play_game.id name=first_play_game.name %} ({{ first_play_date }}) | 
                
                    | Last play | {% gamelink game_id=last_play_game.id name=last_play_game.name %} ({{ last_play_date }}) | 
            
        
        {% if month_playtime %}
            
Playtime per month
            
                
                    {% for month in month_playtimes %}
                        
                            | {{ month.month | date:"F" }} | {{ month.playtime }} | 
                    {% endfor %}
                
            
        {% endif %}
        
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 %}
                    
                        | {% gamelink game_id=game.id name=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 %}
            
        
        {% if all_finished_this_year %}
            
Finished
            
                
                    
                        | Name | Date | 
                
                
                    {% for purchase in all_finished_this_year %}
                        
                            | {% partial purchase-name %} | {{ purchase.date_finished | date:"d/m/Y" }} | 
                    {% endfor %}
                
            
        {% endif %}
        {% if this_year_finished_this_year %}
            
Finished ({{ year }} games)
            
                
                    
                        | Name | Date | 
                
                
                    {% for purchase in this_year_finished_this_year %}
                        
                            | {% partial purchase-name %} | {{ purchase.date_finished | date:"d/m/Y" }} | 
                    {% endfor %}
                
            
        {% endif %}
        {% if purchased_this_year_finished_this_year %}
            
Bought and Finished ({{ year }})
            
                
                    
                        | Name | Date | 
                
                
                    {% for purchase in purchased_this_year_finished_this_year %}
                        
                            | {% partial purchase-name %} | {{ purchase.date_finished | date:"d/m/Y" }} | 
                    {% endfor %}
                
            
        {% endif %}
        {% if purchased_unfinished %}
            
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 %}
                
            
        {% endif %}
        {% if all_purchased_this_year %}
            
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 %}
                
            
        {% endif %}
    
 
{% endblock content %}