{% extends 'speeches/speech_audio.html' %}
{% load staticfiles %}
{% load url from future %}

{% block extra_headers %}
{% if object.celery_task_id %}
    <meta http-equiv="refresh" content="5">
{% endif %}
{% endblock %}

{% block title %}View speech{% endblock %}

{% block content2 %}
<p class="lead">Here is where you can view a speech.</p>

{% if object.celery_task_id %}
    <p>Please wait, audio is being transcribed. This page will automatically refresh in 5 seconds...</p>
{% else %}

    {{ object.location }}

    <a href="{% url "speaker-view" object.speaker.id %}">{{ object.speaker }}</a>

    {% if object.audio %}
        <p><audio src="{{ MEDIA_URL }}{{ object.audio }}" controls></audio></p>
    {% endif %}

    {% if object.text %}
        <blockquote>{{ object.text }}</blockquote>
    {% endif %}

    <a href="{{ object.get_edit_url }}">Edit</a>
{% endif %}

{% endblock %}

{% extends 'speeches/speech_audio.html' %}
{% load staticfiles %}
{% load url from future %}

{% block extra_headers %}
{% if object.celery_task_id %}
    <meta http-equiv="refresh" content="5">
{% endif %}
{% endblock %}

{% block title %}View speech{% endblock %}

{% block content2 %}
<p class="lead">Here is where you can view a speech.</p>

{% if object.celery_task_id %}
    <p>Please wait, audio is being transcribed. This page will automatically refresh in 5 seconds...</p>
{% else %}

    {{ object.location }}

    {% if object.speaker %}
        <a href="{% url "speaker-view" object.speaker.id %}">{{ object.speaker }}</a>
    {% endif %}

    {% if object.audio %}
        <p><audio src="{{ MEDIA_URL }}{{ object.audio }}" controls></audio></p>
    {% endif %}

    {% if object.text %}
        <blockquote>{{ object.text }}</blockquote>
    {% endif %}

    <a href="{{ object.get_edit_url }}">Edit</a>
{% endif %}

{% endblock %}

Deal with case when no speaker is assigned for speaker links
Deal with case when no speaker is assigned for speaker links
