WebHost: restore automatic tracker refresh

This commit is contained in:
Fabian Dill 2020-07-24 03:57:44 +02:00
parent 051555ef14
commit c41ffdeb80
2 changed files with 9 additions and 8 deletions

View File

@ -10,7 +10,8 @@ window.addEventListener('load', () => {
const update = () => { const update = () => {
const target = $("<div></div>"); const target = $("<div></div>");
target.load("/tracker/{{ room.tracker }}", function (response, status) { const tracker = document.getElementById('tracker-wrapper').getAttribute('data-tracker');
target.load("/tracker/" + tracker, function (response, status) {
if (status === "success") { if (status === "success") {
target.find(".table").each(function (i, new_table) { target.find(".table").each(function (i, new_table) {
const new_trs = $(new_table).find("tbody>tr"); const new_trs = $(new_table).find("tbody>tr");

View File

@ -8,17 +8,17 @@
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<div id="tracker-wrapper"> <div id="tracker-wrapper" data-tracker="{{ room.tracker }}">
{% for team, players in inventory.items() %} {% for team, players in inventory.items() %}
<div class="table-wrapper"> <div class="table-wrapper">
<table class="table unique-item-table"> <table class="table unique-item-table">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th>Name</th> <th>Name</th>
{% for name in tracking_names %} {% for name in tracking_names %}
{% if name in icons %} {% if name in icons %}
<th class="center-column"> <th class="center-column">
<img class="alttp-sprite" src="{{ icons[name] }}" alt="{{ name|e }}"> <img class="alttp-sprite" src="{{ icons[name] }}" alt="{{ name|e }}">
</th> </th>
{% else %} {% else %}