{#if mode !== "list"} {/if}
getFileURL(trail, p))} bind:this={gallery} > {#each headerPhotos as photo, i} {#if isVideoURL(photo)} {:else} gallery.openGallery(i) : null} class:row-span-2={i == 0 && headerPhotos.length > 2} src={photo} alt="" /> {/if} {/each}
{#if editingTags}
{:else if trail.expand?.tags && trail.expand.tags.length > 0}
{#each trail.expand.tags as tag} {/each} {#if canEditTrail} {/if}
{:else if canEditTrail} {/if} {#if (trail.public || trailIsShared) && $currentUser}
{#if trail.public && $currentUser} {/if} {#if trailIsShared} {/if}
{/if}
{#if editingName}
{ if (e.key === "Enter") { void saveNameEdit(); } else if (e.key === "Escape") { editingName = false; } }} />
{:else}

{trail.name}

{#if canEditTrail} {/if}
{/if} {#if trail.date}
{new Date(trail.date).toLocaleDateString( undefined, { month: "long", day: "2-digit", year: "numeric", timeZone: "UTC", }, )}
{/if} {#if trail.expand?.author}

{$_("by")} avatar {handleFromRecordWithIRI(trail)}

{/if}
{#if trail.location}

{trail.location}

{/if}

{$_(trail.difficulty ?? "?")}

{$_( trail.completed ? "completed" : "not-completed", )}

{#if ($currentUser && $currentUser.actor == trail.author) || trail.expand?.trail_share_via_trail?.length || trail.public} {/if} ([trail])} onDelete={() => history.length ? history.back() : goto("/trails")} onMerge={handleTrailMerge} {mode} >
{#if mode == "overview"} {$_("distance")} {:else} {/if} {formatDistance(trail.distance)}
{#if mode == "overview"} {$_("est-duration")} {:else} {/if} {formatTimeHHMM(trail.duration)}
{#if mode == "overview"} {$_("elevation-gain")} {:else} {/if} {formatElevation(trail.elevation_gain)}
{#if mode == "overview"} {$_("elevation-loss")} {:else} {/if} {formatElevation(trail.elevation_loss)}
{#if trail.expand?.category}
{#if mode == "overview"} {$_("category")} {:else} {/if} {displayCategoryName(trail.expand.category, $locale)} {#if trail.expand?.subcategory} / {displaySubcategoryLabel( trail.expand.subcategory, $locale, )} {/if}
{/if}

{$_("description")}

{#if canEditTrail && !editingDescription} {/if}
{#if editingDescription}
{:else if trail.description?.length}
{@html !fullDescription ? trail.description?.substring(0, 300) : trail.description} {#if (trail.description?.length ?? 0) > 300 && !fullDescription} {/if}
{:else} {/if}

{$_("route", { values: { n: 1 } })}

{#if mode === "overview"}
{/if}
{#if $currentUser && activeTab == 0 && mode != "list"} {/if}
{#if activeTab == 0}
{#if summitLogsLoading} {:else} beforeSummitLogModalOpen(log)} ondelete={(log) => beforeConfirmModalOpen(log)} > {/if}
{/if} {#if activeTab == 1} {#if trail.photos.length} {:else} {/if} {/if} {#if activeTab == 2}
{#if $currentUser}
avatar
{/if} {#if commentsLoading} {#each { length: 3 } as _, index} {/each} {:else if $comments.length == 0}
{:else}
    {#each $comments ?? [] as comment}
  • {/each}
{/if}
{/if}
{#if mode == "overview"}
{/if}
saveSummitLog(log)} >