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

{% block cfp_content %}

    <legend>{% trans "Submission Types" %}</legend>
    <div class="alert alert-info">
        {% blocktrans trimmed %}
        Different submission types may help to guide speakers into different slot
        lengths (short talks vs long talks) or different presentation formats
        (talk vs workshop vs metal concert).
        {% endblocktrans %}
    </div>
    <table class="table table-condensed table-responsive-md">
        <thead>
            <tr>
                <th>{% trans "Submission type" %}</th>
                <th>{% trans "Default length" %}</th>
                <th>{% trans "Maximum length" %}</th>
                <th></th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {% for type in types %}
                <tr>
                    <td>{{ type.name }}</td>
                    <td>{{ type.default_duration }}</td>
                    <td>{{ type.max_duration }}</td>
                    <td>
                        {% if request.event.cfp.default_type == type %}
                            <span class="fa fa-check"></span> {% trans "Default" %}
                        {% else %}
                            <a href="{{ type.urls.default }}"
                                    class="btn btn-sm btn-secondary">
                                Make default
                            </a>
                        {% endif %}
                    </td>
                    <td class="text-right">
                        <a href="{{ type.urls.edit }}"
                                class="btn btn-sm btn-secondary">
                            <span class="fa fa-pencil"></span>
                        </a>
                        <a href="{{ type.urls.delete }}"
                                class="btn btn-sm btn-secondary">
                            <span class="fa fa-trash"></span>
                        </a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>

    <a href="{{ request.event.cfp.urls.new_type }}">
        <button class="btn btn-secondary">
            {% trans "New type" %}
        </button>
    </a>
{% endblock %}
