This commit is contained in:
2025-11-27 16:25:46 +01:00
commit 66eab0aeb5
10 changed files with 510 additions and 0 deletions

26
templates/form.html Normal file
View File

@@ -0,0 +1,26 @@
{% extends 'base.html' %}
{% block title %}{{ 'Edycja' if contact and (contact.id if contact is not mapping else contact.get('id')) else 'Nowy' }} kontakt{% endblock %}
{% block content %}
{% set cid = (contact.id if contact and contact is not mapping else (contact.get('id') if contact else None)) %}
<form method="post" action="{{ url_for('update' if cid else 'create') }}">
{% if cid %}
<input type="hidden" name="id" value="{{ cid }}">
{% endif %}
<div class="row">
<label>Imię i nazwisko</label>
<input type="text" name="name" value="{{ (contact.name if contact and contact is not mapping else (contact['name'] if contact else ''))|e }}" required>
</div>
<div class="row">
<label>Email</label>
<input type="email" name="email" value="{{ (contact.email if contact and contact is not mapping else (contact['email'] if contact else ''))|e }}">
</div>
<div class="row">
<label>Telefon</label>
<input type="text" name="phone" value="{{ (contact.phone if contact and contact is not mapping else (contact['phone'] if contact else ''))|e }}">
</div>
<p>
<button class="btn primary" type="submit">Zapisz</button>
<a class="btn" href="{{ url_for('index') }}">Anuluj</a>
</p>
</form>
{% endblock %}