* initial commit federation * more federation * more federation * more federation * completes follow, accept, undo * add trail create activity * process trail create activity * more trail create activity * adds missing endpoints * adds update and delete activity * adds comment activities * adds activities back * adds summit logs activities * deletes follow counts table * fixes migrations * fixes migrations * fixes migrations * fixes migrations * adds remote profiles * ctd * ctd * we are getting closer... * adds public summit logs * fixes federated trails in lists * adds remote lists * adds list activites * fixes lists * adds notifications * adds iri redirect * fixes comments and summitlogs * fixes follows and profiles * adds asynchronous send * fixes list search * adds encryption key * bug fixes * fixes activity signing * removes custon activity object types * adds html editor * fixes html editor * fixes display issues on mastodon * adds federated sharing * finishes announcements * fixes small summit log issues * adds trail likes * finalizes likes * fixes images for komoot * add disable federation option * adds private profiles * updates docs * adds federated comments * adds trail and comments actvitiypub routes * adds mentions to editor * adds mentions to trails, comments, summit logs * updates theme * updates theme * update docs * update docs * updates docs * fixes various frontend problems * fixes activitypub follows api * updates docs * updates docs --------- Co-authored-by: Christian Beutel <>
88 lines
2.6 KiB
Svelte
88 lines
2.6 KiB
Svelte
<script lang="ts">
|
|
import Modal from "$lib/components/base/modal.svelte";
|
|
import { _ } from "svelte-i18n";
|
|
import Select from "../base/select.svelte";
|
|
|
|
interface Props {
|
|
title?: string;
|
|
onexport?: (settings: typeof exportSettings) => void;
|
|
}
|
|
|
|
let { title = $_("export"), onexport }: Props = $props();
|
|
|
|
let modal: Modal;
|
|
|
|
export function openModal() {
|
|
modal.openModal();
|
|
}
|
|
|
|
const fileFormats = [
|
|
{ text: "GPX", value: "gpx" },
|
|
{ text: "GeoJSON", value: "json" },
|
|
];
|
|
|
|
const exportSettings: {
|
|
fileFormat: "gpx" | "json";
|
|
photos: boolean;
|
|
summitLog: boolean;
|
|
} = $state({
|
|
fileFormat: "gpx",
|
|
photos: false,
|
|
summitLog: false,
|
|
});
|
|
|
|
function exportTrail() {
|
|
onexport?.(exportSettings);
|
|
modal.closeModal();
|
|
}
|
|
</script>
|
|
|
|
<Modal id="export-modal" {title} size="md:min-w-sm" bind:this={modal}>
|
|
{#snippet content()}
|
|
<div>
|
|
<div class="mb-3">
|
|
<Select
|
|
bind:value={exportSettings.fileFormat}
|
|
items={fileFormats}
|
|
label={$_("file-format")}
|
|
></Select>
|
|
</div>
|
|
<div class="mb-2">
|
|
<input
|
|
id="include-photos-checkbox"
|
|
type="checkbox"
|
|
bind:checked={exportSettings.photos}
|
|
class="w-4 h-4 bg-input-background accent-primary border-input-border focus:ring-input-ring focus:ring-2"
|
|
/>
|
|
<label for="include-photos-checkbox" class="ms-2 text-sm"
|
|
>{$_("photos")}</label
|
|
>
|
|
</div>
|
|
<div class="mb-2">
|
|
<input
|
|
id="include-summit-log-checkbox"
|
|
type="checkbox"
|
|
bind:checked={exportSettings.summitLog}
|
|
class="w-4 h-4 bg-input-background accent-primary border-input-border focus:ring-input-ring focus:ring-2"
|
|
/>
|
|
<label for="include-summit-log-checkbox" class="ms-2 text-sm"
|
|
>{$_("summit-book")}</label
|
|
>
|
|
</div>
|
|
</div>
|
|
{/snippet}
|
|
{#snippet footer()}
|
|
<div class="flex items-center gap-4">
|
|
<button class="btn-secondary" onclick={() => modal.closeModal()}
|
|
>{$_("cancel")}</button
|
|
>
|
|
<button
|
|
class="btn-primary"
|
|
type="button"
|
|
onclick={exportTrail}
|
|
name="save">{$_("export")}</button
|
|
>
|
|
</div>
|
|
{/snippet}</Modal
|
|
>
|