title: 'Donate Widget'
tabs:
  main:
    display: Main
    sections:
      -
        fields:
          -
            handle: title
            field:
              type: text
              required: true
              display: Title
              localizable: false
              validate:
                - required
              instructions: 'The title used to name the donate widget in the control panel. This will not be displayed anywhere on the front-end.'
              width: 50
          -
            handle: include_monthly_amounts
            field:
              default: true
              type: toggle
              display: 'Include monthly amounts'
              localizable: false
              width: 50
          -
            handle: donate_link
            field:
              input_type: url
              type: text
              display: 'Donate link'
              instructions: 'Ensure the Campaign ID URL parameter is included in the link.'
              localizable: false
              validate:
                - required
          -
            handle: heading
            field:
              type: text
              display: Heading
              localizable: false
              validate:
                - required
          -
            handle: description
            field:
              type: textarea
              display: Description
              localizable: false
          -
            handle: image
            field:
              max_files: 1
              min_files: 1
              container: assets
              folder: /
              type: assets
              display: Image
              localizable: false
              validate:
                - sometimes
                - required
          -
            handle: caption
            field:
              type: toggle
              display: 'Image caption'
              localizable: false
              width: 25
          -
            handle: caption_text
            field:
              type: text
              display: 'Image caption text'
              localizable: false
              width: 75
              validate:
                - required
                - sometimes
              if:
                caption: 'equals true'
      -
        display: 'One-off amounts'
        fields:
          -
            handle: once_amount_1
            field:
              type: float
              display: 'Amount 1'
              localizable: false
              width: 25
              validate:
                - required
                - 'gt:0'
          -
            handle: once_amount_1_description
            field:
              type: textarea
              display: 'Amount 1 description'
              localizable: false
              width: 75
              character_limit: '200'
          -
            handle: once_amount_2
            field:
              type: float
              display: 'Amount 2'
              localizable: false
              width: 25
              validate:
                - required
                - 'gt:0'
          -
            handle: once_amount_2_description
            field:
              type: textarea
              display: 'Amount 2 description'
              localizable: false
              width: 75
              character_limit: '200'
          -
            handle: once_amount_3
            field:
              type: float
              display: 'Amount 3'
              localizable: false
              width: 25
              validate:
                - required
                - 'gt:0'
          -
            handle: once_amount_3_description
            field:
              type: textarea
              display: 'Amount 3 description'
              localizable: false
              width: 75
              character_limit: '200'
      -
        display: 'Monthly amounts'
        fields:
          -
            handle: monthly_amount_1
            field:
              type: float
              display: 'Amount 1'
              localizable: false
              width: 25
              validate:
                - sometimes
                - required
                - 'gt:0'
              if:
                include_monthly_amounts: 'equals true'
          -
            handle: monthly_amount_1_description
            field:
              type: textarea
              display: 'Amount 1 description'
              localizable: false
              width: 75
              character_limit: '200'
              if:
                include_monthly_amounts: 'equals true'
          -
            handle: monthly_amount_2
            field:
              type: float
              display: 'Amount 2'
              localizable: false
              width: 25
              validate:
                - sometimes
                - required
                - 'gt:0'
              if:
                include_monthly_amounts: 'equals true'
          -
            handle: monthly_amount_2_description
            field:
              type: textarea
              display: 'Amount 2 description'
              localizable: false
              width: 75
              character_limit: '200'
              if:
                include_monthly_amounts: 'equals true'
          -
            handle: monthly_amount_3
            field:
              type: float
              display: 'Amount 3'
              localizable: false
              width: 25
              validate:
                - sometimes
                - required
                - 'gt:0'
              if:
                include_monthly_amounts: 'equals true'
          -
            handle: monthly_amount_3_description
            field:
              type: textarea
              display: 'Amount 3 description'
              localizable: false
              width: 75
              character_limit: '200'
              if:
                include_monthly_amounts: 'equals true'
