{% from 'forms/_form.html' import form_header, form_footer, form_rows %}
{% from 'events/registration/management/_sortable_list.html' import sortable_lists %}

{{ form_header(form, id="js-registration-form-columns") }}
{{ form_rows(form) }}

<div id="participant-list-form-columns">
    {{ sortable_lists(_("Shown columns"), enabled_columns,
                      _("Hidden columns"), disabled_columns,
                      classes="i-box titled sortable-column-preview") }}
</div>
<button class="i-button big highlight" type="submit">{% trans %}Save{% endtrans %}</button>

{{ form_footer(form) }}

<script>
    (function () {
        'use strict';

        setupRegistrationSortableLists($('#participant-list-form-columns .js-sortable-list-widget'));

        function updateHiddenField() {
            var data = {'columns': []};
            var $form = $('#js-registration-form-columns');
            $form.find('ul.enabled li').each(function() {
                data.columns.push($(this).data('item-id'));
            });
            $form.find('#json').val(JSON.stringify(data));
        };

        $('#js-registration-form-columns').on('submit', function() {
            updateHiddenField();
        });
    })();
</script>

{% from 'forms/_form.html' import form_header, form_footer, form_rows %}
{% from 'events/registration/management/_sortable_list.html' import sortable_lists %}

{{ form_header(form, id="js-registration-form-columns") }}
{{ form_rows(form) }}

<div id="participant-list-form-columns">
    {{ sortable_lists(_("Shown columns"), enabled_columns,
                      _("Hidden columns"), disabled_columns,
                      classes="i-box titled sortable-column-preview") }}
</div>
<button class="i-button big highlight" type="submit">{% trans %}Save{% endtrans %}</button>
<button class="i-button big" data-button-back>{% trans %}Cancel{% endtrans %}</button>

{{ form_footer(form) }}

<script>
    (function () {
        'use strict';

        setupRegistrationSortableLists($('#participant-list-form-columns .js-sortable-list-widget'));

        function updateHiddenField() {
            var data = {'columns': []};
            var $form = $('#js-registration-form-columns');
            $form.find('ul.enabled li').each(function() {
                data.columns.push($(this).data('item-id'));
            });
            $form.find('#json').val(JSON.stringify(data));
        };

        $('#js-registration-form-columns').on('submit', function() {
            updateHiddenField();
        });
    })();
</script>

Add cancel button to form dialog
Add cancel button to form dialog
