auto generate summit log on gpx upload
This commit is contained in:
@@ -133,7 +133,7 @@
|
||||
>
|
||||
<span
|
||||
><i class="fa fa-clock mr-2"></i>{formatTimeHHMM(
|
||||
totals.duration,
|
||||
totals.duration / 1000 / 60,
|
||||
)}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user