{% extends "base.html" %}

{% block content %}
<div class="content-card">
    <h1>
        {% if mode == "edit" %}
            Ansprechpartner bearbeiten
        {% else %}
            Neuen Ansprechpartner erstellen
        {% endif %}
    </h1>

    <form method="post" class="admin-form">
        <div class="form-group">
            <label for="name">Name</label>
            <input type="text" id="name" name="name" value="{{ contact.name or '' }}" required>
        </div>

        <div class="form-group">
            <label for="email">E-Mail</label>
            <input type="email" id="email" name="email" value="{{ contact.email or '' }}" required>
        </div>

        <div class="form-group">
            <label for="infotext">InfoText</label>
            <textarea id="infotext" name="infotext" rows="6">{{ contact.infotext or '' }}</textarea>
        </div>

        <div class="form-actions">
            <button type="submit" class="btn">Speichern</button>
            <a class="btn btn-secondary" href="{{ url_for('admin_contacts') }}">Abbrechen</a>
        </div>
    </form>
</div>
{% endblock %}