{% macro list_rooms(rooms) -%}
    <ul>
        {% for room in rooms %}
            <li><a href="{{ url_for("hostRoom", room=room.id) }}">Room #{{ room.id|suuid }}</a></li>
        {% endfor %}
        {{ caller() }}
    </ul>
{%- endmacro %}
{% macro list_patches_room(room) %}
    {% if room.seed.slots %}
        <ul>
            {% for patch in room.seed.slots|list|sort(attribute="player_id") %}
                {% if patch.game == "Minecraft" %}
                <li><a href="{{ url_for("download_slot_file", room_id=room.id, player_id=patch.player_id) }}">
                    APMC for player {{ patch.player_id }} - {{ patch.player_name }}</a></li>
                {% elif patch.game == "Factorio" %}
                <li><a href="{{ url_for("download_slot_file", room_id=room.id, player_id=patch.player_id) }}">
                    Mod for player {{ patch.player_id }} - {{ patch.player_name }}</a></li>
                {% elif patch.game == "Ocarina of Time" %}
                <li><a href="{{ url_for("download_slot_file", room_id=room.id, player_id=patch.player_id) }}">
                    APZ5 for player {{ patch.player_id }} - {{ patch.player_name }}</a></li>
                {% else %}
                <li><a href="{{ url_for("download_patch", patch_id=patch.id, room_id=room.id) }}">
                    Patch for player {{ patch.player_id }} - {{ patch.player_name }}</a></li>
                {% endif %}
            {% endfor %}
        </ul>
    {% endif %}
{%- endmacro -%}
