diff --git a/.gitignore b/.gitignore index 4c34778..778db6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ **/.venv/** **/__pycache__/** *.pyc -TunicTransitionTracker +TunicTransitionTracker* settings.json **/db.sqlite3 **/node_modules/** diff --git a/TunicTransitionTracker-linux b/TunicTransitionTracker-linux deleted file mode 100755 index cd4fc5b..0000000 Binary files a/TunicTransitionTracker-linux and /dev/null differ diff --git a/tunictracker/tracker/templates/index.html b/tunictracker/tracker/templates/index.html index 483c978..8925add 100644 --- a/tunictracker/tracker/templates/index.html +++ b/tunictracker/tracker/templates/index.html @@ -1,5 +1,3 @@ - - @@ -7,12 +5,11 @@ - {% comment %} {% endcomment %} + {% comment %} {% endcomment %} {% load static tailwind_tags %} {% tailwind_css %} {% load static %} - - + {% block content %} diff --git a/tunictracker/tracker/templates/tracker/index.html b/tunictracker/tracker/templates/tracker/index.html index d4c4fba..da0e669 100644 --- a/tunictracker/tracker/templates/tracker/index.html +++ b/tunictracker/tracker/templates/tracker/index.html @@ -4,106 +4,116 @@ {% block content %}
-
-
- A trans pride fox emoji. -  Tunic Transition Tracker -
-
-
-
Overview
-
-
Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }}
-
Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }}
+ {% if debug != '' %} +
+
+ A trans pride fox emoji. +  Tunic Transition Tracker

-
- Breakdown -
- {% for scene, scene_totals in totals.items %} - {% if scene != 'Entrances' and scene != 'Checks' %} -
+
Overview
+
+
Checks: {{ totals.Checks.Undiscovered }}/{{ totals.Checks.Total }}
+
Entrances: {{ totals.Entrances.Undiscovered }}/{{ totals.Entrances.Total }}
+
+
+
+ Breakdown +
+ {% for scene, scene_totals in totals.items %} + {% if scene != 'Entrances' and scene != 'Checks' %} + {% if scene_totals.Checks.Undiscovered > 0 and scene_totals.Entrances.Undiscovered > 0 %} +
+
{{ scene }}:
+
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
+
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
+
{% elif scene_totals.Checks.Undiscovered > 0 %} - +
+
{{ scene }}:
+
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
+
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
+
{% elif scene_totals.Entrances.Undiscovered > 0 %} - - {% endif %}"> -
{{ scene }}:
-
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
-
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
-
- {% endif %} - {% endfor %} +
+
{{ scene }}:
+
Checks: {{ scene_totals.Checks.Undiscovered }}/{{ scene_totals.Checks.Total }}
+
Entrances: {{ scene_totals.Entrances.Undiscovered }}/{{ scene_totals.Entrances.Total }}
+
+ {% endif %} + {% endif %} + {% endfor %} +
+
+
+
+
{{ scene }}
+
+
+
+
Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }}
+
+
+
+ {% if scene_data.Totals.Checks.Total > 0 %} + {% for check_name, check in scene_data.Checks.items %} + {% if not check.Check %} +
    ❌ {{ check_name }}
+ {% endif %} + {% endfor %} + {% else %} + + {% endif %} +
+
+
+
+
Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}
+
+
+
+ {% if scene_data.Totals.Entrances.Total > 0 %} + {% for entrance_origin, entrance_destination in scene_data.Entrances.items %} + {% if not entrance_destination.Entrance != '' %} +
    ❌ {{ entrance_origin }}
+ {% else %} + + {% endif %} + {% endfor %} + {% else %} + + {% endif %} +
+
+
+
+
+ {% for entrance_origin, entrance_destination in scene_data.Entrances.items %} + {% if entrance_destination.Entrance %} +
    ✔️ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}
+ {% endif %} + {% endfor %} +
+
+
+
+ Tracker Debug +
+
+
    Name: {{ debug.Name }}
+
    Seed: {{ debug.Seed }}
+
    Spoiler Seed: {{ debug.SpoilerSeed }}
+
    Archipelago: {{ debug.Archipelago }}
+
    Randomized: {{ debug.Randomized }}
+
    Hex Quest: {{ debug.HexQuest }}
+
    Entrance Randomizer: {{ debug.EntranceRando }}
+
    Fixed Shops: {{ debug.FixedShops }}
+
-
-
{{ scene }}
-
-
-
-
Checks: {{ scene_data.Totals.Checks.Undiscovered }}/{{ scene_data.Totals.Checks.Total }}
-
-
-
- {% if scene_data.Totals.Checks.Total > 0 %} - {% for check_name, check in scene_data.Checks.items %} - {% if not check.Check %} -
    ❌ {{ check_name }}
- {% endif %} - {% endfor %} - {% else %} - - {% endif %} -
-
-
-
-
Entrances: {{ scene_data.Totals.Entrances.Undiscovered }}/{{ scene_data.Totals.Entrances.Total }}
-
-
-
- {% if scene_data.Totals.Entrances.Total > 0 %} - {% for entrance_origin, entrance_destination in scene_data.Entrances.items %} - {% if not entrance_destination.Entrance != '' %} -
    ❌ {{ entrance_origin }}
- {% else %} - - {% endif %} - {% endfor %} - {% else %} - - {% endif %} -
-
-
-
-
- {% for entrance_origin, entrance_destination in scene_data.Entrances.items %} - {% if entrance_destination.Entrance %} -
    ✔️ {{ entrance_origin }} -> {{ entrance_destination.Entrance }}
- {% endif %} - {% endfor %} -
-
-
-
- Tracker Debug -
-
-
    Name: {{ debug.Name }}
-
    Seed: {{ debug.Seed }}
-
    Spoiler Seed: {{ debug.SpoilerSeed }}
-
    Archipelago: {{ debug.Archipelago }}
-
    Randomized: {{ debug.Randomized }}
-
    Hex Quest: {{ debug.HexQuest }}
-
    Entrance Randomizer: {{ debug.EntranceRando }}
-
    Fixed Shops: {{ debug.FixedShops }}
-
-
-
-
+ {% endif %}
{% endblock %} diff --git a/tunictracker/tracker/views.py b/tunictracker/tracker/views.py index ee32664..465c689 100644 --- a/tunictracker/tracker/views.py +++ b/tunictracker/tracker/views.py @@ -9,7 +9,19 @@ import requests def index(request): - tracker_output = loads(requests.get('http://localhost:8000/spoiler').text) + request_data = None + try: + request_data = requests.get('http://localhost:8000/spoiler').text + except: + context = { + "debug": "", + "totals": "", + "scene": "", + "scene_data": "" + } + template = loader.get_template("tracker/index.html") + return HttpResponse(template.render(context, request)) + tracker_output = loads() # with open('spoiler.json', 'r') as t: # tracker_output = loads(t.read()) tracker_debug = tracker_output["Debug"] @@ -38,7 +50,7 @@ def index(request): for i, check in enumerate(temp_tracker_checks.keys()): temp_data = { "Check": temp_tracker_checks[check], - "CheckNum": floor(int(i)%3) + "CheckNum": floor(int(i) % 3) } temp_tracker_checks[check] = temp_data tracker_current_scene_data["Checks"] = temp_tracker_checks @@ -46,7 +58,7 @@ def index(request): for i, entrance in enumerate(temp_tracker_entrances.keys()): temp_data = { "Entrance": temp_tracker_entrances[entrance], - "EntranceNum": floor(int(i)%3) + "EntranceNum": floor(int(i) % 3) } temp_tracker_entrances[entrance] = temp_data tracker_current_scene_data["Entrances"] = temp_tracker_entrances