Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ In a separate terminal, run the tests:
```bash
cd tests/end-to-end
npm install
npx playwright install chromium
npm run test
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'form', * FROM (VALUES
-- top level
('validate_icon', 'Name of an icon to be displayed on the left side of the submit button.', 'ICON', TRUE, TRUE),
('reset_icon', 'Name of an icon to be displayed on the left side of the reset button.', 'ICON', TRUE, TRUE),
('reset_color', 'The color of the button at the bottom of the form that resets the form to its original state. Omit this property to use the default color.', 'COLOR', TRUE, TRUE)
)

21 changes: 15 additions & 6 deletions sqlpage/templates/form.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,32 @@
{{/each_row}}
</div>
{{#if (and (ne validate '') (not auto_submit))}}
<input class="btn
<button class="btn
btn-{{default validate_color "primary"}}
{{#if validate_shape}} btn-{{validate_shape}} {{/if}}
{{#if validate_outline}} btn-outline-{{validate_outline}} {{/if}}
{{#if validate_size}} btn-{{validate_size}} {{/if}}"
{{flush_delayed}}
type="submit"
{{#if validate}}value="{{validate}}"{{/if}}>
type="submit">
{{~#if validate_icon~}}
<span {{~#if (not narrow)}} class="me-1"{{/if}}>{{~icon_img validate_icon~}}</span>
{{~/if~}}
<span>{{#if validate}}{{validate}}{{else}}Submit Query{{/if}}</span>
</button>

{{/if}}
{{#if reset}}
<input class="btn
<button class="btn
{{#if reset_color}} btn-{{reset_color}} {{/if}}
{{#if reset_shape}} btn-{{reset_shape}} {{/if}}
{{#if reset_outline}} btn-outline-{{reset_outline}} {{/if}}
{{#if reset_size}} btn-{{reset_size}} {{/if}}"
type="reset"
value="{{reset}}">
type="reset">
{{~#if reset_icon~}}
<span {{~#if (not narrow)}} class="me-1"{{/if}}>{{~icon_img reset_icon~}}</span>
{{~/if~}}
<span>{{reset}}</span>
</button>
{{/if}}
</fieldset>
</form>