{% extends "base.html" %}

{% block title %}{{ stichwort.stichwort }} - Vorgaben Informatiksicherheit{% endblock %}

{% block content %}
<div class="container-fluid">
  <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="/">Startseite</a></li>
      <li class="breadcrumb-item"><a href="/stichworte">Stichworte</a></li>
      <li class="breadcrumb-item active" aria-current="page">{{ stichwort }}</li>
    </ol>
  </nav>

  <h1>{{ stichwort }}</h1>

  {% if stichwort.erklaerung %}
  <div class="row">
    <div class="col-md-12">
      <div class="card mb-4">
        <div class="card-header">
          <h2 class="h4 mb-0">Beschreibung</h2>
        </div>
        <div class="card-body">
          {% for typ, html in stichwort.erklaerung %}
          {% if html %}
          <div class="mb-2">{{ html|safe }}</div>
          {% endif %}
          {% endfor %}
        </div>
      </div>
    </div>
  </div>
  {% endif %}

  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header">
          <h2 class="h4 mb-0">Relevante Vorgaben</h2>
        </div>
        <div class="card-body">
          <table class="table table-striped table-hover">
            <thead>
              <tr>
                <th scope="col">Vorgabennummer</th>
                <th scope="col">Titel</th>
              </tr>
            </thead>
            <tbody>
              {% for vorgabe in stichwort.vorgaben %}
              {% if vorgabe.get_status == "active" %}
              <tr>
                <td>
                  <a href="{% url 'standard_detail' nummer=vorgabe.dokument.nummer %}#{{ vorgabe.Vorgabennummer }}">
                    {{ vorgabe.Vorgabennummer }}
                  </a>
                </td>
                <td>{{ vorgabe.titel }}</td>
              </tr>
              {% endif %}
              {% empty %}
              <tr>
                <td colspan="2" class="text-muted">Keine aktiven Vorgaben für dieses Stichwort vorhanden.</td>
              </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}