{% macro modal_dialog(id, title, submit='Submit', class="primary") -%}
{%- endmacro %} {# USAGE: #} {# button_confirm(label=_('Delete'), target="#delete-sshkey-modal", action="delete", key=key.fingerprint) #} {# modal_confirm(id='delete-sshkey-modal', title=_('Delete SSH key'), message=_("Are you sure?"), fields=['action', 'key'], submit=_('Delete')) #} {# Button to confirm deletion. #} {% macro button_confirm(label, target, class='btn-danger', disabled=False) -%} {%- endmacro %} {# modal dialog for confirmation #} {# confirm_field, define the data field to be validated. #} {% macro modal_confirm(id, title, message, fields, submit, confirm_field=None) -%} {% call modal_dialog(id, title, submit, class='danger') %} {% for f in fields %} {% endfor %}{{message}}
{% if confirm_field %}
{% trans %}This action can lead to data loss. To prevent accidental actions we ask you to confirm your intention.{% endtrans %}
{% trans %}Please type to proceed or close this modal to cancel.{% endtrans %}