From 63bb8e5fa6ffbee922fbfa3338a05b82eb7a213c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Fri, 17 Nov 2023 21:06:57 +0100 Subject: [PATCH] Apply djlint --- games/templates/add.html | 23 ++- games/templates/add_edition.html | 35 ++--- games/templates/add_game.html | 35 ++--- games/templates/add_purchase.html | 35 ++--- games/templates/add_session.html | 59 ++++---- games/templates/base.html | 99 ++++++++----- games/templates/components/button.html | 25 +--- games/templates/components/button_start.html | 34 ++--- games/templates/components/edit_button.html | 30 ++-- games/templates/index.html | 6 +- games/templates/list_sessions.html | 140 +++++++++---------- games/templates/stats.html | 101 +++++++------ games/templates/view_game.html | 117 ++++++++-------- 13 files changed, 374 insertions(+), 365 deletions(-) diff --git a/games/templates/add.html b/games/templates/add.html index b9241cd..3da44b1 100644 --- a/games/templates/add.html +++ b/games/templates/add.html @@ -1,25 +1,24 @@ {% extends "base.html" %} {% load static %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% block content %}
- {% csrf_token %} - - {{ form.as_table }} - - - - + {% csrf_token %} + {{ form.as_table }} + + + +
+ +
{% endblock content %} - {% block scripts %} {% if script_name %} {% endif %} {% endblock scripts %} - \ No newline at end of file diff --git a/games/templates/add_edition.html b/games/templates/add_edition.html index 1f20ae4..219c595 100644 --- a/games/templates/add_edition.html +++ b/games/templates/add_edition.html @@ -1,29 +1,32 @@ {% extends "base.html" %} {% load static %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% block content %}
- {% csrf_token %} - - {{ form.as_table }} - - - - - - - - + {% csrf_token %} + {{ form.as_table }} + + + + + + + +
+ +
+ +
{% endblock content %} - {% block scripts %} {% if script_name %} {% endif %} {% endblock scripts %} - \ No newline at end of file diff --git a/games/templates/add_game.html b/games/templates/add_game.html index 65b9278..7954a5d 100644 --- a/games/templates/add_game.html +++ b/games/templates/add_game.html @@ -1,29 +1,32 @@ {% extends "base.html" %} {% load static %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% block content %}
- {% csrf_token %} - - {{ form.as_table }} - - - - - - - - + {% csrf_token %} + {{ form.as_table }} + + + + + + + +
+ +
+ +
{% endblock content %} - {% block scripts %} {% if script_name %} {% endif %} {% endblock scripts %} - \ No newline at end of file diff --git a/games/templates/add_purchase.html b/games/templates/add_purchase.html index 637a888..cab7f60 100644 --- a/games/templates/add_purchase.html +++ b/games/templates/add_purchase.html @@ -1,29 +1,32 @@ {% extends "base.html" %} {% load static %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% block content %}
- {% csrf_token %} - - {{ form.as_table }} - - - - - - - - + {% csrf_token %} + {{ form.as_table }} + + + + + + + +
+ +
+ +
{% endblock content %} - {% block scripts %} {% if script_name %} {% endif %} {% endblock scripts %} - \ No newline at end of file diff --git a/games/templates/add_session.html b/games/templates/add_session.html index a052826..26ff0b7 100644 --- a/games/templates/add_session.html +++ b/games/templates/add_session.html @@ -1,35 +1,38 @@ {% extends "base.html" %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% block content %}
- {% csrf_token %} - - {% for field in form %} - - - {% if field.name == "note" %} - - {% else %} - - {% endif %} - {% if field.name == "timestamp_start" or field.name == "timestamp_end" %} - - {% endif %} - - {% endfor %} - - - - + {% csrf_token %} + {% for field in form %} + + + {% if field.name == "note" %} + + {% else %} + + {% endif %} + {% if field.name == "timestamp_start" or field.name == "timestamp_end" %} + + {% endif %} + + {% endfor %} + + + +
{{ field.label_tag }}{{ field }}{{ field }} -
- - - -
-
{{ field.label_tag }}{{ field }}{{ field }} +
+ + + +
+
+ +
{% load static %} diff --git a/games/templates/base.html b/games/templates/base.html index 25732ee..f9f55a6 100644 --- a/games/templates/base.html +++ b/games/templates/base.html @@ -1,72 +1,101 @@ - + - {% load static %} - - - - - - Timetracker - {% block title %}Untitled{% endblock title %} + + + + + Timetracker - + {% block title %} + Untitled + {% endblock title %} + - - +
- {% block content %}No content here.{% endblock content %} + {% block content %} + No content here. + {% endblock content %}
{% load version %} {% version %} ({% version_date %}) - {% block scripts %}{% endblock scripts %} + {% block scripts %} + {% endblock scripts %} - diff --git a/games/templates/components/button.html b/games/templates/components/button.html index b18c86d..6583755 100644 --- a/games/templates/components/button.html +++ b/games/templates/components/button.html @@ -2,25 +2,12 @@ title text {% endcomment %} - - {% comment %} - + + {% comment %} + {% endcomment %} - {{ text }} + {{ text }} diff --git a/games/templates/components/button_start.html b/games/templates/components/button_start.html index 0d73ba2..b38c4e3 100644 --- a/games/templates/components/button_start.html +++ b/games/templates/components/button_start.html @@ -2,25 +2,17 @@ title text {% endcomment %} -
{% if session_count > 0 %} diff --git a/games/templates/list_sessions.html b/games/templates/list_sessions.html index 297c6ab..23bf923 100644 --- a/games/templates/list_sessions.html +++ b/games/templates/list_sessions.html @@ -1,80 +1,68 @@ {% extends 'base.html' %} - {% load static %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% block content %} - -{% if dataset.count >= 1 %} - -{% endif %} - -{% if dataset.count != 0 %} - - - - - - - - - - - {% for data in dataset %} - - - - - - - {% endfor %} - -
NameDuration
- - {{ data.purchase.edition }} - - - {{ data.duration_formatted }} -
-{% else %} -
No sessions found.
-{% endif %} + {% if dataset.count >= 1 %} + + {% endif %} + {% if dataset.count != 0 %} + + + + + + + + + + + {% for data in dataset %} + + + + + + + {% endfor %} + +
NameDuration
+ + {{ data.purchase.edition }} + + {{ data.duration_formatted }}
+ {% else %} +
No sessions found.
+ {% endif %} {% endblock content %} diff --git a/games/templates/stats.html b/games/templates/stats.html index 54efb71..d2dd1c4 100644 --- a/games/templates/stats.html +++ b/games/templates/stats.html @@ -1,17 +1,19 @@ {% extends "base.html" %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% load static %} - {% block content %}
- {% for year_item in stats_dropdown_year_range %} - + {% endfor %}
@@ -62,11 +64,15 @@ Refunded - {{ all_purchased_refunded_this_year.count }} ({{ refunded_percent }}%) + + {{ all_purchased_refunded_this_year.count }} ({{ refunded_percent }}%) + Unfinished - {{ purchased_unfinished.count }} ({{ unfinished_purchases_percent }}%) + + {{ purchased_unfinished.count }} ({{ unfinished_purchases_percent }}%) + Backlog Decrease @@ -90,14 +96,13 @@ {% for game in top_10_games_by_playtime %} - - - {{ game.name }} - - - - {{ game.formatted_playtime }} - + + + {{ game.name }} + + {{ game.formatted_playtime }} + {% endfor %} @@ -111,10 +116,10 @@ {% for item in total_playtime_per_platform %} - - {{ item.platform_name }} - {{ item.formatted_playtime }} - + + {{ item.platform_name }} + {{ item.formatted_playtime }} + {% endfor %} @@ -128,10 +133,13 @@ {% for purchase in all_finished_this_year %} - - {{ purchase.edition.name }} - {{ purchase.date_finished | date:"d/m/Y" }} - + + + {{ purchase.edition.name }} + + {{ purchase.date_finished | date:"d/m/Y" }} + {% endfor %} @@ -145,10 +153,13 @@ {% for purchase in this_year_finished_this_year %} - - {{ purchase.edition.name }} - {{ purchase.date_finished | date:"d/m/Y" }} - + + + {{ purchase.edition.name }} + + {{ purchase.date_finished | date:"d/m/Y" }} + {% endfor %} @@ -162,10 +173,13 @@ {% for purchase in purchased_this_year_finished_this_year %} - - {{ purchase.edition.name }} - {{ purchase.date_finished | date:"d/m/Y" }} - + + + {{ purchase.edition.name }} + + {{ purchase.date_finished | date:"d/m/Y" }} + {% endfor %} @@ -180,18 +194,17 @@ {% for purchase in all_purchased_this_year %} - - - - {{ purchase.edition.name }} - {% if purchase.type != "game" %} - ({{ purchase.name }}, {{ purchase.get_type_display }}) - {% endif %} - - - {{ purchase.price }} - {{ purchase.date_purchased | date:"d/m/Y" }} - + + + + {{ purchase.edition.name }} + {% if purchase.type != "game" %}({{ purchase.name }}, {{ purchase.get_type_display }}){% endif %} + + + {{ purchase.price }} + {{ purchase.date_purchased | date:"d/m/Y" }} + {% endfor %} diff --git a/games/templates/view_game.html b/games/templates/view_game.html index ca9d6c3..88f9f1b 100644 --- a/games/templates/view_game.html +++ b/games/templates/view_game.html @@ -1,9 +1,8 @@ {% extends "base.html" %} - -{% block title %}{{ title }}{% endblock title %} - +{% block title %} + {{ title }} +{% endblock title %} {% load static %} - {% block content %}

