auto generate summit log on gpx upload
This commit is contained in:
@@ -133,7 +133,7 @@
|
|||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
><i class="fa fa-clock mr-2"></i>{formatTimeHHMM(
|
><i class="fa fa-clock mr-2"></i>{formatTimeHHMM(
|
||||||
totals.duration,
|
totals.duration / 1000 / 60,
|
||||||
)}</span
|
)}</span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
<td>
|
<td>
|
||||||
{formatElevation(totals?.elevationGain)}
|
{formatElevation(totals?.elevationGain)}
|
||||||
</td><td>
|
</td><td>
|
||||||
{formatTimeHHMM(totals?.duration)}
|
{formatTimeHHMM(totals ? (totals?.duration / 1000 / 60) : undefined)}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{#if log.text}
|
{#if log.text}
|
||||||
|
|||||||
@@ -290,6 +290,12 @@
|
|||||||
$form.expand.gpx_data = gpxData;
|
$form.expand.gpx_data = gpxData;
|
||||||
$form.category = $page.data.settings.category || $categories[0].id;
|
$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);
|
setRoute(parseResult.gpx);
|
||||||
initRouteAnchors(parseResult.gpx);
|
initRouteAnchors(parseResult.gpx);
|
||||||
|
|
||||||
@@ -763,6 +769,7 @@
|
|||||||
label={$_("describe-your-trail")}
|
label={$_("describe-your-trail")}
|
||||||
bind:value={$form.description}
|
bind:value={$form.description}
|
||||||
></Textarea>
|
></Textarea>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-y-4">
|
||||||
<Select
|
<Select
|
||||||
name="difficulty"
|
name="difficulty"
|
||||||
label={$_("difficulty")}
|
label={$_("difficulty")}
|
||||||
@@ -777,8 +784,13 @@
|
|||||||
name="category"
|
name="category"
|
||||||
label={$_("category")}
|
label={$_("category")}
|
||||||
bind:value={$form.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>
|
></Select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Toggle name="public" label={$_("public")} bind:value={$form.public}
|
<Toggle name="public" label={$_("public")} bind:value={$form.public}
|
||||||
></Toggle>
|
></Toggle>
|
||||||
<hr class="border-separator" />
|
<hr class="border-separator" />
|
||||||
|
|||||||
Reference in New Issue
Block a user