74 lines
3.2 KiB
HTML
74 lines
3.2 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}{% if profile %}Modifier{% else %}Nouveau{% endif %} profil tarif{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<a href="{{ url_for('profiles') }}#pricing" class="text-muted text-decoration-none small">
|
|
<i class="bi bi-arrow-left"></i> Templates
|
|
</a>
|
|
<h1 class="mt-1">
|
|
<i class="bi bi-tags me-2" style="color:#ff6b35"></i>
|
|
{% if profile %}Modifier{% else %}Nouveau{% endif %} profil tarif client
|
|
</h1>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-lg-5">
|
|
<form method="POST">
|
|
<div class="card mb-3">
|
|
<div class="card-header py-3">Parametres</div>
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<label class="form-label fw-semibold">Nom du profil</label>
|
|
<input type="text" name="name" class="form-control" required
|
|
value="{{ profile.name if profile else '' }}"
|
|
placeholder="ex: Client STL, Client standard, Client VIP...">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label fw-semibold">Coefficient design</label>
|
|
<div class="d-flex gap-2 mb-2">
|
|
<button type="button" class="btn btn-sm btn-outline-success" onclick="setDM(0.80)">STL fourni (x0.80)</button>
|
|
<button type="button" class="btn btn-sm btn-outline-primary" onclick="setDM(1.80)">Creation complete (x1.80)</button>
|
|
</div>
|
|
<input type="number" name="design_multiplier" id="design_multiplier" class="form-control" step="0.05" min="0" required
|
|
value="{{ profile.design_multiplier if profile else 1.80 }}">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label fw-semibold d-flex justify-content-between">
|
|
Marge brute <span id="marginDisplay" class="text-muted">
|
|
{{ profile.gross_margin_pct if profile else 27.5 }} %
|
|
</span>
|
|
</label>
|
|
<input type="range" name="gross_margin_pct" id="gross_margin_pct" class="form-range"
|
|
min="20" max="35" step="0.5"
|
|
value="{{ profile.gross_margin_pct if profile else 27.5 }}">
|
|
<div class="d-flex justify-content-between" style="font-size:.75rem;color:#6b7280"><span>20%</span><span>35%</span></div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label fw-semibold">Notes</label>
|
|
<textarea name="notes" class="form-control" rows="2">{{ profile.notes if profile else '' }}</textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="d-flex gap-2">
|
|
<button type="submit" class="btn px-4 fw-bold" style="background:#ff6b35;color:#fff">
|
|
<i class="bi bi-save me-1"></i>Enregistrer
|
|
</button>
|
|
<a href="{{ url_for('profiles') }}#pricing" class="btn btn-outline-secondary">Annuler</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
function setDM(val) {
|
|
document.getElementById('design_multiplier').value = val;
|
|
}
|
|
document.getElementById('gross_margin_pct').addEventListener('input', function() {
|
|
document.getElementById('marginDisplay').textContent = this.value + ' %';
|
|
});
|
|
</script>
|
|
{% endblock %}
|