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";
|
||||
let trackname_input;
|
||||
let trackname_input_value;
|
||||
let track_min_duration;
|
||||
let tracklength;
|
||||
import { TrackService } from "@odit/lfk-client-js";
|
||||
export let modal_open;
|
||||
let processed_last_submit = true;
|
||||
import Toastify from "toastify-js";
|
||||
import "toastify-js/src/toastify.css";
|
||||
$: smart_track_min_duration_placeholder = parseInt(tracklength || 0) * 0.369;
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
@ -19,6 +21,7 @@
|
||||
TrackService.trackControllerPost({
|
||||
distance: parseInt(tracklength),
|
||||
name: trackname_input_value,
|
||||
minimumLapTime: track_min_duration,
|
||||
})
|
||||
.then((result) => {
|
||||
Toastify({
|
||||
@ -98,7 +101,7 @@
|
||||
bind:this={trackname_input}
|
||||
type="text"
|
||||
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 class="col-span-6">
|
||||
<label
|
||||
@ -109,10 +112,25 @@
|
||||
bind:value={tracklength}
|
||||
type="number"
|
||||
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" />
|
||||
<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>
|
||||
|
@ -31,6 +31,7 @@
|
||||
tabledata.push([
|
||||
track.name,
|
||||
track.distance,
|
||||
track.minimumLapTime || 0,
|
||||
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-red-500 text-base font-medium text-white sm:w-auto sm:text-sm">Delete</button>
|
||||
@ -39,7 +40,12 @@
|
||||
});
|
||||
if (datatable_inited === false) {
|
||||
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")),
|
||||
sort: true,
|
||||
search: { enabled: true },
|
||||
|
@ -1,74 +1,76 @@
|
||||
{
|
||||
"forgot_password?": "Forgot your password?",
|
||||
"register": "Register",
|
||||
"log_in": "Log in",
|
||||
"password": "Password",
|
||||
"log_in_to_your_account": "Log in to your account",
|
||||
"welcome_wavinghand": "Welcome 👋",
|
||||
"login_is_checked": "Login is being checked...",
|
||||
"error_on_login": "Error on login",
|
||||
"settings": "Settings",
|
||||
"your_profile": "Your Profile",
|
||||
"email_address_or_username": "Email / username",
|
||||
"tracks": "Tracks",
|
||||
"signout": "Sign out",
|
||||
"hallo": "hello",
|
||||
"404message": "Sorry, the page you are looking for could not be found.",
|
||||
"404title": "Error 404",
|
||||
"goback": "Go Home",
|
||||
"application_name": "Lauf für Kaya! - Admin",
|
||||
"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",
|
||||
"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-panic-were-resetting-it": "Don't panic, we're resetting it ✌",
|
||||
"e-mail-adress": "E-Mail Adress",
|
||||
"mail-validation-in-progress": "mail validation in progress...",
|
||||
"invalid-mail-reset": "the provided email is invalid",
|
||||
"runners": "Runners",
|
||||
"total-scans": "total scans",
|
||||
"total-donations": "total donations",
|
||||
"total-distance": "total distance",
|
||||
"datatable": {
|
||||
"search": "🔍 Search...",
|
||||
"sort_column_ascending": "Sort column ascending",
|
||||
"sort_column_descending": "Sort column descending",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"page": "Page",
|
||||
"showing": "Showing",
|
||||
"records": "Records",
|
||||
"of": "of",
|
||||
"to": "to",
|
||||
"loading": "Loading...",
|
||||
"no_matching_records_found": "No matching records found",
|
||||
"an_error_happened_while_fetching_the_data": "An error happened while fetching the data"
|
||||
},
|
||||
"about": "About",
|
||||
"by": "by",
|
||||
"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!",
|
||||
"credits": "Credits",
|
||||
"count_organizations": "# Organizations",
|
||||
"count_teams": "# Teams",
|
||||
"general_promise_error": "😢 Error",
|
||||
"add-your-first-track": "Add your first track",
|
||||
"no-tracks-added-yet": "there are no tracks added yet.",
|
||||
"track-length-in-m": "Track Length in m",
|
||||
"track-name": "Track name",
|
||||
"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",
|
||||
"dashboard-greeting": "hello there",
|
||||
"dashboard-title": "Dashboard",
|
||||
"track-added": "Track added",
|
||||
"track-is-being-added": "Track is being added...",
|
||||
"logout": "Logout",
|
||||
"changelog": "Changelog",
|
||||
"orgs": "Orgs",
|
||||
"users": "Users",
|
||||
"teams": "Teams",
|
||||
"faq": "FAQ",
|
||||
"this-might-take-a-moment": "This might take a moment 👀",
|
||||
"stats-are-being-loaded": "stats are being loaded...",
|
||||
"general-stats": "General Stats"
|
||||
"forgot_password?": "Forgot your password?",
|
||||
"register": "Register",
|
||||
"log_in": "Log in",
|
||||
"password": "Password",
|
||||
"log_in_to_your_account": "Log in to your account",
|
||||
"welcome_wavinghand": "Welcome 👋",
|
||||
"login_is_checked": "Login is being checked...",
|
||||
"error_on_login": "Error on login",
|
||||
"settings": "Settings",
|
||||
"your_profile": "Your Profile",
|
||||
"email_address_or_username": "Email / username",
|
||||
"tracks": "Tracks",
|
||||
"signout": "Sign out",
|
||||
"hallo": "hello",
|
||||
"404message": "Sorry, the page you are looking for could not be found.",
|
||||
"404title": "Error 404",
|
||||
"goback": "Go Home",
|
||||
"application_name": "Lauf für Kaya! - Admin",
|
||||
"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",
|
||||
"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-panic-were-resetting-it": "Don't panic, we're resetting it ✌",
|
||||
"e-mail-adress": "E-Mail Adress",
|
||||
"mail-validation-in-progress": "mail validation in progress...",
|
||||
"invalid-mail-reset": "the provided email is invalid",
|
||||
"runners": "Runners",
|
||||
"total-scans": "total scans",
|
||||
"total-donations": "total donations",
|
||||
"total-distance": "total distance",
|
||||
"datatable": {
|
||||
"search": "🔍 Search...",
|
||||
"sort_column_ascending": "Sort column ascending",
|
||||
"sort_column_descending": "Sort column descending",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"page": "Page",
|
||||
"showing": "Showing",
|
||||
"records": "Records",
|
||||
"of": "of",
|
||||
"to": "to",
|
||||
"loading": "Loading...",
|
||||
"no_matching_records_found": "No matching records found",
|
||||
"an_error_happened_while_fetching_the_data": "An error happened while fetching the data"
|
||||
},
|
||||
"about": "About",
|
||||
"by": "by",
|
||||
"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!",
|
||||
"credits": "Credits",
|
||||
"count_organizations": "# Organizations",
|
||||
"count_teams": "# Teams",
|
||||
"general_promise_error": "😢 Error",
|
||||
"add-your-first-track": "Add your first track",
|
||||
"no-tracks-added-yet": "there are no tracks added yet.",
|
||||
"track-length-in-m": "Track Length in m",
|
||||
"track-name": "Track name",
|
||||
"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",
|
||||
"dashboard-greeting": "hello there",
|
||||
"dashboard-title": "Dashboard",
|
||||
"track-added": "Track added",
|
||||
"track-is-being-added": "Track is being added...",
|
||||
"logout": "Logout",
|
||||
"changelog": "Changelog",
|
||||
"orgs": "Orgs",
|
||||
"users": "Users",
|
||||
"teams": "Teams",
|
||||
"faq": "FAQ",
|
||||
"minimum-lap-time-in-s": "Minimum lap time in s",
|
||||
"action": "Action",
|
||||
"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