lovasoa / SQLpage

SQL-only webapp builder, empowering data analysts to build websites and applications quickly
https://sql.datapage.app
MIT License
1.29k stars 69 forks source link

allow setting a width to form fields #118

Closed lovasoa closed 9 months ago

lovasoa commented 10 months ago

Discussed in https://github.com/lovasoa/SQLpage/discussions/111

Originally posted by **Pieter3033** October 24, 2023 First of I'd like to thank @lovasoa , Mr. Ophir you have done a great job.🔥 I'd just like to share this with whom ever would like to use it. I've manipulated the "form.handlebars" to display 2 input boxes next to each other and removed the button. (Because, as of SQLPage v0.14 an awesome button component has been added) ### _How to use:_ 1. Create a subfolder in your root folder called "sqlpage". 2. Inside of the "sqlpage" folder create a folder called "templates". 3. Copy the .handlebars code. 4. Paste the .handlebars code in a .handlebars file and name it accordingly. • (I'd recommend keeping the original "form" handlebar as you can make use of different types of forms) • (Note: All the default .handlebars are in the source file of SQLPage located inside of the path: "sqlpage/templates") 5. When calling the form component, instead of calling it as normal: `SELECT 'form' as component` Just rename it to the .handlebar name: `SELECT 'form_nobtn_2columns' as component` See form reference: ![image](https://github.com/lovasoa/SQLpage/assets/141907966/8d791825-b792-49f8-b34e-69e3b3ca3852) _form_nobtn_2columns.handlebars:_ ```
{{#if title}}

{{title}}

{{/if}}
{{#each_row}}
{{#if (or (eq type "radio") (eq type "checkbox") (eq type "select"))}}
{{else}} {{#if (eq type 'textarea')}} {{else}} {{/if}} {{/if}}
{{/each_row}}
```