{% extends 'pageWrapper.html' %}
{% import "macros.html" as macros %}

{% block head %}
    <title>View Seed {{ seed.id|suuid }}</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename="styles/viewSeed.css") }}"/>
    <script type="application/ecmascript" src="{{ url_for('static', filename="assets/viewSeed.js") }}"></script>
{% endblock %}

{% block body %}
    {% include 'header/oceanHeader.html' %}
    <div id="view-seed-wrapper">
        <div id="view-seed" class="grass-island">
            <h1>Seed Info</h1>
            {% if not seed.multidata and not seed.spoiler %}
                <p>Single Player Race Rom: No spoiler or multidata exists, parts of the rom are encrypted and rooms
                    cannot be created.</p>
            {% endif %}
            <table>
                <tbody>
                <tr>
                    <td>Seed:&nbsp;</td>
                    <td>{{ seed.id|suuid }}</td>
                </tr>
                <tr>
                    <td>Created:&nbsp;</td>
                    <td id="creation-time" data-creation-time="{{ seed.creation_time }}"></td>
                </tr>
                {% if seed.spoiler %}
                    <tr>
                        <td>Spoiler:&nbsp;</td>
                        <td><a href="{{ url_for("download_spoiler", seed_id=seed.id) }}">Download</a></td>
                    </tr>
                {% endif %}
                {% if seed.multidata %}
                    <tr>
                        <td>Players:&nbsp;</td>
                        <td>
                            <ul>
                                {% for patch in seed.slots|sort(attribute='player_id') %}
                                <li>
                                    <a href="{{ url_for("download_raw_patch", seed_id=seed.id, player_id=patch.player_id) }}">{{ patch.player_name }}</a>
                                </li>
                                {% endfor %}
                            </ul>
                        </td>
                    </tr>
                    <tr>
                        <td>Rooms:&nbsp;</td>
                    <td>
                            {% call macros.list_rooms(rooms) %}
                                <li>
                                    <a href="{{ url_for("new_room", seed=seed.id) }}">Create New Room</a>
                                </li>
                            {% endcall %}
                        </td>
                    </tr>
                {% else  %}
                <tr>
                    <td>Files:&nbsp;</td>
                    <td>
                        <ul>
                            {% for slot in seed.slots %}

                            <li>
                                <a href="{{ url_for("download_raw_patch", seed_id=seed.id, player_id=slot.player_id) }}">Player {{ slot.player_name }}</a>
                            </li>


                            {% endfor %}
                        </ul>
                    </td>
                </tr>
                {% endif %}
                </tbody>
            </table>
        </div>
    </div>
    {% include 'islandFooter.html' %}
{% endblock %}
