---
# indicator is the field that is used to test for form submission
indicator: submit

filters:
    - HTMLScrubber
    - TrimEdges

# Start listing the form elements
elements:
    - type: Text
      name: name
      label_loc: label_name
      # This is an optional 'mouse over' title pop-up
      attributes:
        title: Enter the name of the bar
      constraints:
        - Printable
        - SingleValue

    - type: Text
      name: zip
      label_loc: label_zip
      constraints:
        - Printable
        - SingleValue
      filters:
        - Whitespace

    # Add a drop-down list for the city selection.  Note that we will
    # dynamically fill in all the citys from the controller but we
    # could manually set items in the drop-list by adding this YAML code:
    # options:
    #   - [ '1', 'Bastien' ]
    #   - [ '2', 'Nasseh'  ]
    - type: Select
      name: city
      empty_first: true
      empty_first_label_loc: label_empty
      label_loc: label_city
      constraints:
        - Integer
        - SingleValue

    - type: Checkboxgroup
      name: status
      label_loc: label_status
      options:
        #- [ 'non-smoking', 'non-smoking' ]
        #- [ 'mixed', 'mixed' ]
        #- [ 'smoking', 'smoking' ]
        - value: 'non-smoking'
          label_loc: label_nonsmoking
        - value: 'mixed'
          label_loc: label_mixed
        - value: 'smoking'
          label_loc: label_smoking
      constraints:
        - AutoSet

    # The submit button
    - type: Submit
      name: submit
      value_loc: value_submit
