forked from MapComplete/MapComplete
Actually shorten list of contributors
This commit is contained in:
parent
806a91c6fa
commit
1900140dd5
1 changed files with 15 additions and 10 deletions
|
@ -12,6 +12,7 @@ import Link from "../Base/Link";
|
||||||
import {VariableUiElement} from "../Base/VariableUIElement";
|
import {VariableUiElement} from "../Base/VariableUIElement";
|
||||||
import {UIElement} from "../UIElement";
|
import {UIElement} from "../UIElement";
|
||||||
import * as contributors from "../../assets/contributors.json"
|
import * as contributors from "../../assets/contributors.json"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attribution panel shown on mobile
|
* The attribution panel shown on mobile
|
||||||
*/
|
*/
|
||||||
|
@ -67,19 +68,23 @@ export default class AttributionPanel extends Combine {
|
||||||
this.SetStyle("max-width: calc(100vw - 5em); width: 40em;")
|
this.SetStyle("max-width: calc(100vw - 5em); width: 40em;")
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CodeContributors() : UIElement{
|
private static CodeContributors(): UIElement {
|
||||||
|
|
||||||
const total = contributors.contributors.length;
|
const total = contributors.contributors.length;
|
||||||
const filtered = contributors.contributors
|
let filtered = contributors.contributors
|
||||||
.splice(10, total - 10)
|
.splice(10, total - 10);
|
||||||
.map(c => c.contributor)
|
|
||||||
.join(", ")
|
let contribsStr = filtered.map(c => c.contributor)
|
||||||
|
.join(", ")
|
||||||
|
|
||||||
return Translations.t.general.attribution.codeContributionsBy.Subs({contributors: filtered, hiddenCount: total - 10});
|
|
||||||
|
return Translations.t.general.attribution.codeContributionsBy.Subs({
|
||||||
|
contributors: contribsStr,
|
||||||
|
hiddenCount: total - 10
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IconAttribution(iconPath: string) : UIElement{
|
private static IconAttribution(iconPath: string): UIElement {
|
||||||
if (iconPath.startsWith("http")) {
|
if (iconPath.startsWith("http")) {
|
||||||
iconPath = "." + new URL(iconPath).pathname;
|
iconPath = "." + new URL(iconPath).pathname;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue