Skip to content

Commit 46624b5

Browse files
authored
Merge branch 'lovasoa:main' into fixed-top-navbar
2 parents cb6d708 + dc0ff9b commit 46624b5

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
```sql
3131
select 'shell' as component, 'My Website' as title, CASE WHEN $role = 'admin' THEN 'Admin' END as menu_item;
3232
- Add the ability to use local Woff2 fonts in the [shell](https://sql.ophir.dev/documentation.sql?component=shell#component) component. This is useful to use custom fonts in your website, without depending on google fonts (and disclosing your users' IP addresses to google).
33+
- Add a `fixed_top_menu` attribute to make the top menu sticky. This is useful to keep the menu visible even when the user scrolls down the page.
34+
- Add a `wrap` attribute to the `list` component to wrap items on multiple lines when they are too long.
3335
3436
## 0.23.0 (2024-06-09)
3537

examples/official-site/sqlpage/migrations/01_documentation.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
3939
('empty_description_md', 'Description to display if the list is empty, in Markdown format.', 'TEXT', TRUE, TRUE),
4040
('empty_link', 'URL to which the user should be taken if they click on the empty list.', 'URL', TRUE, TRUE),
4141
('compact', 'Whether to display the list in a more compact format, allowing more items to be displayed on the screen.', 'BOOLEAN', TRUE, TRUE),
42+
('wrap', 'Wrap list items onto multiple lines if they are too long', 'BOOLEAN', TRUE, TRUE),
4243
-- item level
4344
('title', 'Name of the list item, displayed prominently.', 'TEXT', FALSE, FALSE),
4445
('description', 'A description of the list item, displayed as greyed-out text.', 'TEXT', FALSE, TRUE),
@@ -56,7 +57,7 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
5657
INSERT INTO example(component, description, properties) VALUES
5758
('list', 'A basic compact list', json('[{"component":"list", "compact": true, "title": "SQLPage lists are..."},{"title":"Beautiful"},{"title":"Useful"},{"title":"Versatile"}]')),
5859
('list', 'An empty list with a link to add an item', json('[{"component":"list", "empty_title": "No items yet", "empty_description": "This list is empty. Click here to create a new item !", "empty_link": "documentation.sql"}]')),
59-
('list', 'A list with rich text descriptions', json('[{"component":"list"},
60+
('list', 'A list with rich text descriptions', json('[{"component":"list", "wrap": true},
6061
{"title":"SQLPage", "image_url": "https://raw.githubusercontent.com/lovasoa/SQLpage/main/docs/favicon.png", "description_md":"A **SQL**-based **page** generator for **PostgreSQL**, **MySQL**, **SQLite** and **SQL Server**. [Free on Github](https://github.com/lovasoa/sqlpage)"},
6162
{"title":"Tabler", "image_url": "https://avatars.githubusercontent.com/u/35471246", "description_md":"A **free** and **open-source** **HTML** template pack based on **Bootstrap**."},
6263
{"title":"Tabler Icons", "image_url": "https://tabler.io/favicon.ico", "description_md":"A set of over **700** free MIT-licensed high-quality **SVG** icons for you to use in your web projects."}

sqlpage/templates/list.handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<img src="{{image_url}}" class="avatar avatar-md rounded" width="45" height="45" alt="{{title}}" />
2727
</div>
2828
{{/if}}
29-
<div class="col text-truncate">
29+
<div class="col {{#if ../wrap}}text-wrap{{else}}text-truncate{{/if}}">
3030
{{title}}
31-
<div class="d-block text-muted text-truncate mt-n1">
31+
<div class="d-block text-muted text-truncate mt-n1{{#if ../wrap}} text-wrap{{/if}}">
3232
{{~description~}}
3333
{{~#if description_md~}}
3434
<div style="margin-bottom: -1rem">{{{markdown description_md}}}</div>

0 commit comments

Comments
 (0)