Skip to content

Instantly share code, notes, and snippets.

@andresgallo
Created September 3, 2025 14:43
Show Gist options
  • Select an option

  • Save andresgallo/b09078fb8b8f765cf8fc07d23f225a35 to your computer and use it in GitHub Desktop.

Select an option

Save andresgallo/b09078fb8b8f765cf8fc07d23f225a35 to your computer and use it in GitHub Desktop.
<div class="Form-wrapper" data-module {{#if inverseColors}} data-inverse-colors{{/if}}{{#or backgroundColor backgroundImage}} data-has-background {{/or}}{{#if backgroundImage}} data-has-bg-image{{/if}} style="--color-form-background: {{#with backgroundColor}}{{this}}{{else}}#C4EDEB{{/with}};{{#each backgroundImage}}{{#resize image "xl-4x3"}} background-image: url('{{src}}');{{/resize}} {{/each}}{{~#with formErrorMessagesColor}} --color-error-messages: {{this}};{{/with~}}">
<bsp-form class="Form" {{~#with formType}} data-form-type="{{this}}"{{~/with}}>
{{include "/link/AnchorLink.hbs" this}}
{{#with title}}<div class="Form-title">{{this}}</div>{{/with}}
{{#with description}}<div class="Form-description">{{this}}</div>{{/with}}
{{#if submissionSuccess}}
<div class="Form-submissionSuccess">
{{#if message}}
{{~message~}}
{{else}}
{{format "/form/Form" "successMessage"}}
{{/if}}
</div>
{{else}}
<form {{~#with acceptCharset}} accept-charset="{{this}}" {{/with}} {{~#with action}} action="{{this}}" {{/with}}
{{~#with autocomplete}} "method": "post",
autocomplete="{{this}}" {{/with}} class="Form-form" {{~#with enctype}} enctype="{{this}}"
{{/with}} {{~#with method}} method="{{this}}" {{else}} method="post" {{/with}} {{~#with name}} name="{{this}}"
{{/with}} {{~#with novalidate}} novalidate{{/with}} {{~#with target}} target="{{this}}" {{/with}}>
{{#with items}}
<div class="Form-items">
{{#each this}}
<div class="Form-items-item" {{~#or
(eq _template "/form/input/HiddenCookieInput.hbs")
(eq _template "/form/input/HiddenDocumentReferrerInput.hbs")
(eq _template "/form/input/HiddenInput.hbs")
}} data-field-hidden{{/or}}>
{{this}}
</div>
{{/each}}
</div>
{{/with}}
<div class="Form-buttons">
{{include "button/Button.hbs" label=(fallback buttonLabelText (format "/form/Form" "buttonText")) type="submit"}}
</div>
</form>
{{#with message}}
<div class="Form-message">
{{~this~}}
</div>
{{/with}}
{{/if}}
{{#each scripts}}{{this}}{{/each}}
</bsp-form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment