{% extends "blog/base.html" %}
{% load render_table from django_tables2 %}

<!-- This template is used to create the page of one speech. -->

{% block content %}
<div class="container">
    <div class="row">
        <div class="col s12 m4">
            <div class="card">
                <div class="card-content">
                    <span class="card-title center-align">
                        Rede:<br />{{current_speech.speech_id}}</span>
                    <p class="center-align"><i class="large material-icons blue-grey-text darken-4">insert_comment</i></p>
                    <span class="card-title">Metadaten</span>
                    <ul>
                        <li><a href="/protokolle/protokoll/{{current_speech.foreign_protocol.protocol_id}}"><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">insert_drive_file</i>Aus Protokoll:
                                {{current_speech.foreign_protocol.protocol_id}}</a></li>
                        <br />
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">date_range</i>Datum: {{current_speech.foreign_protocol.session_date}}</li>
                        <br />
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">access_time</i>Startuhrzeit der Sitzung: {{current_speech.foreign_protocol.start_of_session}} Uhr</li>
                        <br />
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">av_timer</i>Enduhrzeit der Sitzung: {{current_speech.foreign_protocol.end_of_session}} Uhr</li>
                        <br />
                        {% if current_speech.foreign_speaker.id %}
                        <a href="/mdbs/mdb/{{current_speech.foreign_speaker.id}}">
                            <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">fingerprint</i>Redner ID: {{current_speech.foreign_speaker.id}}</li>
                        </a>
                        {%else%}
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">fingerprint</i>Redner ID: Nicht erkannt {{current_speech.foreign_speaker.id}}</li>
                        {% endif %}
                        <br />
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">perm_identity</i>Rednertyp: {{current_speech.speaker_type}}</li>
                        <br />
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">short_text</i>Original String: {{current_speech.original_string}}<a class="tooltipped" data-position="bottom" data-tooltip="Dies ist die Zeichenfolge, mit der der aktuelle Redner oder die aktuelle Rednerin im original Protokoll vor ihrem Redebeitrag genannt wurde. Passt dieser nicht zum Namen, der über der Rede steht, ist leider etwas bei der automatischen Erkennung schiefgegangen. Steht kein Name über der Rede, wurde der Redner nicht automatisch erkannt."><i
                                    class="material-icons blue-grey-text darken-4">info_outline</i></a></li>
                        <br />
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">record_voice_over</i>Unterbrechungen/Zurufe: {{interruptions}}</li>
                        <br />
                        <li><i class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">subject</i>Länge: {{words}} Wörter</li>
                </div>
            </div>
            <ul class="collapsible hoverable">
                <li>
                    <div class="collapsible-header"><i class="material-icons left blue-grey-text darken-4">sort_by_alpha</i>Vokabular</div>
                    <div class="collapsible-body white"><span><b>Vokabeln: {{unique_words}}</b><br /><ol>{{ vocabulary|safe }}</ol></span></div>
                </li>
                <li>
                    <div class="collapsible-header"><i class="material-icons left blue-grey-text darken-4">toc</i>Inhaltsverzeichnis</div>
                    <div class="collapsible-body white"><span>{{current_speech.foreign_protocol.toc}}</span></div>
                </li>
                {% if current_speech.foreign_protocol.attachment %}
                <li>
                    <div class="collapsible-header"><i class="material-icons left blue-grey-text darken-4">folder</i>Anlagen</div>
                    <div class="collapsible-body white"><span>{{current_speech.foreign_protocol.attachment}}</span></div>
                </li>
                {% endif %}
            </ul>
        </div>
        <div class="col s12 m8">
            {% if previous_speech.speech_content %}
            <ul class="collapsible hoverable white">
                <li>
                    <div class="collapsible-header"><i class="large material-icons blue-grey-text darken-4">insert_comment</i>Vorherige Rede als Kontext</div>
                    <div class="collapsible-body">
                        <h5>{% if previous_speech.foreign_speaker.id %}
                            Rede von {% if previous_speech.foreign_speaker.title %}
                            {{previous_speech.foreign_speaker.title}}
                            {% endif %}
                            {% if previous_speech.foreign_speaker.nobility %}
                            {{previous_speech.foreign_speaker.nobility}}
                            {% endif %}
                            {{previous_speech.foreign_speaker.first_name}}
                            {% if previous_speech.foreign_speaker.name_prefix %}
                            {{previous_speech.foreign_speaker.name_prefix}}
                            {% endif %}
                            {{previous_speech.foreign_speaker.last_name}}
                            {% else %}
                            <span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können beim zugehörigen Redeeintrag unter dem Punkt Original String gefunden werden."><i
                                        class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span>
                            {% endif %}
                        </h5>
                            <hr class="blue-grey-text darken-4" />
                            <br />
                            <ul class="blue-grey-text darken-4">
                                {% if previous_speech.speaker_party_then == None %}
                                <li>Parteizugehörigkeit zum Zeitpunkt der Rede:
                                    ({{previous_speech.foreign_speaker.party}})</li>
                                    {% else %}
                                <li>Parteizugehörigkeit zum Zeitpunkt der Rede:
                                        ({{previous_speech.speaker_party_then}})</li>
                                        {% endif %}
                                <li>Letzte offizielle eingetragene Parteizugehörigkeit: ({{previous_speech.foreign_speaker.party}})</li>
                            </ul>
                            <br />
                        <span>{% autoescape off %}{{previous_speech_html}}{% endautoescape %}</span>
                    </div>
                </li>
            </ul>
            {% endif %}
            <div class="card">
                <div class="card-content">
                    {% if previous_speech %}
                    <div class="center-align"><a href="/protokolle/rede/{{previous_speech.speech_id}}" class="waves-effect waves-light light-green darken-3 btn"><i class="material-icons left">arrow_upward</i>Zur Rede davor</a></div>
                    <br />
                    {% endif %}
                    {% if current_speech.foreign_speaker.id%}
                    <span class="card-title">Rede von {% if current_speech.foreign_speaker.title %}
                        {{current_speech.foreign_speaker.title}}
                        {% endif %}
                        {% if current_speech.foreign_speaker.nobility %}
                        {{current_speech.foreign_speaker.nobility}}
                        {% endif %}
                        {{current_speech.foreign_speaker.first_name}}
                        {% if current_speech.foreign_speaker.name_prefix %}
                        {{current_speech.foreign_speaker.name_prefix}}
                        {% endif %}
                        {{current_speech.foreign_speaker.last_name}}
                    </span>
                    <hr class="blue-grey-text darken-4" />
                    <ul class="blue-grey-text darken-4">
                        {% if current_speech.speaker_party_then == None %}
                        <li>Parteizugehörigkeit zum Zeitpunkt der Rede:
                            ({{current_speech.foreign_speaker.party}})</li>
                        {% else %}
                        <li>Parteizugehörigkeit zum Zeitpunkt der Rede:
                            ({{current_speech.speaker_party_then}})</li>
                        {% endif %}
                        <li>Letzte offizielle eingetragene Parteizugehörigkeit: ({{current_speech.foreign_speaker.party}})</li>
                    </ul>
                    {% else %}
                    <span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können links unter 'Original String' gelesen werden."><i
                                class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span>
                    <hr class="blue-grey-text darken-4" />
                    {% endif %}
                    {% autoescape off %}
                    {{current_speech_html}}
                    {% endautoescape %}
                    {% if next_speech %}
                    <div class="center-align"><br /><a href="/protokolle/rede/{{next_speech.speech_id}}" class="waves-effect waves-light light-green darken-3 btn"><i class="material-icons left">arrow_downward</i>Zur Rede danach</a></div>
                    {% endif %}
                </div>
            </div>
            {% if next_speech.speech_content %}
            <ul class="collapsible hoverable white">
                <li>
                    <div class="collapsible-header"><i class="large material-icons blue-grey-text darken-4">insert_comment</i>Nächste Rede als Kontext</div>
                    <div class="collapsible-body">
                        <h5>{% if next_speech.foreign_speaker.id %}
                            Rede von {% if next_speech.foreign_speaker.title %}
                            {{next_speech.foreign_speaker.title}}
                            {% endif %}
                            {% if next_speech.foreign_speaker.nobility %}
                            {{next_speech.foreign_speaker.nobility}}
                            {% endif %}
                            {{next_speech.foreign_speaker.first_name}}
                            {% if next_speech.foreign_speaker.name_prefix %}
                            {{next_speech.foreign_speaker.name_prefix}}
                            {% endif %}
                            {{next_speech.foreign_speaker.last_name}}
                            {% else %}
                            <span class="card-title">Rede von: Unbekannt<a class="tooltipped" data-position="bottom" data-tooltip="Dieses Mitglied des Bundestags konnte leider nicht automatisch erkannt werden. Grundlegende Infos zu Namen etc. können beim zugehörigen Redeeintrag unter dem Punkt Original String gefunden werden."><i
                                        class="material-icons blue-grey-text darken-4" style="margin-right: 10px;">info_outline</i></a></span>
                            {% endif %}
                        </h5>
                        <hr class="blue-grey-text darken-4" />
                        <br />
                        <ul class="blue-grey-text darken-4">
                            {% if previous_speech.speaker_party_then == None %}
                            <li>Parteizugehörigkeit zum Zeitpunkt der Rede:
                                ({{next_speech.foreign_speaker.party}})</li>
                                {% else %}
                            <li>Parteizugehörigkeit zum Zeitpunkt der Rede:
                                    ({{next_speech.speaker_party_then}})</li>
                                    {% endif %}
                            <li>Letzte offizielle eingetragene Parteizugehörigkeit: ({{next_speech.foreign_speaker.party}})</li>
                        </ul>
                        <br />
                        <span><span>{% autoescape off %}{{next_speech_html}}{% endautoescape %}</span>
                    </div>
                </li>
            </ul>
            {% endif %}
        </div>
    </div>
</div>
{% endblock content %}
