Skip to content

Commit da4b005

Browse files
committed
fix #610
1 parent e8f017b commit da4b005

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
- The error message now always includes the name of the file where the error occurred, which is useful when embedding SQLPage pages using `sqlpage.run_sql`, or the card component.
3737
- When an error occurs while executing a SQL statement, the error message now always includes the (potentially transformed) SQL statement that was sent to the database.
3838
- Fixed a problem where database errors would be displayed twice in the error message.
39+
- Fixed layout issues in the card component when embedding content with `embed`: remove double border and padding.
3940

4041
## 0.30.1 (2024-10-31)
4142
- fix a bug where table sorting would break if table search was not also enabled.

examples/official-site/examples/chart.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ select
55
'Syracuse Sequence' as title,
66
coalesce($type, 'area') as type,
77
coalesce($color, 'indigo') as color,
8-
5 as marker;
8+
5 as marker,
9+
0 as ymin;
910
with recursive seq(x, y) as (
1011
select 0, CAST($n as integer)
1112
union all

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ to the path of the file you want to include, followed by `?_sqlpage_embed`.
666666
',
667667
json('[
668668
{"component":"card", "title":"A dashboard with multiple graphs on the same line", "columns": 2},
669-
{"embed": "/examples/chart.sql?color=green&n=42&_sqlpage_embed", "footer_md": "You can find the sql file that generates the chart [here](https://github.com/lovasoa/SQLpage/tree/main/examples/official-site/examples/chart.sql)" },
669+
{"embed": "/examples/chart.sql?color=green&n=42&_sqlpage_embed"},
670670
{"embed": "/examples/chart.sql?_sqlpage_embed" }
671671
]'));
672672

examples/official-site/sqlpage/migrations/31_card_docs_update.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ INSERT INTO example(component, description, properties) VALUES
7272
('card', 'Cards with remote content',
7373
json('[
7474
{"component":"card", "title":"Card with embedded remote content", "columns": 2},
75-
{"title": "Embedded Chart", "embed": "/examples/chart.sql?_sqlpage_embed", "footer_md": "You can find the sql file that generates the chart [here](https://github.com/lovasoa/SQLpage/tree/main/examples/official-site/examples/chart.sql)" },
75+
{"title": "Embedded Chart", "embed": "/examples/chart.sql?_sqlpage_embed" },
7676
{"title": "Embedded Video", "embed": "https://www.youtube.com/embed/mXdgmSdaXkg", "allow": "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", "embed_mode": "iframe", "height": "350" }
7777
]'));

sqlpage/templates/card.handlebars

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
{{/unless}} {{class}}"
2525
{{~#if id}} id="{{id}}"{{/if}}>
2626
<div class="card h-100
27-
{{~#if active}} card-active{{/if~}}
28-
{{~#if background_color}} bg-{{background_color}} text-{{background_color}}-fg{{/if~}}
27+
{{~#if active}} card-active {{/if~}}
28+
{{~#if background_color}} bg-{{background_color}} text-{{background_color}}-fg
29+
{{~else}}{{#if embed}} bg-transparent border-0{{/if}}
30+
{{~/if~}}
2931
"
3032
{{#if (and embed (ne embed_mode "iframe"))}}data-pre-init="card" data-embed="{{embed}}"{{/if}}>
3133
{{#if link}}
@@ -37,7 +39,7 @@
3739
{{#if color}}
3840
<div class="card-status-start bg-{{color}}"></div>
3941
{{/if}}
40-
<div class="card-body">
42+
<div class="card-body {{#if embed}}p-0{{/if}}">
4143
{{#if title}}<h2 class="card-title fs-3 me-3">{{title}}</h2>{{/if}}
4244
<div class="card-content remove-bottom-margin{{#if (and icon (not title))}} pe-4{{/if}}">
4345
{{~description~}}

0 commit comments

Comments
 (0)