{% macro action_base(action, row_id, row, view, current_form, confirm=false, params=none) %}
{{ current_form.id(value=get_pk_value(row)) }} {{ current_form.url(value=return_url) }} {% if current_form.csrf_token %} {{ current_form.csrf_token }} {% elif csrf_token %} {% endif %} {% if params %} {% for k,v in params.items() %} {% endfor %} {% endif %} {% if confirm %} {% set confirm_part = "safeConfirm('" + _gettext(confirm) + "') && " %} {% else %} {% set confirm_part = "" %} {% endif %} {% set onclick = "return " + confirm_part + "Subview.postForm(this);" %}
{% endmacro %} {% macro delete_row(action, row_id, row) %} {% call action_base(action, row_id, row, ".delete_view", delete_form, "Are you sure you want to delete this record?") %} {% endcall %} {% endmacro %}