v0.0.6: massa-acties en CSV-export in de lijsten van contacten, relaties, producten en offertes
Rijen aanvinken (shift-klik voor een reeks, of alles op de pagina) en in de balk onderin een actie kiezen (templates/_bulk.html, static/bulk.js). Contacten: status wijzigen, toewijzen, omzetten naar klant, exporteren, verwijderen; relaties: type wijzigen, exporteren, verwijderen; producten: actief/inactief, exporteren, verwijderen (in offertes gebruikt → inactief); offertes: status wijzigen (met de gevolgen voor het contact), exporteren, verwijderen. Exporteer CSV neemt de filters van de lijst mee en levert alle velden; bij contacten ook labels, toegewezen gebruiker, relatie, model, portaaltoegang en de extra formuliervelden als eigen kolom. Nieuwe leadstatus Vervallen (telt als afgesloten). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3cf53bc248
commit
db3e26d258
@@ -0,0 +1,22 @@
|
||||
{# Massa-acties in lijsten: een vinkje per rij (form="bulk") en een balk onderin met de actie (static/bulk.js).
|
||||
Importeren met: {% from '_bulk.html' import bulk_head, bulk_cell, bulk_bar with context %} #}
|
||||
{% macro bulk_head() %}<th class="bulk-col"><input class="form-check-input" type="checkbox" data-bulk-all aria-label="Alles op deze pagina selecteren"></th>{% endmacro %}
|
||||
|
||||
{% macro bulk_cell(id, label) %}<td class="bulk-col"><input class="form-check-input" type="checkbox" name="ids" value="{{ id }}" form="bulk" aria-label="Selecteer {{ label }}"></td>{% endmacro %}
|
||||
|
||||
{# actions: lijst van (waarde, label) of (waarde, label, bevestigingsvraag met {n}); velden met data-show="<waarde>"
|
||||
in de caller verschijnen alleen bij die actie #}
|
||||
{% macro bulk_bar(action_url, actions) %}
|
||||
<form id="bulk" class="bulk-bar" method="post" action="{{ action_url }}" hidden>
|
||||
<input type="hidden" name="next" value="{{ request.full_path }}">
|
||||
<span class="bulk-count"><strong data-bulk-count>0</strong> geselecteerd</span>
|
||||
<select class="form-select form-select-sm" name="action" aria-label="Actie" required>
|
||||
<option value="">Kies een actie…</option>
|
||||
{% for a in actions %}<option value="{{ a[0] }}"{% if a|length > 2 %} data-confirm="{{ a[2] }}"{% endif %}>{{ a[1] }}</option>{% endfor %}
|
||||
</select>
|
||||
{{ caller() if caller }}
|
||||
<button class="btn btn-primary btn-sm">Toepassen</button>
|
||||
<button class="btn btn-outline-secondary btn-sm" type="button" data-bulk-clear>Wissen</button>
|
||||
</form>
|
||||
<script src="{{ url_for('static', filename='bulk.js') }}" defer></script>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user