@@ -14,83 +13,81 @@

{{ hours_sum }} total - {{ session_average }} avg - ({{ playrange }})

+ {{ session_average }} avg + ({{ playrange }}) +
-

Editions ({{ edition_count }}) and Purchases ({{ purchase_count }})

- +

+ Editions ({{ edition_count }}) and Purchases ({{ purchase_count }}) +

    {% for edition in editions %} -
  • - {{ edition.name }} ({{ edition.platform }}, {{ edition.year_released }}) - {% if edition.wikidata %} - - {% endif %} - {% url 'edit_edition' edition.id as edit_url %} - {% include 'components/edit_button.html' with edit_url=edit_url %} -
  • +
  • + {{ edition.name }} ({{ edition.platform }}, {{ edition.year_released }}) + {% if edition.wikidata %} + + {% endif %} + {% url 'edit_edition' edition.id as edit_url %} + {% include 'components/edit_button.html' with edit_url=edit_url %} +
    • {% for purchase in edition.game_purchases %} -
    • - {{ purchase.get_ownership_type_display }}, {{ purchase.date_purchased | date:"Y" }}, {{ purchase.price }} {{ purchase.price_currency}} - {% url 'edit_purchase' purchase.id as edit_url %} - {% include 'components/edit_button.html' with edit_url=edit_url %} -
    • -
        - {% for related_purchase in purchase.nongame_related_purchases %} -
      • - {{ related_purchase.name }} ({{ related_purchase.get_type_display }}, {{ purchase.platform }}, {{ related_purchase.date_purchased | date:"Y" }}, {{ related_purchase.price }} {{ related_purchase.price_currency}}) - {% url 'edit_purchase' related_purchase.id as edit_url %} - {% include 'components/edit_button.html' with edit_url=edit_url %} -
      • - {% endfor %} -
      +
    • + {{ purchase.get_ownership_type_display }}, {{ purchase.date_purchased | date:"Y" }}, {{ purchase.price }} {{ purchase.price_currency }} + {% url 'edit_purchase' purchase.id as edit_url %} + {% include 'components/edit_button.html' with edit_url=edit_url %} +
    • +
        + {% for related_purchase in purchase.nongame_related_purchases %} +
      • + {{ related_purchase.name }} ({{ related_purchase.get_type_display }}, {{ purchase.platform }}, {{ related_purchase.date_purchased | date:"Y" }}, {{ related_purchase.price }} {{ related_purchase.price_currency }}) + {% url 'edit_purchase' related_purchase.id as edit_url %} + {% include 'components/edit_button.html' with edit_url=edit_url %} +
      • + {% endfor %} +
      {% endfor %}
    {% endfor %}
