|
| 1 | +DELETE FROM component WHERE name = 'card'; |
| 2 | + |
| 3 | +INSERT INTO component(name, icon, description) VALUES |
| 4 | + ('card', 'credit-card', 'A grid where each element is a small card that displays a piece of data.'); |
| 5 | +INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'card', * FROM (VALUES |
| 6 | + -- top level |
| 7 | + ('title', 'Text header at the top of the list of cards.', 'TEXT', TRUE, TRUE), |
| 8 | + ('description', 'A short paragraph displayed below the title.', 'TEXT', TRUE, TRUE), |
| 9 | + ('description_md', 'A short paragraph displayed below the title - formatted using markdown.', 'TEXT', TRUE, TRUE), |
| 10 | + ('columns', 'The number of columns in the grid of cards. This is just a hint, the grid will adjust dynamically to the user''s screen size, rendering fewer columns if needed to fit the contents.', 'INTEGER', TRUE, TRUE), |
| 11 | + -- item level |
| 12 | + ('title', 'Name of the card, displayed at the top.', 'TEXT', FALSE, FALSE), |
| 13 | + ('description', 'The body of the card, where you put the main text contents of the card. |
| 14 | + This does not support rich text formatting, only plain text. |
| 15 | + If you want to use rich text formatting, use the `description_md` property instead.', 'TEXT', FALSE, TRUE), |
| 16 | + ('description_md', ' |
| 17 | + The body of the card, in Markdown format. |
| 18 | + This is useful if you want to display a lot of text in the card, with many options for formatting, such as |
| 19 | + line breaks, **bold**, *italics*, lists, #titles, [links](target.sql), , etc.', 'TEXT', FALSE, TRUE), |
| 20 | + ('top_image', 'The URL (absolute or relative) of an image to display at the top of the card.', 'URL', FALSE, TRUE), |
| 21 | + ('footer', 'Muted text to display at the bottom of the card.', 'TEXT', FALSE, TRUE), |
| 22 | + ('footer_md', 'Muted text to display at the bottom of the card, with rich text formatting in Markdown format.', 'TEXT', FALSE, TRUE), |
| 23 | + ('link', 'An URL to which the user should be taken when they click on the card.', 'URL', FALSE, TRUE), |
| 24 | + ('footer_link', 'An URL to which the user should be taken when they click on the footer.', 'URL', FALSE, TRUE), |
| 25 | + ('icon', 'Name of an icon to display on the left side of the card.', 'ICON', FALSE, TRUE), |
| 26 | + ('color', 'The name of a color, to be displayed on the left of the card to highlight it.', 'COLOR', FALSE, TRUE), |
| 27 | + ('active', 'Whether this item in the grid is considered "active". Active items are displayed more prominently.', 'BOOLEAN', FALSE, TRUE), |
| 28 | + ('embed', 'A url whose contents will be fetched and injected into the body of this card. |
| 29 | + This can be used to inject arbitrary html content, but is especially useful for injecting |
| 30 | + the output of other sql files rendered by SQLPage. For the latter case you can pass the |
| 31 | + `?_sqlpage_embed` query parameter, which will skip the shell layout', 'TEXT', FALSE, TRUE) |
| 32 | +) x; |
| 33 | + |
0 commit comments