forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
8109c13b38
commit
297bb1c498
185 changed files with 2826 additions and 5874 deletions
|
|
@ -13,8 +13,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
|
||||
<button on:click={() => clear()}>
|
||||
<Trash class="w-6 h-6" />
|
||||
<Trash class="h-6 w-6" />
|
||||
<Tr t={Translations.t.general.removeLocationHistory} />
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
import ThemeConfig from "../../Models/ThemeConfig/ThemeConfig"
|
||||
import { ImmutableStore } from "../../Logic/UIEventSource"
|
||||
|
||||
export let state: { theme?: ThemeConfig, mapProperties?: MapProperties }
|
||||
export let state: { theme?: ThemeConfig; mapProperties?: MapProperties }
|
||||
|
||||
const t = Translations.t.general.attribution
|
||||
const layoutToUse = state.theme
|
||||
|
|
@ -27,27 +27,28 @@
|
|||
maintainer = t.themeBy.Subs({ author: layoutToUse.credits })
|
||||
}
|
||||
|
||||
const bgMapAttribution = state.mapProperties?.rasterLayer?.mapD((layer) => {
|
||||
const props = layer.properties
|
||||
const attrUrl = props.attribution?.url
|
||||
const attrText = props.attribution?.text
|
||||
const bgMapAttribution =
|
||||
state.mapProperties?.rasterLayer?.mapD((layer) => {
|
||||
const props = layer.properties
|
||||
const attrUrl = props.attribution?.url
|
||||
const attrText = props.attribution?.text
|
||||
|
||||
let bgAttr: BaseUIElement | string = undefined
|
||||
if (attrText && attrUrl) {
|
||||
bgAttr = "<a href='" + attrUrl + "' target='_blank' rel='noopener'>" + attrText + "</a>"
|
||||
} else if (attrUrl) {
|
||||
bgAttr = attrUrl
|
||||
} else {
|
||||
bgAttr = attrText
|
||||
}
|
||||
if (bgAttr) {
|
||||
return Translations.t.general.attribution.attributionBackgroundLayerWithCopyright.Subs({
|
||||
name: props.name,
|
||||
copyright: bgAttr,
|
||||
})
|
||||
}
|
||||
return Translations.t.general.attribution.attributionBackgroundLayer.Subs(props)
|
||||
}) ?? new ImmutableStore(undefined)
|
||||
let bgAttr: BaseUIElement | string = undefined
|
||||
if (attrText && attrUrl) {
|
||||
bgAttr = "<a href='" + attrUrl + "' target='_blank' rel='noopener'>" + attrText + "</a>"
|
||||
} else if (attrUrl) {
|
||||
bgAttr = attrUrl
|
||||
} else {
|
||||
bgAttr = attrText
|
||||
}
|
||||
if (bgAttr) {
|
||||
return Translations.t.general.attribution.attributionBackgroundLayerWithCopyright.Subs({
|
||||
name: props.name,
|
||||
copyright: bgAttr,
|
||||
})
|
||||
}
|
||||
return Translations.t.general.attribution.attributionBackgroundLayer.Subs(props)
|
||||
}) ?? new ImmutableStore(undefined)
|
||||
|
||||
function calculateDataContributions(contributions: Map<string, number>): Translation {
|
||||
if (contributions === undefined) {
|
||||
|
|
@ -83,9 +84,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
const datacontributions = (state.mapProperties ? new ContributorCount(<any>state).Contributors : new ImmutableStore([])).map((counts) =>
|
||||
calculateDataContributions(counts)
|
||||
)
|
||||
const datacontributions = (
|
||||
state.mapProperties ? new ContributorCount(<any>state).Contributors : new ImmutableStore([])
|
||||
).map((counts) => calculateDataContributions(counts))
|
||||
|
||||
function codeContributors(
|
||||
contributors,
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@
|
|||
|
||||
export let state: {
|
||||
favourites: FavouritesFeatureSource
|
||||
guistate: MenuState,
|
||||
osmConnection: OsmConnection,
|
||||
theme?: ThemeConfig,
|
||||
featureSwitches: Partial<FeatureSwitchState>,
|
||||
mapProperties?: MapProperties,
|
||||
guistate: MenuState
|
||||
osmConnection: OsmConnection
|
||||
theme?: ThemeConfig
|
||||
featureSwitches: Partial<FeatureSwitchState>
|
||||
mapProperties?: MapProperties
|
||||
userRelatedState?: UserRelatedState
|
||||
}
|
||||
let hotkeys = Hotkeys._docs
|
||||
|
|
@ -240,15 +240,15 @@
|
|||
<a
|
||||
class="flex"
|
||||
href={"https://source.mapcomplete.org/MapComplete/MapComplete/src/branch/develop/Docs/Themes/" +
|
||||
theme.id +
|
||||
".md"}
|
||||
theme.id +
|
||||
".md"}
|
||||
target="_blank"
|
||||
>
|
||||
<DocumentMagnifyingGlass class="h-6 w-6" />
|
||||
<Tr
|
||||
t={Translations.t.general.attribution.openThemeDocumentation.Subs({
|
||||
name: theme.title,
|
||||
})}
|
||||
name: theme.title,
|
||||
})}
|
||||
/>
|
||||
</a>
|
||||
|
||||
|
|
@ -256,10 +256,13 @@
|
|||
<QueueList class="h-6 w-6" />
|
||||
<Tr t={Translations.t.general.attribution.openOsmcha.Subs({ theme: theme.title })} />
|
||||
</a>
|
||||
<a class="flex" href={`./statistics.html?filter-mapcomplete-changes-theme-search={"search"%3A"${theme.id}"}`}
|
||||
target="_blank">
|
||||
<a
|
||||
class="flex"
|
||||
href={`./statistics.html?filter-mapcomplete-changes-theme-search={"search"%3A"${theme.id}"}`}
|
||||
target="_blank"
|
||||
>
|
||||
<ChartBar class="h-6 w-6" />
|
||||
<Tr t={Translations.t.general.attribution.openStatistics.Subs({theme: theme.title})} />
|
||||
<Tr t={Translations.t.general.attribution.openStatistics.Subs({ theme: theme.title })} />
|
||||
</a>
|
||||
{/if}
|
||||
</SidebarUnit>
|
||||
|
|
@ -305,7 +308,6 @@
|
|||
<Tr t={Translations.t.general.morescreen.createYourOwnTheme} />
|
||||
</a>
|
||||
|
||||
|
||||
<a class="flex" href="mailto:info@mapcomplete.org">
|
||||
<EnvelopeOpen class="h-6 w-6" />
|
||||
<Tr t={Translations.t.general.attribution.emailCreators} />
|
||||
|
|
@ -321,7 +323,6 @@
|
|||
<Tr t={Translations.t.general.attribution.donate} />
|
||||
</a>
|
||||
|
||||
|
||||
<a
|
||||
class="flex"
|
||||
href="https://source.mapcomplete.org/MapComplete/MapComplete/issues"
|
||||
|
|
@ -340,7 +341,6 @@
|
|||
<Tr t={Translations.t.translations.activateButton} />
|
||||
</a>
|
||||
|
||||
|
||||
<a
|
||||
class="flex"
|
||||
href={window.location.protocol + "//" + window.location.host + "/inspector.html"}
|
||||
|
|
@ -350,10 +350,9 @@
|
|||
</a>
|
||||
|
||||
{#if !state.theme}
|
||||
<a class="flex" href={`./statistics.html`}
|
||||
target="_blank">
|
||||
<a class="flex" href={`./statistics.html`} target="_blank">
|
||||
<ChartBar class="h-6 w-6" />
|
||||
<Tr t={Translations.t.general.attribution.openStatistics.Subs({theme: "MapComplete"})} />
|
||||
<Tr t={Translations.t.general.attribution.openStatistics.Subs({ theme: "MapComplete" })} />
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
|
|
@ -389,11 +388,10 @@
|
|||
<Tr t={Translations.t.privacy.title} />
|
||||
</svelte:fragment>
|
||||
<PrivacyPolicy {state} />
|
||||
<a href="./privacy.html" class="button w-fit float-right" target="_blank">
|
||||
<ArrowTopRightOnSquare class="w-8 h-8" />
|
||||
<a href="./privacy.html" class="button float-right w-fit" target="_blank">
|
||||
<ArrowTopRightOnSquare class="h-8 w-8" />
|
||||
</a>
|
||||
</Page>
|
||||
|
||||
</SidebarUnit>
|
||||
|
||||
<div class="subtle self-end">
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
const errors = changes?.errors
|
||||
const pending = changes?.pendingChanges
|
||||
</script>
|
||||
|
||||
{#if changes}
|
||||
<div
|
||||
class="pointer-events-auto flex flex-col"
|
||||
|
|
|
|||
|
|
@ -13,12 +13,14 @@
|
|||
const editThemeHistory = usersettings.tagRenderings.find((tr) => tr.id === "sync-visited-themes")
|
||||
const editReviews = usersettings.tagRenderings.find((tr) => tr.id === "mangrove-reviews-allowed")
|
||||
|
||||
const editLocationHistory = usersettings.tagRenderings.find((tr) => tr.id === "sync-visited-locations")
|
||||
const editLocationHistory = usersettings.tagRenderings.find(
|
||||
(tr) => tr.id === "sync-visited-locations"
|
||||
)
|
||||
|
||||
const selectedElement: Feature = {
|
||||
type: "Feature",
|
||||
properties: { id: "settings" },
|
||||
geometry: { type: "Point", coordinates: [0, 0] }
|
||||
geometry: { type: "Point", coordinates: [0, 0] },
|
||||
}
|
||||
const isLoggedIn = state.osmConnection.isLoggedIn
|
||||
</script>
|
||||
|
|
@ -93,7 +95,6 @@
|
|||
/>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<TagRenderingEditable
|
||||
config={editThemeHistory}
|
||||
{selectedElement}
|
||||
|
|
@ -102,8 +103,7 @@
|
|||
/>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{:else }
|
||||
{:else}
|
||||
<button class="as-link" on:click={() => state.osmConnection.AttemptLogin()}>
|
||||
<Tr t={t.browsingHistoryNotLoggedIn} />
|
||||
</button>
|
||||
|
|
@ -120,7 +120,6 @@
|
|||
tags={state.userRelatedState.preferencesAsTags}
|
||||
/>
|
||||
|
||||
|
||||
<h3>
|
||||
<Tr t={t.whileYoureHere} />
|
||||
</h3>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ export default class StatisticsForLayerPanel extends VariableUiElement {
|
|||
super(
|
||||
elementsInview.features.stabilized(1000).map(
|
||||
(features) => {
|
||||
|
||||
const els: BaseUIElement[] = []
|
||||
const featuresForLayer = features
|
||||
if (featuresForLayer.length === 0) {
|
||||
|
|
|
|||
|
|
@ -276,13 +276,8 @@ export default class TagRenderingChart extends Combine {
|
|||
}
|
||||
|
||||
super([
|
||||
new Title(
|
||||
options?.includeTitle ? tagRendering.question ?? tagRendering.id : undefined
|
||||
),
|
||||
new Combine([
|
||||
|
||||
chart
|
||||
]).SetClass("flex flex-col justify-center h-full")
|
||||
new Title(options?.includeTitle ? tagRendering.question ?? tagRendering.id : undefined),
|
||||
new Combine([chart]).SetClass("flex flex-col justify-center h-full"),
|
||||
])
|
||||
|
||||
this.SetClass("block")
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@
|
|||
<section class="w-full">
|
||||
<slot name="title" />
|
||||
<div
|
||||
class={onlyIcons ? "flex gap-x-2 flex-wrap items-center justify-center" : ("theme-list my-2 gap-4 md:grid md:grid-flow-row md:grid-cols-2 lg:grid-cols-3")}>
|
||||
class={onlyIcons
|
||||
? "flex flex-wrap items-center justify-center gap-x-2"
|
||||
: "theme-list my-2 gap-4 md:grid md:grid-flow-row md:grid-cols-2 lg:grid-cols-3"}
|
||||
>
|
||||
{#each Utils.NoNull(themes) as theme (theme.id)}
|
||||
<ThemeButton {theme} {state} iconOnly={onlyIcons}>
|
||||
{#if $search && hasSelection && themes?.[0] === theme}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue