Compare commits
7 Commits
5b15141ecc
...
ff91995337
Author | SHA1 | Date | |
---|---|---|---|
ff91995337 | |||
008c91a552 | |||
d830727036 | |||
dadccc1b5f | |||
6022953417 | |||
7210f1b947 | |||
8af63fc22a |
@ -3,12 +3,14 @@
|
|||||||
import { tracks as tracksstore } from "../store.js";
|
import { tracks as tracksstore } from "../store.js";
|
||||||
let trackname_input;
|
let trackname_input;
|
||||||
let trackname_input_value;
|
let trackname_input_value;
|
||||||
|
let track_min_duration;
|
||||||
let tracklength;
|
let tracklength;
|
||||||
import { TrackService } from "@odit/lfk-client-js";
|
import { TrackService } from "@odit/lfk-client-js";
|
||||||
export let modal_open;
|
export let modal_open;
|
||||||
let processed_last_submit = true;
|
let processed_last_submit = true;
|
||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
import "toastify-js/src/toastify.css";
|
import "toastify-js/src/toastify.css";
|
||||||
|
$: smart_track_min_duration_placeholder = parseInt(tracklength || 0) * 0.369;
|
||||||
function submit() {
|
function submit() {
|
||||||
if (processed_last_submit === true) {
|
if (processed_last_submit === true) {
|
||||||
processed_last_submit = false;
|
processed_last_submit = false;
|
||||||
@ -19,6 +21,7 @@
|
|||||||
TrackService.trackControllerPost({
|
TrackService.trackControllerPost({
|
||||||
distance: parseInt(tracklength),
|
distance: parseInt(tracklength),
|
||||||
name: trackname_input_value,
|
name: trackname_input_value,
|
||||||
|
minimumLapTime: track_min_duration,
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
Toastify({
|
Toastify({
|
||||||
@ -98,7 +101,7 @@
|
|||||||
bind:this={trackname_input}
|
bind:this={trackname_input}
|
||||||
type="text"
|
type="text"
|
||||||
name="trackname"
|
name="trackname"
|
||||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" />
|
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-6">
|
<div class="col-span-6">
|
||||||
<label
|
<label
|
||||||
@ -109,10 +112,25 @@
|
|||||||
bind:value={tracklength}
|
bind:value={tracklength}
|
||||||
type="number"
|
type="number"
|
||||||
name="track_length_m"
|
name="track_length_m"
|
||||||
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-r-md sm:text-sm border-gray-300"
|
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2"
|
||||||
placeholder="1000" />
|
placeholder="1000" />
|
||||||
<span
|
<span
|
||||||
class="inline-flex items-center px-3 rounded-r-md border border-l-0 border-gray-300 bg-gray-50 text-gray-500 text-sm">m</span>
|
class="inline-flex items-center px-3 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 text-sm">m</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-6">
|
||||||
|
<label
|
||||||
|
for="track_min_duration"
|
||||||
|
class="block text-sm font-medium text-gray-700">{$_('minimum-lap-time-in-s')}</label>
|
||||||
|
<div class="mt-1 flex rounded-md shadow-sm">
|
||||||
|
<input
|
||||||
|
bind:value={track_min_duration}
|
||||||
|
type="number"
|
||||||
|
name="track_min_duration"
|
||||||
|
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2"
|
||||||
|
placeholder={smart_track_min_duration_placeholder} />
|
||||||
|
<span
|
||||||
|
class="inline-flex items-center px-3 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 text-sm">s</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
tabledata.push([
|
tabledata.push([
|
||||||
track.name,
|
track.name,
|
||||||
track.distance,
|
track.distance,
|
||||||
|
track.minimumLapTime || 0,
|
||||||
html(`
|
html(`
|
||||||
<button class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-400 text-base font-medium text-white sm:w-auto sm:text-sm">Edit</button>
|
<button class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-400 text-base font-medium text-white sm:w-auto sm:text-sm">Edit</button>
|
||||||
<button class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-500 text-base font-medium text-white sm:w-auto sm:text-sm">Delete</button>
|
<button class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-500 text-base font-medium text-white sm:w-auto sm:text-sm">Delete</button>
|
||||||
@ -39,7 +40,12 @@
|
|||||||
});
|
});
|
||||||
if (datatable_inited === false) {
|
if (datatable_inited === false) {
|
||||||
datatable = new Grid({
|
datatable = new Grid({
|
||||||
columns: [$_("track-name"), $_("track-length-in-m"), "Action"],
|
columns: [
|
||||||
|
$_("track-name"),
|
||||||
|
$_("track-length-in-m"),
|
||||||
|
$_("minimum-lap-time-in-s"),
|
||||||
|
$_("action"),
|
||||||
|
],
|
||||||
language: getlang($json("datatable")),
|
language: getlang($json("datatable")),
|
||||||
sort: true,
|
sort: true,
|
||||||
search: { enabled: true },
|
search: { enabled: true },
|
||||||
|
@ -1,74 +1,76 @@
|
|||||||
{
|
{
|
||||||
"forgot_password?": "Forgot your password?",
|
"forgot_password?": "Forgot your password?",
|
||||||
"register": "Register",
|
"register": "Register",
|
||||||
"log_in": "Log in",
|
"log_in": "Log in",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"log_in_to_your_account": "Log in to your account",
|
"log_in_to_your_account": "Log in to your account",
|
||||||
"welcome_wavinghand": "Welcome 👋",
|
"welcome_wavinghand": "Welcome 👋",
|
||||||
"login_is_checked": "Login is being checked...",
|
"login_is_checked": "Login is being checked...",
|
||||||
"error_on_login": "Error on login",
|
"error_on_login": "Error on login",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"your_profile": "Your Profile",
|
"your_profile": "Your Profile",
|
||||||
"email_address_or_username": "Email / username",
|
"email_address_or_username": "Email / username",
|
||||||
"tracks": "Tracks",
|
"tracks": "Tracks",
|
||||||
"signout": "Sign out",
|
"signout": "Sign out",
|
||||||
"hallo": "hello",
|
"hallo": "hello",
|
||||||
"404message": "Sorry, the page you are looking for could not be found.",
|
"404message": "Sorry, the page you are looking for could not be found.",
|
||||||
"404title": "Error 404",
|
"404title": "Error 404",
|
||||||
"goback": "Go Home",
|
"goback": "Go Home",
|
||||||
"application_name": "Lauf für Kaya! - Admin",
|
"application_name": "Lauf für Kaya! - Admin",
|
||||||
"reset-my-password": "Reset my password",
|
"reset-my-password": "Reset my password",
|
||||||
"cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity",
|
"cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity",
|
||||||
"send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services",
|
"send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services",
|
||||||
"dont-have-your-email-connected": "Don't have your email connected?",
|
"dont-have-your-email-connected": "Don't have your email connected?",
|
||||||
"dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌",
|
"dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌",
|
||||||
"e-mail-adress": "E-Mail Adress",
|
"e-mail-adress": "E-Mail Adress",
|
||||||
"mail-validation-in-progress": "mail validation in progress...",
|
"mail-validation-in-progress": "mail validation in progress...",
|
||||||
"invalid-mail-reset": "the provided email is invalid",
|
"invalid-mail-reset": "the provided email is invalid",
|
||||||
"runners": "Runners",
|
"runners": "Runners",
|
||||||
"total-scans": "total scans",
|
"total-scans": "total scans",
|
||||||
"total-donations": "total donations",
|
"total-donations": "total donations",
|
||||||
"total-distance": "total distance",
|
"total-distance": "total distance",
|
||||||
"datatable": {
|
"datatable": {
|
||||||
"search": "🔍 Search...",
|
"search": "🔍 Search...",
|
||||||
"sort_column_ascending": "Sort column ascending",
|
"sort_column_ascending": "Sort column ascending",
|
||||||
"sort_column_descending": "Sort column descending",
|
"sort_column_descending": "Sort column descending",
|
||||||
"previous": "Previous",
|
"previous": "Previous",
|
||||||
"next": "Next",
|
"next": "Next",
|
||||||
"page": "Page",
|
"page": "Page",
|
||||||
"showing": "Showing",
|
"showing": "Showing",
|
||||||
"records": "Records",
|
"records": "Records",
|
||||||
"of": "of",
|
"of": "of",
|
||||||
"to": "to",
|
"to": "to",
|
||||||
"loading": "Loading...",
|
"loading": "Loading...",
|
||||||
"no_matching_records_found": "No matching records found",
|
"no_matching_records_found": "No matching records found",
|
||||||
"an_error_happened_while_fetching_the_data": "An error happened while fetching the data"
|
"an_error_happened_while_fetching_the_data": "An error happened while fetching the data"
|
||||||
},
|
},
|
||||||
"about": "About",
|
"about": "About",
|
||||||
"by": "by",
|
"by": "by",
|
||||||
"lfk-is-os": "The \"Lauf für Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.",
|
"lfk-is-os": "The \"Lauf für Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.",
|
||||||
"oss_credit_description": "We use a lot of open source software on these projects, and would like to thank the following projects and contributors who help make open source great!",
|
"oss_credit_description": "We use a lot of open source software on these projects, and would like to thank the following projects and contributors who help make open source great!",
|
||||||
"credits": "Credits",
|
"credits": "Credits",
|
||||||
"count_organizations": "# Organizations",
|
"count_organizations": "# Organizations",
|
||||||
"count_teams": "# Teams",
|
"count_teams": "# Teams",
|
||||||
"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",
|
||||||
"dashboard-greeting": "hello there",
|
"dashboard-greeting": "hello there",
|
||||||
"dashboard-title": "Dashboard",
|
"dashboard-title": "Dashboard",
|
||||||
"track-added": "Track added",
|
"track-added": "Track added",
|
||||||
"track-is-being-added": "Track is being added...",
|
"track-is-being-added": "Track is being added...",
|
||||||
"logout": "Logout",
|
"logout": "Logout",
|
||||||
"changelog": "Changelog",
|
"changelog": "Changelog",
|
||||||
"orgs": "Orgs",
|
"orgs": "Orgs",
|
||||||
"users": "Users",
|
"users": "Users",
|
||||||
"teams": "Teams",
|
"teams": "Teams",
|
||||||
"faq": "FAQ",
|
"faq": "FAQ",
|
||||||
"this-might-take-a-moment": "This might take a moment 👀",
|
"minimum-lap-time-in-s": "Minimum lap time in s",
|
||||||
"stats-are-being-loaded": "stats are being loaded...",
|
"action": "Action",
|
||||||
"general-stats": "General Stats"
|
"this-might-take-a-moment": "This might take a moment 👀",
|
||||||
|
"stats-are-being-loaded": "stats are being loaded...",
|
||||||
|
"general-stats": "General Stats"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user