auto generate summit log on gpx upload

This commit is contained in:
Christian Beutel
2024-11-02 13:55:24 +01:00
parent ebfd6f0e72
commit 0d8ff5c83b
3 changed files with 31 additions and 19 deletions

View File

@@ -133,7 +133,7 @@
>
<span
><i class="fa fa-clock mr-2"></i>{formatTimeHHMM(
totals.duration,
totals.duration / 1000 / 60,
)}</span
>
</div>

View File

@@ -98,7 +98,7 @@
<td>
{formatElevation(totals?.elevationGain)}
</td><td>
{formatTimeHHMM(totals?.duration)}
{formatTimeHHMM(totals ? (totals?.duration / 1000 / 60) : undefined)}
</td>
<td>
{#if log.text}

View File

@@ -290,6 +290,12 @@
$form.expand.gpx_data = gpxData;
$form.category = $page.data.settings.category || $categories[0].id;
const log = new SummitLog(parseResult.trail.date as string, {})
log.expand.gpx_data = gpxData;
log._gpx = selectedFile;
$form.expand.summit_logs.push(log);
setRoute(parseResult.gpx);
initRouteAnchors(parseResult.gpx);
@@ -763,6 +769,7 @@
label={$_("describe-your-trail")}
bind:value={$form.description}
></Textarea>
<div class="grid grid-cols-1 md:grid-cols-2 gap-y-4">
<Select
name="difficulty"
label={$_("difficulty")}
@@ -777,8 +784,13 @@
name="category"
label={$_("category")}
bind:value={$form.category}
items={$categories.map((c) => ({ text: $_(c.name), value: c.id }))}
items={$categories.map((c) => ({
text: $_(c.name),
value: c.id,
}))}
></Select>
</div>
<Toggle name="public" label={$_("public")} bind:value={$form.public}
></Toggle>
<hr class="border-separator" />