mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00

* WebHost: Round percentage of checks, fix possible 500 error * Round using str.format in the template How the percentage of checks done should be displayed is a display concern, so it makes sense to just always do it in the template. That way, along with using .format() instead of .round, means we always get exactly the same presentation regardless of whether it ends in .00 (which would not round to two decimal places), is an int (which `round(2)` wouldn't touch at all), etc. * Round percent_total_checks_done in lttp multitracker * Fix non-LttP games showing as 0% done in LttP MultiTracker
172 lines
10 KiB
HTML
172 lines
10 KiB
HTML
{% extends 'tablepage.html' %}
|
|
{% block head %}
|
|
{{ super() }}
|
|
<title>ALttP Multiworld Tracker</title>
|
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename="styles/tracker.css") }}"/>
|
|
<script type="application/ecmascript" src="{{ url_for('static', filename="assets/jquery.scrollsync.js") }}"></script>
|
|
<script type="application/ecmascript" src="{{ url_for('static', filename="assets/lttpMultiTracker.js") }}"></script>
|
|
<script type="application/ecmascript" src="{{ url_for('static', filename="assets/trackerCommon.js") }}"></script>
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
{% include 'header/dirtHeader.html' %}
|
|
{% include 'multiTrackerNavigation.html' %}
|
|
<div id="tracker-wrapper" data-tracker="{{ room.tracker|suuid }}">
|
|
<div id="tracker-header-bar">
|
|
<input placeholder="Search" id="search"/>
|
|
<span{% if not video %} hidden{% endif %} id="multi-stream-link">
|
|
<a target="_blank" href="https://multistream.me/
|
|
{%- for platform, link in video.values()|unique(False, 1)-%}
|
|
{%- if platform == "Twitch" -%}t{%- else -%}yt{%- endif -%}:{{- link -}}/
|
|
{%- endfor -%}">
|
|
Multistream
|
|
</a>
|
|
</span>
|
|
<span class="info">Clicking on a slot's number will bring up a slot-specific auto-tracker. This tracker will automatically update itself periodically.</span>
|
|
</div>
|
|
<div id="tables-container">
|
|
{% for team, players in inventory.items() %}
|
|
<div class="table-wrapper">
|
|
<table id="inventory-table" class="table unique-item-table">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>Name</th>
|
|
{%- for name in tracking_names -%}
|
|
{%- if name in icons -%}
|
|
<th class="center-column">
|
|
<img class="alttp-sprite" src="{{ icons[name] }}" alt="{{ name|e }}">
|
|
</th>
|
|
{%- else -%}
|
|
<th class="center-column">{{ name|e }}</th>
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{%- for player, items in players.items() -%}
|
|
<tr>
|
|
<td><a href="{{ url_for("get_player_tracker", tracker=room.tracker,
|
|
tracked_team=team, tracked_player=player)}}">{{ loop.index }}</a></td>
|
|
{%- if (team, loop.index) in video -%}
|
|
{%- if video[(team, loop.index)][0] == "Twitch" -%}
|
|
<td>
|
|
<a target="_blank" href="https://www.twitch.tv/{{ video[(team, loop.index)][1] }}">
|
|
{{ player_names[(team, loop.index)] }}
|
|
▶️</a></td>
|
|
{%- elif video[(team, loop.index)][0] == "Youtube" -%}
|
|
<td>
|
|
<a target="_blank" href="youtube.com/c/{{ video[(team, loop.index)][1] }}/live">
|
|
{{ player_names[(team, loop.index)] }}
|
|
▶️</a></td>
|
|
{%- endif -%}
|
|
{%- else -%}
|
|
<td>{{ player_names[(team, loop.index)] }}</td>
|
|
{%- endif -%}
|
|
{%- for id in tracking_ids -%}
|
|
{%- if items[id] -%}
|
|
<td class="center-column item-acquired">
|
|
{% if id in multi_items %}{{ items[id] }}{% else %}✔️{% endif %}</td>
|
|
{%- else -%}
|
|
<td></td>
|
|
{%- endif -%}
|
|
{% endfor %}
|
|
</tr>
|
|
{%- endfor -%}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
{% for team, players in checks_done.items() %}
|
|
<div class="table-wrapper">
|
|
<table id="checks-table" class="table non-unique-item-table">
|
|
<thead>
|
|
<tr>
|
|
<th rowspan="2">#</th>
|
|
<th rowspan="2">Name</th>
|
|
{% for area in ordered_areas %}
|
|
{% set colspan = 1 %}
|
|
{% if area in key_locations %}
|
|
{% set colspan = colspan + 1 %}
|
|
{% endif %}
|
|
{% if area in big_key_locations %}
|
|
{% set colspan = colspan + 1 %}
|
|
{% endif %}
|
|
{% if area in icons %}
|
|
<th colspan="{{ colspan }}" class="center-column upper-row">
|
|
<img class="alttp-sprite" src="{{ icons[area] }}" alt="{{ area }}"></th>
|
|
{%- else -%}
|
|
<th colspan="{{ colspan }}" class="center-column">{{ area }}</th>
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
<th rowspan="2" class="center-column">%</th>
|
|
<th rowspan="2" class="center-column hours">Last<br>Activity</th>
|
|
</tr>
|
|
<tr>
|
|
{% for area in ordered_areas %}
|
|
<th class="center-column lower-row fraction">
|
|
<img class="alttp-sprite" src="{{ icons["Chest"] }}" alt="Checks">
|
|
</th>
|
|
{% if area in key_locations %}
|
|
<th class="center-column lower-row number">
|
|
<img class="alttp-sprite" src="{{ icons["Small Key"] }}" alt="Small Key">
|
|
</th>
|
|
{% endif %}
|
|
{% if area in big_key_locations %}
|
|
<th class="center-column lower-row number">
|
|
<img class="alttp-sprite" src="{{ icons["Big Key"] }}" alt="Big Key">
|
|
</th>
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{%- for player, checks in players.items() -%}
|
|
<tr>
|
|
<td><a href="{{ url_for("get_player_tracker", tracker=room.tracker,
|
|
tracked_team=team, tracked_player=player)}}">{{ loop.index }}</a></td>
|
|
<td>{{ player_names[(team, loop.index)]|e }}</td>
|
|
{%- for area in ordered_areas -%}
|
|
{% if player in checks_in_area and area in checks_in_area[player] %}
|
|
{%- set checks_done = checks[area] -%}
|
|
{%- set checks_total = checks_in_area[player][area] -%}
|
|
{%- if checks_done == checks_total -%}
|
|
<td class="item-acquired center-column">
|
|
{{ checks_done }}/{{ checks_total }}</td>
|
|
{%- else -%}
|
|
<td class="center-column">{{ checks_done }}/{{ checks_total }}</td>
|
|
{%- endif -%}
|
|
{%- if area in key_locations -%}
|
|
<td class="center-column">{{ inventory[team][player][small_key_ids[area]] }}</td>
|
|
{%- endif -%}
|
|
{%- if area in big_key_locations -%}
|
|
<td class="center-column">{% if inventory[team][player][big_key_ids[area]] %}✔️{% endif %}</td>
|
|
{%- endif -%}
|
|
{% else %}
|
|
<td class="center-column"></td>
|
|
{%- if area in key_locations -%}
|
|
<td class="center-column"></td>
|
|
{%- endif -%}
|
|
{%- if area in big_key_locations -%}
|
|
<td class="center-column"></td>
|
|
{%- endif -%}
|
|
{% endif %}
|
|
{%- endfor -%}
|
|
<td class="center-column">{{ "{0:.2f}".format(percent_total_checks_done[team][player]) }}</td>
|
|
{%- if activity_timers[(team, player)] -%}
|
|
<td class="center-column">{{ activity_timers[(team, player)].total_seconds() }}</td>
|
|
{%- else -%}
|
|
<td class="center-column">None</td>
|
|
{%- endif -%}
|
|
</tr>
|
|
{%- endfor -%}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endfor %}
|
|
{% include "hintTable.html" with context %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|