{% extends "base.html" %}
{% block content %}
<h2>{% if contact %}Kontakt bearbeiten{% else %}Neuer Kontakt{% endif %} – {{ company.name }}</h2>
<form method="post">
    <label>Vorname *</label>
    <input type="text" name="first_name" value="{{ contact.first_name if contact else '' }}" required>
    <label>Nachname *</label>
    <input type="text" name="last_name" value="{{ contact.last_name if contact else '' }}" required>
    <label>Email</label>
    <input type="email" name="email" value="{{ contact.email if contact else '' }}">
    <label>Telefon</label>
    <input type="text" name="phone" value="{{ contact.phone if contact else '' }}">
    <label>Position</label>
    <input type="text" name="position" value="{{ contact.position if contact else '' }}">
    <label>Notizen</label>
    <textarea name="notes">{{ contact.notes if contact else '' }}</textarea>
    <button type="submit" class="btn btn-primary">Speichern</button>
    <a href="{{ url_for('contact_list', company_id=company.id) }}" class="btn btn-secondary">Abbrechen</a>
</form>
{% endblock %}
