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

{% block title %}{{ submission.title }} :: {{ submission.event.name }}{% endblock %}
{% block alternate_link %}
    <link rel="alternate" type="application/json" title="{{ request.event.name }} API" href="{{ request.event.api_urls.talks.full }}{{ submission.code }}" />
{% endblock %}

{% block content %}
{% if submission %}
{% has_perm 'submission.edit_submission' request.user submission as can_edit_submission %}
{% has_perm 'orga.view_reviews' request.user request.event as can_view_reviews %}
{% has_perm 'orga.view_speakers' request.user request.event as can_view_speakers %}
    <h2>
        <span>
            {{ quotation_open }}{{ submission.title }}{{ quotation_close }}
            {% if submission.speakers.exists and can_view_speakers %}
                by {{ submission.display_speaker_names }}
            {% endif %}
            {% include "orga/submission/state_dropdown.html" with submission=submission %}
        </span>
    </h2>
    <ul class="nav nav-tabs">
      <li class="nav-item">
        <a
          class="nav-link {% if "submissions.content" in url_name %}active{% endif %}"
          href="{{ submission.orga_urls.base }}"
        >
            {% trans "Content" %}
        </a>
      </li>
      {% if can_view_speakers %}
      <li class="nav-item">
          <a
            class="nav-link {% if "submissions.speakers" in url_name %}active{% endif %}"
            href="{{ submission.orga_urls.speakers }}"
          >
            {% trans "Speakers" %}
          </a>
      </li>
      {% endif %}
      {% if submission.feedback.count %}
          <li class="nav-item">
              <a
                class="nav-link {% if "submissions.feedback" in url_name %}active{% endif %}"
                href="{{ submission.orga_urls.feedback }}"
              >
                {% trans "Feedback" %}
              </a>
          </li>
      {% endif %}
      {% if can_view_reviews %}
      <li class="nav-item">
          <a
            class="nav-link {% if "reviews" in url_name %}active{% endif %}"
            href="{{ submission.orga_urls.reviews }}"
          >
            {% trans "Reviews" %}
          </a>
      </li>
    {% endif %}
    </ul>
{% endif %}
{% block submission_content %}
{% endblock %}
{% endblock %}
