app/templates/partials/toggle_contact.html

15 lines
No EOL
429 B
HTML

<button
class="ml-2 btn btn-sm {% if contact.block_forward %} btn-outline-success {% else %} btn-outline-warning {% endif %}"
hx-post="{{ url_for('dashboard.toggle_contact', contact_id=contact.id) }}" hx-swap="outerHTML">
{% if contact.block_forward %}
Unblock sender
{% else %}
Block sender
{% endif %}
</button>
{% if toast_msg %}
<script>
toastr.success("{{ toast_msg }}");
</script>
{% endif %}