Track page cleanup
This commit is contained in:
parent
9af4cfe73f
commit
72f1645767
@ -1,10 +1,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _, json } from "svelte-i18n";
|
import { _, json } from "svelte-i18n";
|
||||||
import TracksEmptyState from "./TracksEmptyState.svelte";
|
import TracksEmptyState from "./TracksEmptyState.svelte";
|
||||||
import store from "../store.js";
|
|
||||||
import { TrackService } from "@odit/lfk-client-js";
|
import { TrackService } from "@odit/lfk-client-js";
|
||||||
let tracks_promise = TrackService.trackControllerGetAll();
|
const tracks_promise = TrackService.trackControllerGetAll();
|
||||||
//
|
|
||||||
import { getlang } from "./datatable_i18n";
|
import { getlang } from "./datatable_i18n";
|
||||||
import { Grid } from "gridjs";
|
import { Grid } from "gridjs";
|
||||||
import "gridjs/dist/theme/mermaid.css";
|
import "gridjs/dist/theme/mermaid.css";
|
||||||
@ -13,10 +11,10 @@
|
|||||||
tracks_promise.then((data) => {
|
tracks_promise.then((data) => {
|
||||||
let tabledata = [];
|
let tabledata = [];
|
||||||
data.forEach((track) => {
|
data.forEach((track) => {
|
||||||
tabledata.push([track.name, track.distance, "blablub"]);
|
tabledata.push([track.name, track.distance, "TODO: edit,delete"]);
|
||||||
});
|
});
|
||||||
const datatable = new Grid({
|
const datatable = new Grid({
|
||||||
columns: ["Name", "Track Length in m", "Action"],
|
columns: [$_("track-name"), $_("track-length-in-m"), "Action"],
|
||||||
language: getlang($json("datatable")),
|
language: getlang($json("datatable")),
|
||||||
sort: true,
|
sort: true,
|
||||||
search: { enabled: true },
|
search: { enabled: true },
|
||||||
@ -27,10 +25,10 @@
|
|||||||
summary: false,
|
summary: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
table_visible = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
datatable.render(table);
|
datatable.render(table);
|
||||||
}, 150);
|
}, 10);
|
||||||
table_visible = true;
|
|
||||||
});
|
});
|
||||||
let table_visible = false;
|
let table_visible = false;
|
||||||
</script>
|
</script>
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
"general_promise_error": "😢 Error",
|
"general_promise_error": "😢 Error",
|
||||||
"add-your-first-track": "Add your first track",
|
"add-your-first-track": "Add your first track",
|
||||||
"no-tracks-added-yet": "there are no tracks added yet.",
|
"no-tracks-added-yet": "there are no tracks added yet.",
|
||||||
"track-length-in-m": "Track length in m",
|
"track-length-in-m": "Track Length in m",
|
||||||
"track-name": "Track name",
|
"track-name": "Track name",
|
||||||
"please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.",
|
"please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.",
|
||||||
"create-a-new-track": "Create a new Track"
|
"create-a-new-track": "Create a new Track"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user