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
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue