40 lines
3.1 KiB
HTML
40 lines
3.1 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}{{ r.name or ('Nieuwe ' ~ RKIND.get(r.kind, 'relatie')|lower) }}{% endblock %}
|
|
{% block content %}
|
|
<div class="head">
|
|
<div>
|
|
<a class="label" href="{{ url_for('relation_view', rid=r.id) if r.id else url_for('relations', kind=r.kind) }}">← Terug</a>
|
|
<h1>{{ 'Relatie bewerken' if r.id else ('Nieuwe ' ~ RKIND.get(r.kind, 'relatie')|lower) }}</h1>
|
|
</div>
|
|
</div>
|
|
<form method="post" class="card"><div class="card-body">
|
|
<div class="row g-3">
|
|
<div class="col-12"><label class="form-label" for="name">Naam *</label><input class="form-control" id="name" name="name" value="{{ r.name }}" required placeholder="{{ 'Bijv. Familie Jansen' if r.kind == 'klant' else 'Bijv. Houthandel De Vries' }}"></div>
|
|
<div class="col-md-6"><label class="form-label" for="kind">Soort</label>
|
|
<select class="form-select" id="kind" name="kind">{% for k, l in RELATION_KINDS %}<option value="{{ k }}" {{ 'selected' if r.kind == k }}>{{ l }}</option>{% endfor %}</select>
|
|
</div>
|
|
<div class="col-md-6"><label class="form-label" for="type">Type</label>
|
|
<input class="form-control" id="type" name="type" value="{{ r.type }}" list="types" autocomplete="off">
|
|
<datalist id="types">{% for t in types %}<option value="{{ t }}">{% endfor %}</datalist>
|
|
</div>
|
|
<div class="col-md-6"><label class="form-label" for="email">E-mail</label><input class="form-control" id="email" type="email" name="email" value="{{ r.email }}"></div>
|
|
<div class="col-md-6"><label class="form-label" for="phone">Telefoon</label><input class="form-control" id="phone" type="tel" name="phone" value="{{ r.phone }}"></div>
|
|
<div class="col-12"><label class="form-label" for="address">Adres</label><input class="form-control" id="address" name="address" value="{{ r.address }}"></div>
|
|
<div class="col-sm-4"><label class="form-label" for="postcode">Postcode</label><input class="form-control" id="postcode" name="postcode" value="{{ r.postcode }}"></div>
|
|
<div class="col-sm-8"><label class="form-label" for="city">Plaats</label><input class="form-control" id="city" name="city" value="{{ r.city }}"></div>
|
|
<div class="col-md-6"><label class="form-label" for="website">Website</label><input class="form-control" id="website" name="website" value="{{ r.website }}"></div>
|
|
<div class="col-md-6"><label class="form-label" for="kvk">KvK-nummer</label><input class="form-control" id="kvk" name="kvk" value="{{ r.kvk }}"></div>
|
|
<div class="col-12"><label class="form-label" for="notes">Notities</label><textarea class="form-control" id="notes" name="notes">{{ r.notes }}</textarea></div>
|
|
</div>
|
|
<div class="actions">
|
|
<button class="btn btn-primary">Opslaan</button>
|
|
<a class="btn btn-outline-secondary" href="{{ url_for('relation_view', rid=r.id) if r.id else url_for('relations', kind=r.kind) }}">Annuleren</a>
|
|
</div>
|
|
</div></form>
|
|
{% if r.id %}
|
|
<form method="post" action="{{ url_for('relation_delete', rid=r.id) }}" onsubmit="return confirm('Relatie verwijderen? Contactpersonen en producten blijven bestaan.')">
|
|
<button class="btn btn-outline-secondary btn-sm">Relatie verwijderen</button>
|
|
</form>
|
|
{% endif %}
|
|
{% endblock %}
|