init
This commit is contained in:
26
templates/form.html
Normal file
26
templates/form.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user