fix downloading and displaying patches for seeds/rooms with teams

This commit is contained in:
Fabian Dill
2021-01-03 18:28:07 +01:00
parent 07954fc230
commit eb58ee2422
6 changed files with 44 additions and 34 deletions

View File

@@ -6,12 +6,13 @@
{{ caller() }}
</ul>
{%- endmacro %}
{% macro list_patches_room(patches, room) %}
{% if patches %}
{% macro list_patches_room(room) %}
{% if room.seed.patches %}
<ul>
{% for patch in patches|list|sort(attribute="player") %}
<li><a href="{{ url_for("download_patch", patch_id=patch.id, room_id=room.id) }}">
Patch for player {{ patch.player }} - {{ room.seed.multidata["names"][0][patch.player-1] }}</a></li>
{% for patch in room.seed.patches|list|sort(attribute="team,player") %}
<li><a href="{{ url_for("download_patch", team = patch.team, patch_id=patch.id, room_id=room.id) }}">
Patch for team {{ patch.team+1 }} player {{ patch.player }}
- {{ room.seed.multidata["names"][patch.team][patch.player-1] }}</a></li>
{% endfor %}
</ul>
{% endif %}