{% extends "orga/base.html" %}
{% load i18n %}

{% block content %}
<div>
    <h2>
        {{ request.event.rooms.count }}
        {% blocktrans trimmed count count=request.event.rooms.count %}
        Room
        {% plural %}
        Rooms
        {% endblocktrans %}
    </h2>

    <table class="table table-sm table-hover table-responsive-md">
        <thead>
            <tr>
                <th>{% trans "Name" %}</th>
                <th>{% trans "Capacity" %}</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {% for room in request.event.rooms.all %}
                <tr>
                    <td>
                        <a href="{{ room.urls.settings_base }}">
                            {{ room.name }}
                        </a>
                    </td>
                    <td>{% if room.capacity %}{{ room.capacity }}{% endif %}</td>
                    <td class="action-column">
                        {% if not forloop.last %}
                        <a href="{{ room.urls.down }}"
                           class="btn btn-sm btn-outline-info"
                           title="{% trans "Move room down" %}">
                            <i class="fa fa-arrow-down"></i>
                        </a>
                        {% endif %}
                        {% if not forloop.first %}
                        <a href="{{ room.urls.up }}"
                           class="btn btn-sm btn-outline-info"
                           title="{% trans "Move room up" %}">
                            <i class="fa fa-arrow-up"></i>
                        </a>
                        {% endif %}
                        <a href="{{ room.urls.edit }}"
                            class="btn btn-sm btn-info">
                            <i class="fa fa-edit"></i>
                        </a>
                        <a href="{{ room.urls.delete }}"
                            class="btn btn-sm btn-danger">
                            <i class="fa fa-trash"></i>
                        </a>
                    </td>
                </tr>
            {% empty %}
                <tr><td> {% trans "Please add at least one place in which talks can take place." %} </td></tr>
            {% endfor %}
        </tbody>
    </table>

    <div class="submit-group"><span></span>
        <a class="btn btn-lg btn-success" href="{{ request.event.orga_urls.new_room }}">
            <i class="fa fa-plus"></i>
            {% trans "New room" %}
        </a>
    </div>
</div>
{% endblock %}
