Skip to content

Commit 27984a0

Browse files
committed
fix table sorting
1 parent df12dae commit 27984a0

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ async fn main() {
2323

2424
/// Creates a file with inlined remote files included
2525
async fn download_deps(filename: &str) {
26-
println!("cargo:rerun-if-changed=build.rs");
27-
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
2826
let path_in = format!("sqlpage/{}", filename);
27+
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
2928
let path_out: PathBuf = out_dir.join(filename);
3029
// Generate outfile by reading infile and interpreting all comments
3130
// like "/* !include https://... */" as a request to include the contents of

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,10 @@ INSERT INTO example(component, description, properties) VALUES
377377
'table',
378378
'A table with dashes',
379379
json(
380-
'[{"component":"table", "search": true}, ' ||
381-
'{"id": 31456, "part_no": "MIC-ROCC-F-23-206-C"}
380+
'[{"component":"table", "search": true, "sort": true}, ' ||
381+
'{"id": 31456, "part_no": "MIC-ROCC-F-23-206-C"},
382+
{"id": 996, "part_no": "MIC-ROCC-F-24-206-A"},
383+
{"id": 131456, "part_no": "KIB-ROCC-F-13-205-B"}
382384
]'
383385
)
384386
);

sqlpage/sqlpage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta19/dist/js/tabler.min.js */
2-
/* !include https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.2/dist/list.min.js */
2+
/* !include https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.4/dist/list.min.js */
33

44
function sqlpage_chart() {
55
let first_chart = document.querySelector("[data-js]");

sqlpage/tabler-icons.svg

Lines changed: 1 addition & 1 deletion
Loading

sqlpage/templates/table.handlebars

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
</div>
88
{{/if}}
99
<table class="table">
10-
{{~#each_row~}}
10+
{{#each_row}}
1111
{{#if (eq @row_index 0)}}
1212
<thead>
1313
<tr>
1414
{{#each this}}
15-
{{~#if (not (starts_with @key '_sqlpage_'))~}}
15+
{{#if (not (starts_with @key '_sqlpage_'))}}
1616
<th>
17-
{{#if ../../sort}}
17+
{{~#if ../../sort~}}
1818
<button class="table-sort sort" data-sort="{{@key}}">{{@key}}</button>
19-
{{else}}
20-
{{@key}}
21-
{{/if}}
19+
{{~else~}}
20+
{{~@key~}}
21+
{{~/if~}}
2222
</th>
23-
{{~/if~}}
23+
{{/if}}
2424
{{/each}}
2525
</tr>
2626
</thead>
@@ -44,7 +44,7 @@
4444
{{~/if~}}
4545
{{~/each~}}
4646
</tr>
47-
{{~/each_row~}}
47+
{{/each_row}}
4848
{{flush_delayed}}
4949
</table>
5050
</div>

0 commit comments

Comments
 (0)