forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
c9ce29f206
commit
40e894df8b
294 changed files with 14209 additions and 4192 deletions
|
|
@ -95,7 +95,6 @@
|
|||
</div>
|
||||
{:else}
|
||||
<TitledPanel>
|
||||
|
||||
<Tr slot="title" t={Translations.t.notes.createNoteTitle} />
|
||||
|
||||
{#if !$isDisplayed}
|
||||
|
|
@ -107,57 +106,52 @@
|
|||
<Tr slot="message" t={Translations.t.notes.noteLayerDoEnable} />
|
||||
</SubtleButton>
|
||||
{:else if $hasFilter}
|
||||
<!-- ...but a filter is set ...-->
|
||||
<div class="alert">
|
||||
<Tr t={Translations.t.notes.noteLayerHasFilters} />
|
||||
</div>
|
||||
<SubtleButton on:click={() => notelayer.disableAllFilters()}>
|
||||
<Layers class="mr-4 h-8 w-8" />
|
||||
<Tr slot="message" t={Translations.t.notes.disableAllNoteFilters} />
|
||||
</SubtleButton>
|
||||
<!-- ...but a filter is set ...-->
|
||||
<div class="alert">
|
||||
<Tr t={Translations.t.notes.noteLayerHasFilters} />
|
||||
</div>
|
||||
<SubtleButton on:click={() => notelayer.disableAllFilters()}>
|
||||
<Layers class="mr-4 h-8 w-8" />
|
||||
<Tr slot="message" t={Translations.t.notes.disableAllNoteFilters} />
|
||||
</SubtleButton>
|
||||
{:else}
|
||||
<!-- The layer with notes is displayed without filters, so we can add a note without worrying for duplicates -->
|
||||
<div class="h-full flex flex-col justify-between">
|
||||
<div class="flex h-full flex-col justify-between">
|
||||
<form class="flex flex-col rounded-sm p-2" on:submit|preventDefault={uploadNote}>
|
||||
<label class="neutral-label">
|
||||
<Tr t={Translations.t.notes.createNoteIntro} />
|
||||
<div class="w-full p-1">
|
||||
<ValidatedInput autofocus={true} type="text" value={comment} />
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<form
|
||||
class="flex flex-col rounded-sm p-2"
|
||||
on:submit|preventDefault={uploadNote}
|
||||
>
|
||||
<label class="neutral-label">
|
||||
<Tr t={Translations.t.notes.createNoteIntro} />
|
||||
<div class="w-full p-1">
|
||||
<ValidatedInput autofocus={true} type="text" value={comment} />
|
||||
</div>
|
||||
</label>
|
||||
<LoginToggle {state}>
|
||||
<span slot="loading"><!--empty: don't show a loading message--></span>
|
||||
<div slot="not-logged-in" class="alert">
|
||||
<Tr t={Translations.t.notes.warnAnonymous} />
|
||||
</div>
|
||||
</LoginToggle>
|
||||
|
||||
<LoginToggle {state}>
|
||||
<span slot="loading"><!--empty: don't show a loading message--></span>
|
||||
<div slot="not-logged-in" class="alert">
|
||||
<Tr t={Translations.t.notes.warnAnonymous} />
|
||||
</div>
|
||||
</LoginToggle>
|
||||
{#if $comment?.length >= 3}
|
||||
<NextButton on:click={uploadNote} clss="self-end primary">
|
||||
<AddSmall slot="image" class="mr-4 h-8 w-8" />
|
||||
<Tr t={Translations.t.notes.createNote} />
|
||||
</NextButton>
|
||||
{:else}
|
||||
<div class="alert">
|
||||
<Tr t={Translations.t.notes.textNeeded} />
|
||||
</div>
|
||||
{/if}
|
||||
</form>
|
||||
|
||||
{#if $comment?.length >= 3}
|
||||
<NextButton on:click={uploadNote} clss="self-end primary">
|
||||
<AddSmall slot="image" class="mr-4 h-8 w-8" />
|
||||
<Tr t={Translations.t.notes.createNote} />
|
||||
</NextButton>
|
||||
{:else}
|
||||
<div class="alert">
|
||||
<Tr t={Translations.t.notes.textNeeded} />
|
||||
</div>
|
||||
{/if}
|
||||
</form>
|
||||
|
||||
<div class="h-56 w-full">
|
||||
<NewPointLocationInput value={coordinate} {state}>
|
||||
<div class="h-20 w-full pb-10" slot="image">
|
||||
<Note class="h-10 w-full" />
|
||||
</div>
|
||||
</NewPointLocationInput>
|
||||
<div class="h-56 w-full">
|
||||
<NewPointLocationInput value={coordinate} {state}>
|
||||
<div class="h-20 w-full pb-10" slot="image">
|
||||
<Note class="h-10 w-full" />
|
||||
</div>
|
||||
</NewPointLocationInput>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
</TitledPanel>
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
let userinfo = Stores.FromPromise(
|
||||
Utils.downloadJsonCached<{ user: { img: { href: string } } }>(
|
||||
"https://api.openstreetmap.org/api/0.6/user/" + comment.uid,
|
||||
24 * 60 * 60 * 1000,
|
||||
),
|
||||
24 * 60 * 60 * 1000
|
||||
)
|
||||
)
|
||||
|
||||
const htmlElement = document.createElement("div")
|
||||
|
|
@ -44,23 +44,27 @@
|
|||
})
|
||||
.filter((link) => !link.startsWith("https://wiki.openstreetmap.org/wiki/File:"))
|
||||
|
||||
|
||||
const attributedImages = AllImageProviders.loadImagesFrom(images)
|
||||
/**
|
||||
* Class of the little icons indicating 'opened', 'comment' and 'resolved'
|
||||
*/
|
||||
export let iconClass = "shrink-0 w-6 mr-3 my-2 "
|
||||
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col my-2 border-gray-500 border-b" class:border-interactive={comment.highlighted}>
|
||||
|
||||
<div
|
||||
class="my-2 flex flex-col border-b border-gray-500"
|
||||
class:border-interactive={comment.highlighted}
|
||||
>
|
||||
<div class="flex items-center">
|
||||
|
||||
<!-- Action icon, e.g. 'created', 'commented', 'closed' -->
|
||||
|
||||
{#if $userinfo?.user?.img?.href}
|
||||
<img alt="avatar" aria-hidden="true" src={$userinfo?.user?.img?.href} class="rounded-full w-10 h-10 mr-3" />
|
||||
<img
|
||||
alt="avatar"
|
||||
aria-hidden="true"
|
||||
src={$userinfo?.user?.img?.href}
|
||||
class="mr-3 h-10 w-10 rounded-full"
|
||||
/>
|
||||
{:else if comment.action === "opened" || comment.action === "reopened"}
|
||||
<Note class={iconClass} />
|
||||
{:else if comment.action === "closed"}
|
||||
|
|
@ -74,7 +78,10 @@
|
|||
</div>
|
||||
|
||||
{#if $attributedImages?.length > 0}
|
||||
<div class="flex justify-center w-full space-x-4 overflow-x-auto" style="scroll-snap-type: x proximity">
|
||||
<div
|
||||
class="flex w-full justify-center space-x-4 overflow-x-auto"
|
||||
style="scroll-snap-type: x proximity"
|
||||
>
|
||||
{#each $attributedImages as image (image.id)}
|
||||
<AttributedImage
|
||||
{state}
|
||||
|
|
@ -82,14 +89,12 @@
|
|||
imgClass="max-h-64 w-auto sm:h-32 md:h-64"
|
||||
previewedImage={state.previewedImage}
|
||||
attributionFormat="minimal"
|
||||
>
|
||||
</AttributedImage>
|
||||
{/each}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<div class="flex justify-end items-center subtle py-2">
|
||||
<div class="subtle flex items-center justify-end py-2">
|
||||
<!-- commenter info -->
|
||||
<span class="mr-2">
|
||||
{#if comment.user === undefined}
|
||||
|
|
@ -99,6 +104,5 @@
|
|||
{/if}
|
||||
{comment.date}
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import { Store, UIEventSource } from "../../../Logic/UIEventSource"
|
||||
|
||||
export default class NoteCommentElement {
|
||||
|
||||
|
||||
/**
|
||||
* Adds the comment to the _visualisation_ of the given note; doesn't _actually_ upload
|
||||
* @param txt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue