From 1686cf348df6883ae1b6a0b4153e172ac897fc39 Mon Sep 17 00:00:00 2001 From: Saturos Date: Thu, 25 Jul 2024 17:19:57 +0200 Subject: [PATCH 01/10] Add sidebar --- sqlpage/templates/shell.handlebars | 385 ++++++++++++++++++----------- 1 file changed, 245 insertions(+), 140 deletions(-) diff --git a/sqlpage/templates/shell.handlebars b/sqlpage/templates/shell.handlebars index a204e224..2cf73cdf 100644 --- a/sqlpage/templates/shell.handlebars +++ b/sqlpage/templates/shell.handlebars @@ -1,178 +1,283 @@ - + + - + {{default title "SQLPage"}} {{#if manifest}} - + {{/if}} {{#each (to_array css)}} - {{#if this}} - - {{/if}} + {{#if this}} + + {{/if}} {{/each}} {{#if font}} - {{#if (starts_with font "/")}} - - {{else}} - - - - - {{/if}} - {{/if}} + {{#if (starts_with font "/")}} + + {{else}} + + + + + {{/if}} + {{/if}} {{#each (to_array javascript)}} - {{#if this}} - - {{/if}} - {{/each}} - {{#each (to_array javascript_module)}} - {{#if this}} - - {{/if}} + {{#if this}} + + {{/if}} {{/each}} - - - + + {{#if norobot}} - + {{/if}} {{#if refresh}} - + {{/if}} {{#if rss}} - + {{/if}} - - + {{#if social_image}} - + {{/if}} - -
- {{#if (or (or title (or icon image)) menu_item)}} -
+ +
+ {{#if (or (or title (or icon image)) menu_item)}} +
+ {{#if sidebar}} + + {{else}} -
- {{/if}} -
- {{~#each_row~}}{{~/each_row~}} -
-
- + {{/if}} + + {{/if}} +
+
+ {{~#each_row~}}{{~/each_row~}} +
+
+ {{#if footer}} + {{{markdown footer}}} + {{else}} + + Built with SQLPage + {{/if}} +
+
+ - + \ No newline at end of file From 1933fa75afc5994b8ad71fe0cde80d20fca2f67f Mon Sep 17 00:00:00 2001 From: Saturos Date: Thu, 25 Jul 2024 17:36:36 +0200 Subject: [PATCH 02/10] Erase redundant CSS --- sqlpage/templates/shell.handlebars | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sqlpage/templates/shell.handlebars b/sqlpage/templates/shell.handlebars index 2cf73cdf..c69088d8 100644 --- a/sqlpage/templates/shell.handlebars +++ b/sqlpage/templates/shell.handlebars @@ -39,22 +39,6 @@ Arial, sans-serif; } - - { - { - #if sidebar - } - } - - * { - scrollbar-color: rgba(var(--tblr-scrollbar-color, var(--tblr-body-color-rgb)), .16) transparent !important; - } - - { - { - /if - } - } {{/if}} {{/if}} From b20933450e1b6aad1eccaf1153c5a6043bd20729 Mon Sep 17 00:00:00 2001 From: lovasoa Date: Sun, 28 Jul 2024 15:02:43 +0200 Subject: [PATCH 03/10] remove formatting changes that are unrelated to the new sidebar feature I'm not against changing code style, but we can discuss that separately. Otherwise, PRs are hard to review --- sqlpage/templates/shell.handlebars | 246 ++++++++++++++--------------- 1 file changed, 121 insertions(+), 125 deletions(-) diff --git a/sqlpage/templates/shell.handlebars b/sqlpage/templates/shell.handlebars index c69088d8..bcd3604c 100644 --- a/sqlpage/templates/shell.handlebars +++ b/sqlpage/templates/shell.handlebars @@ -1,68 +1,68 @@ - - + - + {{default title "SQLPage"}} {{#if manifest}} - + {{/if}} {{#each (to_array css)}} - {{#if this}} - - {{/if}} + {{#if this}} + + {{/if}} {{/each}} {{#if font}} - {{#if (starts_with font "/")}} - - {{else}} - - - - - {{/if}} + {{#if (starts_with font "/")}} + + {{else}} + + + + + {{/if}} {{/if}} + {{#each (to_array javascript)}} - {{#if this}} - - {{/if}} + {{#if this}} + + {{/if}} + {{/each}} + {{#each (to_array javascript_module)}} + {{#if this}} + + {{/if}} {{/each}} - - + + + {{#if norobot}} - + {{/if}} {{#if refresh}} - + {{/if}} {{#if rss}} - + {{/if}} - + + {{#if social_image}} - + {{/if}} @@ -150,98 +150,94 @@ {{else}} {{/if}} From 2a5eb469bb512dd4cb61b3441127c0c64c4f2bbd Mon Sep 17 00:00:00 2001 From: lovasoa Date: Sun, 28 Jul 2024 15:52:43 +0200 Subject: [PATCH 04/10] refactor class --- sqlpage/templates/shell.handlebars | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sqlpage/templates/shell.handlebars b/sqlpage/templates/shell.handlebars index bcd3604c..dbdeeded 100644 --- a/sqlpage/templates/shell.handlebars +++ b/sqlpage/templates/shell.handlebars @@ -66,8 +66,7 @@ {{/if}} - +
{{#if (or (or title (or icon image)) menu_item)}}
From c452a214235d7052e95bb6f72ad44fb39c064223 Mon Sep 17 00:00:00 2001 From: lovasoa Date: Sun, 28 Jul 2024 15:59:05 +0200 Subject: [PATCH 05/10] fix layouts page --- examples/official-site/examples/layouts.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/official-site/examples/layouts.sql b/examples/official-site/examples/layouts.sql index 3a8a6422..50239546 100644 --- a/examples/official-site/examples/layouts.sql +++ b/examples/official-site/examples/layouts.sql @@ -13,7 +13,7 @@ For more information on how to use layouts, see the [shell component documentati ' as contents_md; select 'list' as component, 'Available SQLPage shell layouts' as title; -select column1 as title, '?layout=' || lower(column1) as link, $layout = column1 as active, column3 as icon, column2 as description +select column1 as title, '?layout=' || lower(column1) as link, $layout = lower(column1) as active, column3 as icon, column2 as description from (VALUES ('Boxed', 'A compact layout with a fixed-width container. This is the default layout.', 'layout-distribute-vertical'), ('Horizontal', 'A full-width layout with a horizontal navigation bar.', 'layout-align-top'), From 9d80385e17806519fc28c4211a61ab5e325a5ec2 Mon Sep 17 00:00:00 2001 From: Saturos Date: Wed, 7 Aug 2024 22:23:09 +0200 Subject: [PATCH 06/10] Add inline to merge funcionality of menu-items --- sqlpage/templates/shell.handlebars | 284 +++++++++++------------------ 1 file changed, 104 insertions(+), 180 deletions(-) diff --git a/sqlpage/templates/shell.handlebars b/sqlpage/templates/shell.handlebars index dbdeeded..f4602e1a 100644 --- a/sqlpage/templates/shell.handlebars +++ b/sqlpage/templates/shell.handlebars @@ -1,7 +1,7 @@ - + - + {{default title "SQLPage"}} {{#if manifest}} @@ -23,32 +23,38 @@ font-weight: normal; font-style: normal; } + :root { --tblr-font-sans-serif: 'LocalFont', Arial, sans-serif; } {{else}} - - - - + + + + {{/if}} {{/if}} - + - {{#each (to_array javascript)}} - {{#if this}} - - {{/if}} - {{/each}} + {{#each (to_array javascript)}} + {{#if this}} + + {{/if}} + {{/each}} {{#each (to_array javascript_module)}} {{#if this}} {{/if}} {{/each}} - - - + + {{#if norobot}} {{/if}} @@ -59,204 +65,122 @@ {{#if rss}} {{/if}} - - + {{#if social_image}} - + {{/if}} - +{{!-- Partial for menu_items to not duplicate logic --}} +{{#*inline "menu-items"}} + +{{/inline}} + +
{{#if (or (or title (or icon image)) menu_item)}} -
+
{{#if sidebar}} {{else}} - {{/if}} - - {{/if}} + {{/if}} +{{/if}}
-
+
{{~#each_row~}}{{~/each_row~}}
-
- {{#if footer}} - {{{markdown footer}}} - {{else}} - - Built with SQLPage - {{/if}} -
+
+ {{#if footer}} + {{{markdown footer}}} + {{else}} + + Built with SQLPage + {{/if}} +
\ No newline at end of file From cd39c2c1e1809ebd6247a73aaa53757313c8de51 Mon Sep 17 00:00:00 2001 From: Saturos Date: Thu, 8 Aug 2024 21:04:43 +0200 Subject: [PATCH 07/10] Add .gitattributes to make SQL files show on languages statistics --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..37dba0e3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sql linguist-detectable=true \ No newline at end of file From ce2ef700019111cc6269f563f262878cc261d50e Mon Sep 17 00:00:00 2001 From: Saturos Date: Thu, 8 Aug 2024 21:10:37 +0200 Subject: [PATCH 08/10] #1 Merge conflict solving --- sqlpage/templates/shell.handlebars | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sqlpage/templates/shell.handlebars b/sqlpage/templates/shell.handlebars index f4602e1a..3bcaabbc 100644 --- a/sqlpage/templates/shell.handlebars +++ b/sqlpage/templates/shell.handlebars @@ -42,12 +42,12 @@ {{/if}} {{/if}} - - {{#each (to_array javascript)}} - {{#if this}} - - {{/if}} - {{/each}} + + {{#each (to_array javascript)}} + {{#if this}} + + {{/if}} + {{/each}} {{#each (to_array javascript_module)}} {{#if this}} @@ -145,7 +145,7 @@ {{else}}