Files
vermietungs-tool/app/templates/client_form.html
T
BlackMarkandClaude Opus 5.5 45424e6fd6 Vermietungs-Tool
A local web app for a small room-rental business in Austria: guest register,
room ledger, occupancy plan, invoices, the monthly tourist-tax report and the
quarterly VAT list. Application code only; it ships no data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:52:27 +01:00

127 lines
7.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block content %}
<h1>{{ t('form_edit_client') }} – {{ comp.name }}</h1>
<form class="card" method="post" style="max-width:900px">
<div class="grid2">
<div class="field"><label>{{ t('col_name') }} *</label>
<input type="text" name="name" value="{{ comp.name }}" required></div>
<div class="field"><label>{{ t('col_kind') }}</label>
<select name="kind">
<option value="company" {{ 'selected' if comp.kind != 'private' }}>{{ t('kind_company') }}</option>
<option value="private" {{ 'selected' if comp.kind == 'private' }}>{{ t('kind_private') }}</option>
</select></div>
</div>
<div class="grid2">
<div class="field"><label>{{ t('col_uid') }}</label>
<input type="text" name="uid" value="{{ comp.uid or '' }}"></div>
<div class="field"><label>{{ t('col_email') }}</label>
<input type="text" name="email" value="{{ comp.email or '' }}"></div>
</div>
<div class="grid2">
<div class="field"><label>{{ t('col_phone') }}</label>
<input type="text" name="phone" value="{{ comp.phone or '' }}"></div>
<div class="field"><label>{{ t('col_notes') }}</label>
<input type="text" name="notes" value="{{ comp.notes or '' }}"></div>
</div>
{% if comp.aliases %}
<div class="field"><label>{{ t('lbl_known_spellings') }}</label>
<div style="color:#6b756e; font-size:13px">{{ comp.aliases|join(' · ') }}</div></div>
{% endif %}
<div class="formactions">
<button class="btn" type="submit">{{ t('btn_save') }}</button>
<a class="btn secondary" href="{{ url_for('clients') }}">{{ t('btn_cancel') }}</a>
</div>
</form>
<div class="card" style="max-width:900px; margin:16px auto 0">
<h3 style="margin:0 0 8px">{{ t('lbl_addresses') }}</h3>
<div class="tablewrap" style="max-height:none">
<table>
<thead><tr><th>{{ t('lbl_address_current') }}</th><th>{{ t('col_name') }}</th><th>{{ t('col_address') }}</th><th>{{ t('col_postcode') }}</th>
<th>{{ t('col_city') }}</th><th></th></tr></thead>
<tbody>
{% for v in comp.versions %}
<tr>
<td style="text-align:center">{% if v.id == comp.current_client_id %}<span style="color:var(--accent); font-weight:700" title="{{ t('lbl_current_address_short') }}">✓</span>{% endif %}</td>
<td>{{ v.name }}</td><td>{{ v.address or '' }}</td><td>{{ v.postcode or '' }}</td><td>{{ v.city or '' }}</td>
<td style="white-space:nowrap; text-align:right">
<button type="button" class="btn secondary small" onclick="document.getElementById('addr-{{ v.id }}').showModal()">{{ t('btn_edit') }}</button>
<form method="post" style="display:inline" onsubmit="return confirm('{{ t('confirm_delete_address') }}')">
<input type="hidden" name="client_id" value="{{ v.id }}">
<button class="btn danger small" name="action" value="delete_address"
title="{{ v.stays }} {{ t('home_stays') }} · {{ v.invoices }} {{ t('nav_invoices') }}"
{{ 'disabled' if (v.stays + v.invoices) or comp.versions|length < 2 }}>{{ t('btn_delete') }}</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% for v in comp.versions %}
<dialog id="addr-{{ v.id }}" style="border:1px solid var(--line); border-radius:12px; padding:22px; max-width:520px; width:92%">
<form method="post">
<input type="hidden" name="client_id" value="{{ v.id }}">
<h3 style="margin:0 0 14px">{{ t('lbl_edit_address') }}</h3>
<div class="field"><label>{{ t('col_name') }}</label><input type="text" name="name" value="{{ v.name }}"></div>
<div class="field"><label>{{ t('col_address') }}</label><input type="text" name="address" value="{{ v.address or '' }}"></div>
<div class="grid2">
<div class="field"><label>{{ t('col_postcode') }}</label><input type="text" name="postcode" value="{{ v.postcode or '' }}"></div>
<div class="field"><label>{{ t('col_city') }}</label><input type="text" name="city" value="{{ v.city or '' }}"></div>
</div>
<div class="formactions" style="margin-top:16px; flex-wrap:wrap">
<button class="btn" type="submit" name="action" value="edit_address">{{ t('btn_save') }}</button>
{% if v.id != comp.current_client_id %}
<button class="btn secondary" type="submit" name="action" value="make_current">{{ t('btn_make_current') }}</button>
{% endif %}
<button class="btn secondary" type="button" onclick="this.closest('dialog').close()">{{ t('btn_cancel') }}</button>
</div>
</form>
</dialog>
{% endfor %}
<form class="card" method="post" style="max-width:900px; margin-top:16px">
<input type="hidden" name="action" value="add_address">
<h3 style="margin:0 0 8px">{{ t('lbl_new_address') }}</h3>
<div class="field"><label>{{ t('col_address') }}</label><input type="text" name="address"></div>
<div class="grid2">
<div class="field"><label>{{ t('col_postcode') }}</label><input type="text" name="postcode"></div>
<div class="field"><label>{{ t('col_city') }}</label><input type="text" name="city"></div>
</div>
<div class="field"><label><input type="checkbox" name="make_current" checked> {{ t('lbl_use_from_now') }}</label></div>
<div class="formactions"><button class="btn secondary" type="submit">{{ t('btn_add_address') }}</button></div>
</form>
<form class="card" method="post" style="max-width:900px; margin-top:16px"
onsubmit="return confirm('{{ t('confirm_merge') }}')">
<input type="hidden" name="action" value="merge">
<h3 style="margin:0 0 8px">{{ t('lbl_merge') }}</h3>
<p style="color:#6b756e; font-size:13px; margin:0 0 10px">{{ t('merge_hint') }}</p>
<div class="field"><label>{{ t('lbl_merge_into') }}</label>
<select name="merge_into">
<option value="">—</option>
{% for o in others %}<option value="{{ o.id }}">{{ o.name }}</option>{% endfor %}
</select></div>
<div class="formactions"><button class="btn danger" type="submit">{{ t('btn_merge') }}</button></div>
</form>
{% set refs = (comp.versions|sum(attribute='stays')) + (comp.versions|sum(attribute='invoices')) %}
<form class="card" method="post" style="max-width:900px; margin-top:16px"
action="{{ url_for('client_delete', company_id=comp.id) }}"
onsubmit="return confirm('{{ t('confirm_delete_company') }}')">
<h3 style="margin:0 0 8px">{{ t('lbl_delete_company') }}</h3>
<p style="color:#6b756e; font-size:13px; margin:0 0 10px">{{ t('delete_company_hint') }}</p>
<div class="formactions">
<button class="btn danger" type="submit" {{ 'disabled' if refs }}>{{ t('btn_delete_company') }}</button>
{% if refs %}<span style="color:#6b756e; font-size:13px">
{{ comp.versions|sum(attribute='stays') }} {{ t('home_stays') }} ·
{{ comp.versions|sum(attribute='invoices') }} {{ t('nav_invoices') }}</span>{% endif %}
</div>
</form>
{% endblock %}