Files
notifications-admin/app/templates/components/form.html
2024-12-18 12:40:45 -08:00

26 lines
613 B
HTML

{% macro form_wrapper(
method="post",
action=None,
autocomplete=False,
class=None,
id=None,
module=None,
data_kwargs={}
) %}
<form
method="{{ method }}"
{% if action %}action="{{ action }}"{% endif %}
{% if not autocomplete %}autocomplete="off"{% endif %}
{% if class %}class="{{ class }}"{% endif %}
{% if id %}id="{{ id }}"{% endif %}
{% if module %}data-module="{{ module }}"{% endif %}
{% for key, val in data_kwargs.items() %}
{% if val %}
data-{{ key }}="{{ val }}"
{% endif %}
{% endfor %}
>
{{ caller() }}
</form>
{% endmacro %}