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

{% block cfp_content %}
    <h2>{% trans "Submission Types" %}</h2>
    <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-sm table-hover table-responsive-md">
        <thead>
            <tr>
                <th>{% trans "Submission type" %}</th>
                <th>{% trans "Submissions" %}</th>
                <th>{% trans "Default duration" %}</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {% for type in types %}
                <tr>
                    <td>
                        {% if type.requires_access_code %}
                            <i class="fa fa-lock" title="{% trans "Requires access code" %}"></i>
                        {% endif %}
                        <a href="{{ type.urls.edit }}">
                            {{ type.name }}
                        </a>
                    </td>
                    <td class="pl-4">
                        {{ type.submission_count }}
                    </td>
                    <td>{{ type.default_duration }}</td>
                    <td class="action-column">
                        {% if request.event.cfp.default_type == type %}
                            <a><i class="fa fa-check"></i> {% trans "Default" %}</a>
                        {% else %}
                            <a href="{{ type.urls.default }}"
                                    class="btn btn-sm btn-info">
                                Make default
                            </a>
                        {% endif %}
                        <a href="{{ type.urls.prefilled_cfp.full }}"
                                title="{% trans 'Go to pre-filled CfP form' %}"
                                class="btn btn-sm btn-info">
                            <i class="fa fa-link"></i>
                        </a>
                        <a href="{{ type.urls.edit }}"
                                class="btn btn-sm btn-info">
                            <i class="fa fa-edit"></i>
                        </a>
                        <a href="{{ type.urls.delete }}"
                                class="btn btn-sm btn-danger">
                            <i class="fa fa-trash"></i>
                        </a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    <div class="submit-group"><span></span>
        <a class="btn btn-info" href="{{ request.event.cfp.urls.new_type }}">
            <i class="fa fa-plus"></i>
            {% trans "New type" %}
        </a>
    </div>
{% endblock %}
