{% extends "base.html" %}

{% block title %}Logs – {{ date }}. {{ today[:4] }}-{{ today[5:] }}{% endblock %}

{% block content %}
<div class="container my-5">

  <h1>Logs – {{ date }}. {{ today }}</h1>

  <div class="mb-4">
    <label for="date-select" class="form-label">Tag auswählen:</label>
    <select id="date-select" class="form-select w-auto d-inline-block" onchange="window.location.href='/admin/logs/' + this.value">
      {% for d in dates %}
        <option value="{{ d }}" {% if d == date %}selected{% endif %}>{{ d }}.</option>
      {% endfor %}
    </select>
  </div>
<!-- -->
  <pre class="bg-dark text-light p-4 rounded hljs" style="max-height: 70vh; overflow-y: auto; font-size: 0.95rem; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5;">
    <code class="language-flasklog">
      {{ logs | safe }}
    </code>
  </pre>

<!-- Zeilennummern + Wort-Wrap 
<pre class="bg-dark text-light p-4 rounded hljs" style="max-height: 70vh; overflow-y: auto; font-size: 0.95rem; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5;">
  <code class="language-bash">
{{ logs | safe }}
  </code>
</pre>
-->

  <a href="{{ url_for('admin') }}" class="btn btn-secondary mt-3">Zurück zum Admin</a>
</div>
{% endblock %}