{% set renderBackButton = flow.getFirstStepNumber() < flow.getLastStepNumber() and flow.getCurrentStepNumber() in (flow.getFirstStepNumber() + 1) .. flow.getLastStepNumber() %}
{#
Default button (the one trigged by pressing the enter/return key) must be defined first.
Thus, all buttons are defined in reverse order and will be reversed again via CSS.
See http://stackoverflow.com/questions/1963245/multiple-submit-buttons-specifying-default-button
#}
{%- set isLastStep = flow.getCurrentStepNumber() == flow.getLastStepNumber() -%}
{%- set craue_formflow_button_class_last = craue_formflow_button_class_last | default('craue_formflow_button_last') -%}
{%- set craue_formflow_button_class_last = isLastStep
? craue_formflow_button_class_finish | default(craue_formflow_button_class_last)
: craue_formflow_button_class_next | default(craue_formflow_button_class_last)
-%}
{% if renderBackButton %}
{% endif %}