-

Sessions - - ({{ sessions.count }}) - + ({{ sessions.count }}) {% url 'start_game_session' game.id as add_session_link %} {% include 'components/button.html' with title="Start new session" text="New" link=add_session_link %}

    {% for session in sessions %} -
  • - {{ session.timestamp_start | date:"d/m/Y" }} - ({{ session.device.get_type_display | default:"Unknown" }}, {{ session.duration_formatted }}) - {% url 'edit_session' session.id as edit_url %} - {% include 'components/edit_button.html' with edit_url=edit_url %} -
  • +
  • + {{ session.timestamp_start | date:"d/m/Y" }} + ({{ session.device.get_type_display | default:"Unknown" }}, {{ session.duration_formatted }}) + {% url 'edit_session' session.id as edit_url %} + {% include 'components/edit_button.html' with edit_url=edit_url %} +
  • {% endfor %}
-

Notes ({{ sessions_with_notes.count }})

+

+ Notes ({{ sessions_with_notes.count }}) +

    {% for session in sessions_with_notes %} -
  • -
      -
    • - - {{ session.timestamp_start | date:"d/m/Y H:m" }} - {% url 'edit_session' session.id as edit_session_url %} - {% include 'components/edit_button.html' with edit_url=edit_session_url %} - -
    • -
    • - {{ session.note|linebreaks }} -
    • -
    -
  • +
  • +
      +
    • + + {{ session.timestamp_start | date:"d/m/Y H:m" }} + {% url 'edit_session' session.id as edit_session_url %} + {% include 'components/edit_button.html' with edit_url=edit_session_url %} + +
    • +
    • {{ session.note|linebreaks }}
    • +
    +
  • {% endfor %}
-
{% endblock content %}