Files
2026-07-06 20:02:44 +02:00

102 lines
4.2 KiB
HTML

{% extends 'base.html' %}
{% block title %}{% if client %}Modifier{% else %}Nouveau{% endif %} client{% endblock %}
{% block content %}
<div class="page-header">
<a href="{{ url_for('clients') }}" class="text-muted text-decoration-none small">
<i class="bi bi-arrow-left"></i> Clients
</a>
<h1 class="mt-1">{% if client %}Modifier {{ client.name }}{% else %}Nouveau client{% endif %}</h1>
</div>
<div class="row">
<div class="col-md-7">
<div class="card">
<div class="card-body">
<form method="POST">
<div class="mb-3">
<label class="form-label fw-semibold">Nom *</label>
<input type="text" name="name" class="form-control" required
value="{{ client.name if client else '' }}" placeholder="ex: Blockcorp">
</div>
<div class="mb-3">
<label class="form-label fw-semibold">Email</label>
<input type="email" name="email" class="form-control"
value="{{ client.email if client else '' }}">
</div>
<div class="mb-4">
<label class="form-label fw-semibold">Notes</label>
<textarea name="notes" class="form-control" rows="2">{{ client.notes if client else '' }}</textarea>
</div>
<hr>
<div class="mb-2">
<span class="fw-semibold"><i class="bi bi-bookmark-star me-1 text-secondary"></i>Profils par défaut</span>
<div class="form-text mb-3">Pré-sélectionnés automatiquement dans "Nouveau calcul" quand ce client est choisi.</div>
</div>
<div class="row g-3 mb-3">
<div class="col-md-6">
<label class="form-label">Profil machine</label>
<select name="default_machine_profile_id" class="form-select">
<option value="">— aucun —</option>
{% for p in machine_profiles %}
<option value="{{ p.id }}"
{% if client and client.default_machine_profile_id == p.id %}selected{% endif %}>
{{ p.name }}
</option>
{% endfor %}
</select>
</div>
<div class="col-md-6">
<label class="form-label">Profil manutention</label>
<select name="default_handling_profile_id" class="form-select">
<option value="">— aucun —</option>
{% for p in handling_profiles %}
<option value="{{ p.id }}"
{% if client and client.default_handling_profile_id == p.id %}selected{% endif %}>
{{ p.name }}
</option>
{% endfor %}
</select>
</div>
<div class="col-md-6">
<label class="form-label">Profil matière</label>
<select name="default_material_profile_id" class="form-select">
<option value="">— aucun —</option>
{% for p in material_profiles %}
<option value="{{ p.id }}"
{% if client and client.default_material_profile_id == p.id %}selected{% endif %}>
{{ p.name }}
</option>
{% endfor %}
</select>
</div>
<div class="col-md-6">
<label class="form-label">Profil tarif client</label>
<select name="default_pricing_profile_id" class="form-select">
<option value="">— aucun —</option>
{% for p in pricing_profiles %}
<option value="{{ p.id }}"
{% if client and client.default_pricing_profile_id == p.id %}selected{% endif %}>
{{ p.name }}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="d-flex gap-2 mt-4">
<button type="submit" class="btn" style="background:#ff6b35;color:#fff">
<i class="bi bi-save me-1"></i>Enregistrer
</button>
<a href="{{ url_for('clients') }}" class="btn btn-outline-secondary">Annuler</a>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}