{% extends "exoral/base.html" %}

{% load static %}

{% block content %}
<div class="container">
  <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item" aria-current="page"><a href="{% url 'exoral:home' %}">Start</a></li>
      <li class="breadcrumb-item" aria-current="page"><a href="{% url 'exoral:dozent-list' %}">Dozenten</a></li>
      <li class="breadcrumb-item active" aria-current="page">{{ dozent }}</li>
      {% if perms.exoral.change_dozent %}
      <li class="breadcrumb-item" aria-current="page"><a href="{% url 'exoral:dozent-edit' dozent.id %}">bearbeiten</a></li>
      {% endif %}
    </ol>
  </nav>

  <table class="table">
    <tbody>
      <tr>
        <th>Titel</th>
        <td>{{ dozent.titel }}</td>
      </tr>
      <tr>
        <th>Name</th>
        <td>{{ dozent.name }}</td>
      </tr>
      <tr>
        <th>Fach</th>
        <td>{{ dozent.fach }}</td>
      </tr>
      <tr>
        <th>aktiv?</th>
        <td>{% if dozent.aktiv %}✓{% else %}✗{% endif %}</td>
      </tr>
    </tbody>
  </table>

  <table class="table table-striped">
    <thead>
      <tr>
        <th>Datum</th>
        <th>Frage</th>
        <th><img src="{% static "img/icons/plus-square.svg" %}"></th>
        <th>Fach</th>
      </tr>
    </thead>
    <tbody>
      {% for frage in dozent.frage_set.all %}
      <tr>
        <td>{{ frage.datum }}</td>
        <td style="white-space: pre-line;">{{ frage.text }}
          {% if perms.exoral.change_frage %}<a href="{% url 'exoral:frage-edit' frage.id %}">bearbeiten</a>{% endif %}
        </td>
        <td>{{ frage.punkte }}</td>
        <td>{{ frage.testat }}</td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
{% endblock content %}
