{% extends "cfp/event/base.html" %}
{% load i18n %}
{% block title %}{% trans "Your submissions" %} :: {{ request.event }}{% endblock %}
{% block content %}
    <h2>{% trans "Your submissions" %}</h2>
    {% if submissions %}
        <table class="table table-condensed table-responsive-md">
            <thead>
            <tr>
                <th>{% trans "Title" %}</th>
                <th>{% trans "State" %}</th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            {% for submission in submissions %}
                <tr>
                    <td>
                        <a href="{{ submission.urls.user_base }}">
                            {{ submission.title }}
                        </a>
                    </td>
                    <td>
                        {% include "cfp/event/fragment_state.html" with state=submission.state %}
                    </td>
                    <td class="text-right">
                        {% if submission.editable %}
                            <a href="{{ submission.urls.user_base }}"
                                    class="btn btn-sm btn-secondary">
                                <span class="fa fa-pencil"></span>
                            </a>
                        {% endif %}
                        {% if submission.state == 'accepted' %}
                            <a href="{{ submission.urls.confirm }}"
                                    class="btn btn-sm btn-secondary">
                                <span class="fa fa-check"></span>{% trans "Confirm" %}
                            </a>
                        {% endif %}
                        {% if submission.slot %}
                            <a href="{{ submission.urls.public }}"
                                    class="btn btn-sm btn-secondary">
                                <span class="fa fa-calendar"></span>{% trans "Schedule" %}
                            </a>
                        {% endif %}
                        {% if submission.does_accept_feedback %}
                            <a href="{{ submission.urls.feedback }}"
                                    class="btn btn-sm btn-secondary">
                                <span class="fa fa-comments-o"></span>{% trans "Feedback" %}
                            </a>
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <p>
            {% if request.event.cfp.is_open %}
                <a class="btn btn-success btn-lg"
                   href="{{ request.event.urls.submit }}">
                    {% trans "Create a new submission" %}
                </a>
            {% endif %}
        </p>
    {% else %}
        <p class="text-center">
            {% trans "It seems like you haven't submitted anything to this event yet." %}
        </p>
        <p class="text-center">
            {% trans "If you did, maybe you used a different account? Check your emails!" %}
        </p>
        {% if request.event.cfp.is_open %}
            <p class="text-center">
                {% trans "If you did not, why not go ahead and create a proposal now? We'd love to hear from you!" %}
            </p>
            <p class="text-center">
                <a class="btn btn-success btn-lg btn-block"
                        href="{{ request.event.urls.submit }}">
                    {% trans "Submit something now!" %}
                </a>
            </p>
        {% endif %}
    {% endif %}
{% endblock %}
