{# LIBRARIES #}
{% extends "@templates/tm-layout/page/page.twig" %}

{# VARIABLES #}
{% set front = false %}
{% set full_width = false %}
{% set no_sidebars = false %}
{% set floating_title = false %}

{# REGIONS #}
{% set page_offcanvas = pattern_preview('region_offcanvas') %}
{% set page_header = pattern_preview('region_header') %}
{% set page_sidebar_right = pattern_preview('region_sidebar_right') %}
{% set page_footer_top = pattern_preview('region_footer_top') %}
{% set page_footer_bottom = pattern_preview('region_footer_bottom') %}
{% set page_footer_final = pattern_preview('region_footer_final') %}
{% set page_modal = pattern_preview('region_modal') %}

{% set page_highlighted = "<h1>Page no banner</h1>" %}

{% set page_content %}

  {% set data = [
    {
      "t": "[data-name='DESTINATION_STATION']",
      "s": "value",
      "v": "NOR",
      "e": "click"
    },
    {
      "t": "[data-name='ORIGIN_STATION']",
      "s": "value",
      "v": "LDN",
      "e": "focus"
    }
  ] %}

  {% set button_attrs = create_attribute()
    .setAttribute('id', 'my-id')
    .setAttribute('data-alt-toggle', 'formsetsubmit')
    .setAttribute('data-alt-target-data', data|json_encode()|escape)
    .setAttribute('data-alt-target-submit','')
  %}

  <h2>This button uses form-set-submit data attribute</h2>

  <button class="form-clicker btn btn-primary" {{ button_attrs }}>Norwich to London</button>

{% endset %}
