fix table sorting

This commit is contained in:
lovasoa
2023-08-23 02:19:09 +02:00
parent a6334ab9dd
commit 5fc00bda0c
6 changed files with 17 additions and 16 deletions
Generated
+2 -2
View File
@@ -1540,9 +1540,9 @@ dependencies = [
[[package]]
name = "num-bigint"
version = "0.4.3"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f"
checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
dependencies = [
"autocfg",
"num-integer",
+1 -2
View File
@@ -23,9 +23,8 @@ async fn main() {
/// Creates a file with inlined remote files included
async fn download_deps(filename: &str) {
println!("cargo:rerun-if-changed=build.rs");
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
let path_in = format!("sqlpage/{}", filename);
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
let path_out: PathBuf = out_dir.join(filename);
// Generate outfile by reading infile and interpreting all comments
// like "/* !include https://... */" as a request to include the contents of
@@ -377,8 +377,10 @@ INSERT INTO example(component, description, properties) VALUES
'table',
'A table with dashes',
json(
'[{"component":"table", "search": true}, ' ||
'{"id": 31456, "part_no": "MIC-ROCC-F-23-206-C"}
'[{"component":"table", "search": true, "sort": true}, ' ||
'{"id": 31456, "part_no": "MIC-ROCC-F-23-206-C"},
{"id": 996, "part_no": "MIC-ROCC-F-24-206-A"},
{"id": 131456, "part_no": "KIB-ROCC-F-13-205-B"}
]'
)
);
+1 -1
View File
@@ -1,5 +1,5 @@
/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta19/dist/js/tabler.min.js */
/* !include https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.2/dist/list.min.js */
/* !include https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.4/dist/list.min.js */
function sqlpage_chart() {
let first_chart = document.querySelector("[data-js]");
+1 -1
View File
@@ -1 +1 @@
/* !include https://cdn.jsdelivr.net/npm/@tabler/icons@2.30.0/tabler-sprite.svg */
/* !include https://cdn.jsdelivr.net/npm/@tabler/icons@2.32.0/tabler-sprite.svg */
+8 -8
View File
@@ -7,20 +7,20 @@
</div>
{{/if}}
<table class="table">
{{~#each_row~}}
{{#each_row}}
{{#if (eq @row_index 0)}}
<thead>
<tr>
{{#each this}}
{{~#if (not (starts_with @key '_sqlpage_'))~}}
{{#if (not (starts_with @key '_sqlpage_'))}}
<th>
{{#if ../../sort}}
{{~#if ../../sort~}}
<button class="table-sort sort" data-sort="{{@key}}">{{@key}}</button>
{{else}}
{{@key}}
{{/if}}
{{~else~}}
{{~@key~}}
{{~/if~}}
</th>
{{~/if~}}
{{/if}}
{{/each}}
</tr>
</thead>
@@ -44,7 +44,7 @@
{{~/if~}}
{{~/each~}}
</tr>
{{~/each_row~}}
{{/each_row}}
{{flush_delayed}}
</table>
</div>