{% extends "base.html" %}

{% block title %}{{ title }}{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="d-flex justify-content-between align-items-center mb-4">
                <h1><i class="fas fa-calendar-alt me-2"></i>{{ title }}</h1>
                <a href="{% url 'stiftung:kalender_create' %}" class="btn btn-primary">
                    <i class="fas fa-plus me-1"></i>Neuer Eintrag
                </a>
            </div>
        </div>
    </div>
    
    <div class="row">
        <div class="col-12">
            <div class="card shadow">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0">{{ current_month }}</h5>
                </div>
                <div class="card-body">
                    {% if events %}
                        <div class="list-group">
                            {% for event in events %}
                            <div class="list-group-item">
                                <div class="d-flex w-100 justify-content-between">
                                    <div>
                                        <i class="{{ event.icon }} me-2 text-{{ event.color }}"></i>
                                        <strong>{{ event.title }}</strong>
                                        {% if event.description %}
                                        <p class="mb-1 text-muted">{{ event.description }}</p>
                                        {% endif %}
                                    </div>
                                    <small class="text-{{ event.color }}">
                                        {{ event.date }}
                                        {% if event.time %} {{ event.time }}{% endif %}
                                    </small>
                                </div>
                            </div>
                            {% endfor %}
                        </div>
                    {% else %}
                        <div class="text-center py-5">
                            <i class="fas fa-calendar-times fa-3x text-muted mb-3"></i>
                            <h5 class="text-muted">Keine Termine im aktuellen Monat</h5>
                            <p class="text-muted">Erstellen Sie Ihren ersten Kalendereintrag.</p>
                            <a href="{% url 'stiftung:kalender_create' %}" class="btn btn-primary">
                                <i class="fas fa-plus me-1"></i>Termin hinzufügen
                            </a>
                        </div>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}