diff --git a/Customizations/AllKnownLayers.ts b/Customizations/AllKnownLayers.ts index b740ded355..ff92d2e5cb 100644 --- a/Customizations/AllKnownLayers.ts +++ b/Customizations/AllKnownLayers.ts @@ -28,7 +28,7 @@ export default class AllKnownLayers { if (typeof layer === "string") { continue; } - if(layer.builtin !== undefined){ + if (layer.builtin !== undefined) { // This is a builtin layer of which stuff is overridden - skip continue; } @@ -37,7 +37,9 @@ export default class AllKnownLayers { sharedLayers.set(layer.id, parsed); sharedLayers[layer.id] = parsed; } catch (e) { - console.error("Could not parse a layer in theme ", layout.id, "due to", e) + if (!Utils.runningFromConsole) { + console.error("Could not parse a layer in theme ", layout.id, "due to", e) + } } } } diff --git a/UI/BigComponents/AttributionPanel.ts b/UI/BigComponents/AttributionPanel.ts index 711d099e97..1568c34bd7 100644 --- a/UI/BigComponents/AttributionPanel.ts +++ b/UI/BigComponents/AttributionPanel.ts @@ -10,7 +10,8 @@ import SmallLicense from "../../Models/smallLicense"; import {Utils} from "../../Utils"; import Link from "../Base/Link"; import {VariableUiElement} from "../Base/VariableUIElement"; - +import {UIElement} from "../UIElement"; +import * as contributors from "../../assets/contributors.json" /** * The attribution panel shown on mobile */ @@ -57,6 +58,7 @@ export default class AttributionPanel extends Combine { })), "
", + AttributionPanel.CodeContributors(), "

", Translations.t.general.attribution.iconAttribution.title.Clone().SetClass("pt-6 pb-3"), "

", ...Utils.NoNull(Array.from(layoutToUse.data.ExtractImages())) .map(AttributionPanel.IconAttribution) @@ -65,7 +67,19 @@ export default class AttributionPanel extends Combine { this.SetStyle("max-width: calc(100vw - 5em); width: 40em;") } - private static IconAttribution(iconPath: string) { + private static CodeContributors() : UIElement{ + + const total = contributors.contributors.length; + const filtered = contributors.contributors + .splice(10, total - 10) + .map(c => c.contributor) + .join(", ") + + + return Translations.t.general.attribution.codeContributionsBy.Subs({contributors: filtered, hiddenCount: total - 10}); + } + + private static IconAttribution(iconPath: string) : UIElement{ if (iconPath.startsWith("http")) { iconPath = "." + new URL(iconPath).pathname; } diff --git a/assets/contributors.json b/assets/contributors.json index aec23b63eb..deaf4ea3db 100644 --- a/assets/contributors.json +++ b/assets/contributors.json @@ -1,108 +1 @@ -{ - "contributors": [ - { - "contributor": "Noémie", - "commits": 1 - }, - { - "contributor": "Schouppe Joost", - "commits": 1 - }, - { - "contributor": "tbowdecl97", - "commits": 1 - }, - { - "contributor": "Thibault Molleman", - "commits": 1 - }, - { - "contributor": "Tomas Fiers", - "commits": 1 - }, - { - "contributor": "David Haberthür", - "commits": 2 - }, - { - "contributor": "graveelius", - "commits": 2 - }, - { - "contributor": "pbarban", - "commits": 2 - }, - { - "contributor": "Sebastian Kürten", - "commits": 2 - }, - { - "contributor": "Stanislas Gueniffey", - "commits": 2 - }, - { - "contributor": "Mateusz Konieczny", - "commits": 4 - }, - { - "contributor": "dependabot[bot]", - "commits": 5 - }, - { - "contributor": "pelderson", - "commits": 6 - }, - { - "contributor": "Binnette", - "commits": 7 - }, - { - "contributor": "Flo Edelmann", - "commits": 7 - }, - { - "contributor": "Joost", - "commits": 7 - }, - { - "contributor": "yopaseopor", - "commits": 7 - }, - { - "contributor": "Midgard", - "commits": 8 - }, - { - "contributor": "Bavo Vanderghote", - "commits": 12 - }, - { - "contributor": "ToastHawaii", - "commits": 15 - }, - { - "contributor": "Pieter Fiers", - "commits": 31 - }, - { - "contributor": "Win Olario", - "commits": 31 - }, - { - "contributor": "Christian Neumann", - "commits": 33 - }, - { - "contributor": "Tobias", - "commits": 35 - }, - { - "contributor": "pietervdvn", - "commits": 512 - }, - { - "contributor": "Pieter Vander Vennet", - "commits": 669 - } - ] -} \ No newline at end of file +{"contributors":[{"contributor":"Pieter Vander Vennet", "commits":691},{"contributor":"pietervdvn", "commits":587},{"contributor":"Tobias", "commits":35},{"contributor":"Christian Neumann", "commits":33},{"contributor":"Win Olario", "commits":31},{"contributor":"Pieter Fiers", "commits":31},{"contributor":"ToastHawaii", "commits":15},{"contributor":"Sebastian Kürten", "commits":14},{"contributor":"Bavo Vanderghote", "commits":12},{"contributor":"Joost", "commits":9},{"contributor":"Midgard", "commits":8},{"contributor":"yopaseopor", "commits":7},{"contributor":"Flo Edelmann", "commits":7},{"contributor":"Binnette", "commits":7},{"contributor":"pelderson", "commits":6},{"contributor":"dependabot[bot]", "commits":6},{"contributor":"Mateusz Konieczny", "commits":4},{"contributor":"Léo Villeveygoux", "commits":3},{"contributor":"Stanislas Gueniffey", "commits":2},{"contributor":"pbarban", "commits":2},{"contributor":"graveelius", "commits":2},{"contributor":"David Haberthür", "commits":2},{"contributor":"Tomas Fiers", "commits":1},{"contributor":"Thibault Molleman", "commits":1},{"contributor":"tbowdecl97", "commits":1},{"contributor":"Schouppe Joost", "commits":1},{"contributor":"Noémie", "commits":1},{"contributor":"mozita", "commits":1},{"contributor":"Hosted Weblate", "commits":1}]} \ No newline at end of file diff --git a/langs/en.json b/langs/en.json index 9d5e74e21e..cc6c3d665f 100644 --- a/langs/en.json +++ b/langs/en.json @@ -78,7 +78,8 @@ "title": "Used icons" }, "mapContributionsBy": "The current visible data has edits made by {contributors}", - "mapContributionsByAndHidden": "The current visible data has edits made by {contributors} and {hiddenCount} more contributors" + "mapContributionsByAndHidden": "The current visible data has edits made by {contributors} and {hiddenCount} more contributors", + "codeContributionsBy": "MapComplete has been built by {contributors} and {hiddenCount} more contributors" }, "sharescreen": { "intro": "

Share this map

Share this map by copying the link below and sending it to friends and family:", diff --git a/package.json b/package.json index 18299047d0..9333c77dd5 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "generate:layeroverview": "ts-node scripts/generateLayerOverview.ts --no-fail", "generate:licenses": "ts-node scripts/generateLicenseInfo.ts --no-fail", "generate:report": "cd Docs/Tools && ./compileStats.sh && git commit . -m 'New statistics ands graphs' && git push", - "generate:contributor-list": "git log --pretty='%aN' | sort | uniq -c | sort -h| sed 's/ *\\([0-9]*\\) \\(.*\\)$/{\"contributor\":\"\\2\", \"commits\":\\1}/' | tr '\\n' ',' | sed 's/^/{\"contributors\":[/' | sed 's/,$/]}/' > assets/contributors.json", + "generate:contributor-list": "git log --pretty='%aN' | sort | uniq -c | sort -hr | sed 's/ *\\([0-9]*\\) \\(.*\\)$/{\"contributor\":\"\\2\", \"commits\":\\1}/' | tr '\\n' ',' | sed 's/^/{\"contributors\":[/' | sed 's/,$/]}/' > assets/contributors.json", "validate:layeroverview": "ts-node scripts/generateLayerOverview.ts --report", "validate:licenses": "ts-node scripts/generateLicenseInfo.ts --report", "optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",