Various small fixes
This commit is contained in:
parent
1ea285d303
commit
2dd428497e
45 changed files with 776 additions and 587 deletions
|
@ -1,10 +1,7 @@
|
|||
import {LayerDefinition} from "./LayerDefinition";
|
||||
import {Layout} from "./Layout";
|
||||
import {Groen} from "./Layouts/Groen";
|
||||
import Cyclofix from "./Layouts/Cyclofix";
|
||||
import {StreetWidth} from "./Layouts/StreetWidth";
|
||||
import {MetaMap} from "./Layouts/MetaMap";
|
||||
import {Natuurpunt} from "./Layouts/Natuurpunt";
|
||||
import {FromJSON} from "./JSON/FromJSON";
|
||||
import * as bookcases from "../assets/themes/bookcases/Bookcases.json";
|
||||
import * as aed from "../assets/themes/aed/aed.json";
|
||||
|
@ -12,29 +9,55 @@ import * as toilets from "../assets/themes/toilets/toilets.json";
|
|||
import * as artworks from "../assets/themes/artwork/artwork.json";
|
||||
import * as cyclestreets from "../assets/themes/cyclestreets/cyclestreets.json";
|
||||
import * as ghostbikes from "../assets/themes/ghostbikes/ghostbikes.json"
|
||||
import * as cyclofix from "../assets/themes/cyclofix/cyclofix.json"
|
||||
import * as buurtnatuur from "../assets/themes/buurtnatuur/buurtnatuur.json"
|
||||
|
||||
import {PersonalLayout} from "../Logic/PersonalLayout";
|
||||
|
||||
export class AllKnownLayouts {
|
||||
|
||||
public static allLayers: Map<string, LayerDefinition> = undefined;
|
||||
|
||||
private static GenerateCycloFix(): Layout {
|
||||
const layout = FromJSON.LayoutFromJSON(cyclofix)
|
||||
const now = new Date();
|
||||
const m = now.getMonth() + 1;
|
||||
const day = new Date().getDay() + 1;
|
||||
const date = day + "/" + m;
|
||||
if (date === "31/10" || date === "1/11" || date === "2/11") {
|
||||
// Around Halloween/Fiesta de muerte/Allerzielen, we remember the dead
|
||||
layout.layers.push(
|
||||
FromJSON.sharedLayers.get("ghost_bike")
|
||||
);
|
||||
|
||||
}
|
||||
return layout;
|
||||
|
||||
}
|
||||
|
||||
private static GenerateBuurtNatuur(): Layout {
|
||||
const layout = FromJSON.LayoutFromJSON(buurtnatuur);
|
||||
layout.enableMoreQuests = false;
|
||||
layout.enableShareScreen = false;
|
||||
return layout;
|
||||
}
|
||||
|
||||
public static layoutsList: Layout[] = [
|
||||
new PersonalLayout(),
|
||||
new Natuurpunt(),
|
||||
new Cyclofix(),
|
||||
// new Natuurpunt(),
|
||||
AllKnownLayouts.GenerateBuurtNatuur(),
|
||||
FromJSON.LayoutFromJSON(bookcases),
|
||||
FromJSON.LayoutFromJSON(aed),
|
||||
FromJSON.LayoutFromJSON(toilets),
|
||||
FromJSON.LayoutFromJSON(artworks),
|
||||
FromJSON.LayoutFromJSON(cyclestreets),
|
||||
FromJSON.LayoutFromJSON(ghostbikes),
|
||||
|
||||
AllKnownLayouts.GenerateCycloFix(),
|
||||
|
||||
new MetaMap(),
|
||||
new StreetWidth(),
|
||||
new Groen(),
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
public static allSets: Map<string, Layout> = AllKnownLayouts.AllLayouts();
|
||||
|
||||
|
@ -51,7 +74,6 @@ export class AllKnownLayouts {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (this.allLayers[layer.id] !== undefined) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ export default class HelpText extends UIElement {
|
|||
return "<h1>Welcome to the Custom Theme Builder</h1>" +
|
||||
"Here, one can make their own custom mapcomplete themes.<br/>" +
|
||||
"Fill out the fields to get a working mapcomplete theme. More information on the selected field will appear here when you click it.<br/>" +
|
||||
"Want to see how the quests are doing in number of visits? All the stats are open on <a href='pietervdvn.goatcounter.com' target='_blank'>goatcounter</a>";
|
||||
"Want to see how the quests are doing in number of visits? All the stats are open on <a href='https://pietervdvn.goatcounter.com' target='_blank'>goatcounter</a>";
|
||||
}
|
||||
|
||||
return new Combine(["<h1>", setting._name, "</h1>", setting._description.Render()]).Render();
|
||||
|
|
|
@ -85,6 +85,7 @@ export class FromJSON {
|
|||
layout.maintainer = json.maintainer;
|
||||
layout.version = json.version;
|
||||
layout.socialImage = json.socialImage;
|
||||
layout.description = tr(json.shortDescription) ?? tr(json.description)?.FirstSentence();
|
||||
layout.changesetMessage = json.changesetmessage;
|
||||
return layout;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,12 @@ export interface LayoutConfigJson {
|
|||
* The title, as shown in the welcome message and the more-screen
|
||||
*/
|
||||
title: string | any;
|
||||
|
||||
/**
|
||||
* A short description, showed as social description and in the 'more theme'-buttons
|
||||
*/
|
||||
shortDescription?: string | any;
|
||||
|
||||
/**
|
||||
* The description, as shown in the welcome message and the more-screen
|
||||
*/
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
import {LayerDefinition} from "../LayerDefinition";
|
||||
import {Or, Tag} from "../../Logic/Tags";
|
||||
import {AccessTag} from "../Questions/AccessTag";
|
||||
import {OperatorTag} from "../Questions/OperatorTag";
|
||||
import {NameQuestion} from "../Questions/NameQuestion";
|
||||
import {NameInline} from "../Questions/NameInline";
|
||||
import {DescriptionQuestion} from "../Questions/DescriptionQuestion";
|
||||
import ImageCarouselWithUploadConstructor from "../../UI/Image/ImageCarouselWithUpload";
|
||||
|
||||
export class Bos extends LayerDefinition {
|
||||
|
||||
constructor() {
|
||||
super("bos");
|
||||
this.name = "Bos";
|
||||
this.icon = "";
|
||||
|
||||
this.overpassFilter = new Or([
|
||||
new Tag("natural", "wood"),
|
||||
new Tag("landuse", "forest"),
|
||||
new Tag("natural", "scrub")
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
this.presets = [{
|
||||
title: "Bos",
|
||||
description: "Voeg een ontbrekend bos toe aan de kaart",
|
||||
icon: undefined,
|
||||
tags: [
|
||||
new Tag("landuse", "forest"),
|
||||
new Tag("fixme", "Toegevoegd met MapComplete, geometry nog uit te tekenen")
|
||||
]
|
||||
}];
|
||||
this.maxAllowedOverlapPercentage = 10;
|
||||
|
||||
this.minzoom = 13;
|
||||
this.style = this.generateStyleFunction();
|
||||
this.title = new NameInline("Bos");
|
||||
this.elementsToShow = [
|
||||
new ImageCarouselWithUploadConstructor(),
|
||||
new NameQuestion(),
|
||||
new AccessTag(),
|
||||
new OperatorTag(),
|
||||
new DescriptionQuestion("bos")
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
private generateStyleFunction() {
|
||||
const self = this;
|
||||
return function (properties: any) {
|
||||
let questionSeverity = 0;
|
||||
for (const qd of self.elementsToShow) {
|
||||
if(qd instanceof DescriptionQuestion){
|
||||
continue;
|
||||
}
|
||||
|
||||
if (qd.IsQuestioning(properties)) {
|
||||
questionSeverity = Math.max(questionSeverity, qd.Priority());
|
||||
}
|
||||
}
|
||||
|
||||
let colormapping = {
|
||||
0: "#00bb00",
|
||||
1: "#00ff00",
|
||||
10: "#dddd00",
|
||||
20: "#ff0000"
|
||||
};
|
||||
|
||||
let colour = colormapping[questionSeverity];
|
||||
while (colour == undefined) {
|
||||
questionSeverity--;
|
||||
colour = colormapping[questionSeverity];
|
||||
}
|
||||
|
||||
return {
|
||||
color: colour,
|
||||
icon: undefined
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +1,6 @@
|
|||
import {LayerDefinition} from "../LayerDefinition";
|
||||
import {Or, Tag} from "../../Logic/Tags";
|
||||
import {AccessTag} from "../Questions/AccessTag";
|
||||
import {OperatorTag} from "../Questions/OperatorTag";
|
||||
import {NameQuestion} from "../Questions/NameQuestion";
|
||||
import {NameInline} from "../Questions/NameInline";
|
||||
import {DescriptionQuestion} from "../Questions/DescriptionQuestion";
|
||||
import ImageCarouselWithUploadConstructor from "../../UI/Image/ImageCarouselWithUpload";
|
||||
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||
|
||||
export class NatureReserves extends LayerDefinition {
|
||||
|
@ -27,13 +22,13 @@ export class NatureReserves extends LayerDefinition {
|
|||
];
|
||||
this.minzoom = 13;
|
||||
this.title = new NameInline("Natuurreservaat");
|
||||
this.style = this.generateStyleFunction();
|
||||
this.style = function () {
|
||||
return {
|
||||
color: "#00bb00",
|
||||
icon: undefined
|
||||
};
|
||||
};
|
||||
this.elementsToShow = [
|
||||
new ImageCarouselWithUploadConstructor(),
|
||||
new NameQuestion(),
|
||||
new AccessTag(),
|
||||
new OperatorTag(),
|
||||
new DescriptionQuestion("natuurgebied")
|
||||
];
|
||||
|
||||
|
||||
|
@ -97,38 +92,4 @@ export class NatureReserves extends LayerDefinition {
|
|||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private generateStyleFunction() {
|
||||
const self = this;
|
||||
return function (properties: any) {
|
||||
let questionSeverity = 0;
|
||||
for (const qd of self.elementsToShow) {
|
||||
//if(qd instanceof DescriptionQuestion){
|
||||
// continue;
|
||||
//}
|
||||
if (qd.IsQuestioning(properties)) {
|
||||
questionSeverity = Math.max(questionSeverity, qd.Priority() ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
let colormapping = {
|
||||
0: "#00bb00",
|
||||
10: "#dddd00",
|
||||
20: "#ff0000"
|
||||
};
|
||||
|
||||
let colour = colormapping[questionSeverity];
|
||||
while (colour == undefined) {
|
||||
questionSeverity--;
|
||||
colour = colormapping[questionSeverity];
|
||||
}
|
||||
|
||||
return {
|
||||
color: colour,
|
||||
icon: undefined
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
import {LayerDefinition} from "../LayerDefinition";
|
||||
import {Or, Tag} from "../../Logic/Tags";
|
||||
import {NameQuestion} from "../Questions/NameQuestion";
|
||||
import {NameInline} from "../Questions/NameInline";
|
||||
import {DescriptionQuestion} from "../Questions/DescriptionQuestion";
|
||||
import ImageCarouselWithUploadConstructor from "../../UI/Image/ImageCarouselWithUpload";
|
||||
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||
|
||||
export class Park extends LayerDefinition {
|
||||
|
||||
|
||||
private accessByDefault = new TagRenderingOptions({
|
||||
question: "Is dit park publiek toegankelijk?",
|
||||
mappings: [
|
||||
{k: new Tag("access", "yes"), txt: "Publiek toegankelijk"},
|
||||
{k: new Tag("access", ""), txt: "Publiek toegankelijk", hideInAnswer: true},
|
||||
{k: new Tag("access", "no"), txt: "Niet publiek toegankelijk"},
|
||||
{k: new Tag("access", "private"), txt: "Niet publiek toegankelijk, want privaat"},
|
||||
{k: new Tag("access", "guided"), txt: "Enkel toegankelijk met een gids of op een activiteit"},
|
||||
],
|
||||
freeform: {
|
||||
key: "access",
|
||||
renderTemplate: "Dit park is niet toegankelijk: {access}",
|
||||
template: "De toegankelijkheid van dit park is: $$$"
|
||||
},
|
||||
priority: 20
|
||||
})
|
||||
|
||||
private operatorByDefault = new
|
||||
|
||||
TagRenderingOptions({
|
||||
question: "Wie beheert dit park?",
|
||||
freeform: {
|
||||
key: "operator",
|
||||
renderTemplate: "Dit park wordt beheerd door {operator}",
|
||||
template: "$$$",
|
||||
},
|
||||
mappings: [{
|
||||
k: null, txt: "De gemeente beheert dit park"
|
||||
}],
|
||||
priority: 15
|
||||
});
|
||||
|
||||
|
||||
constructor() {
|
||||
super("park");
|
||||
this.name = "Park";
|
||||
this.icon = undefined;
|
||||
this.overpassFilter =
|
||||
new Or([new Tag("leisure", "park"), new Tag("landuse", "village_green")]);
|
||||
this.presets = [{
|
||||
title: "Park",
|
||||
description: "Voeg een ontbrekend park toe. Een park is een groene ruimte die openbaar is." +
|
||||
"Typisch vind je er banken, vuilbakken, standbeelden, ... ",
|
||||
tags: [new Tag("leisure", "park"),
|
||||
new Tag("fixme", "Toegevoegd met MapComplete, geometry nog uit te tekenen")]
|
||||
}];
|
||||
this.maxAllowedOverlapPercentage = 25;
|
||||
|
||||
this.minzoom = 13;
|
||||
this.style = this.generateStyleFunction();
|
||||
this.title = new NameInline("Park");
|
||||
this.elementsToShow = [
|
||||
new ImageCarouselWithUploadConstructor(),
|
||||
new NameQuestion(),
|
||||
this.accessByDefault,
|
||||
this.operatorByDefault,
|
||||
new DescriptionQuestion("park"),
|
||||
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private generateStyleFunction() {
|
||||
const self = this;
|
||||
return function (properties: any) {
|
||||
let questionSeverity = 0;
|
||||
for (const qd of self.elementsToShow) {
|
||||
if (qd instanceof DescriptionQuestion) {
|
||||
continue;
|
||||
}
|
||||
if (qd.IsQuestioning(properties)) {
|
||||
questionSeverity = Math.max(questionSeverity, qd.Priority() ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
let colormapping = {
|
||||
0: "#00bb00",
|
||||
1: "#00ff00",
|
||||
10: "#dddd00",
|
||||
20: "#ff0000"
|
||||
};
|
||||
|
||||
let colour = colormapping[questionSeverity];
|
||||
while (colour == undefined) {
|
||||
questionSeverity--;
|
||||
colour = colormapping[questionSeverity];
|
||||
}
|
||||
|
||||
return {
|
||||
color: colour,
|
||||
icon: undefined
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
import {Layout} from "../Layout";
|
||||
import Translations from "../../UI/i18n/Translations";
|
||||
import Combine from "../../UI/Base/Combine";
|
||||
|
||||
|
||||
export default class Cyclofix extends Layout {
|
||||
|
||||
private static RememberTheDead(): boolean {
|
||||
const now = new Date();
|
||||
const m = now.getMonth() + 1;
|
||||
const day = new Date().getDay() + 1;
|
||||
const date = day + "/" + m;
|
||||
return (date === "31/10" || date === "1/11" || date === "2/11");
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super(
|
||||
"cyclofix",
|
||||
["en", "nl", "fr", "gl","de"],
|
||||
Translations.t.cyclofix.title,
|
||||
["bike_repair_station", "bike_cafes", "bike_shops", "drinking_water", "bike_parking","bike_themed_object",
|
||||
// The first of november, halloween and the second of november, we remember our dead
|
||||
...(Cyclofix.RememberTheDead() ? ["ghost_bike"] : [])],
|
||||
16,
|
||||
50.8465573,
|
||||
4.3516970,
|
||||
new Combine([
|
||||
"<h3>",
|
||||
Translations.t.cyclofix.title,
|
||||
"</h3><br/><p>",
|
||||
Translations.t.cyclofix.description,
|
||||
"</p>"
|
||||
])
|
||||
);
|
||||
this.icon = "./assets/bike/logo.svg"
|
||||
this.description = "Easily search and contribute bicycle data nearby";
|
||||
this.socialImage = "./assets/bike/cyclofix.jpeg";
|
||||
this.widenFactor = 0.05;
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
import {Layout} from "../Layout";
|
||||
import {GrbToFix} from "../Layers/GrbToFix";
|
||||
|
||||
export class GRB extends Layout {
|
||||
constructor() {
|
||||
super("grb",
|
||||
["en"],
|
||||
"Grb import fix tool",
|
||||
[new GrbToFix()],
|
||||
15,
|
||||
51.2083,
|
||||
3.2279,
|
||||
|
||||
|
||||
"<h3>GRB Fix tool</h3>\n" +
|
||||
"\n" +
|
||||
"Expert use only"
|
||||
|
||||
,
|
||||
"", "");
|
||||
this.hideFromOverview = true;
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
import {Park} from "../Layers/Park";
|
||||
import {Bos} from "../Layers/Bos";
|
||||
import {Layout} from "../Layout";
|
||||
import {NatureReserves} from "../Layers/NatureReserves";
|
||||
|
||||
export class Groen extends Layout {
|
||||
|
||||
constructor() {
|
||||
super("buurtnatuur",
|
||||
["nl"],
|
||||
"Buurtnatuur.be",
|
||||
[new NatureReserves(), new Park(), new Bos(), "viewpoint"],
|
||||
10,
|
||||
50.8435,
|
||||
4.3688,
|
||||
"\n" +
|
||||
|
||||
"<img style='float:right;margin: 1em;width: 10em;height: auto;' src='./assets/themes/buurtnatuur/groen_logo.svg' alt='logo-groen' class='logo'> <br />" +
|
||||
"<h3>Breng jouw buurtnatuur in kaart</h3>" +
|
||||
"<b>Natuur maakt gelukkig.</b> Aan de hand van deze website willen we de natuur dicht bij ons beter inventariseren. Met als doel meer mensen te laten genieten van toegankelijke natuur én te strijden voor meer natuur in onze buurten. \n" +
|
||||
"<ul>" +
|
||||
"<li>In welke natuurgebieden kan jij terecht? Hoe toegankelijk zijn ze?</li>" +
|
||||
"<li>In welke bossen kan een gezin in jouw gemeente opnieuw op adem komen?</li>" +
|
||||
"<li>Op welke onbekende plekjes is het zalig spelen?</li>" +
|
||||
"</ul>" +
|
||||
"<p>Samen kleuren we heel Vlaanderen en Brussel groen.</p>" +
|
||||
"<p>Blijf op de hoogte van de resultaten van buurtnatuur.be: <a href=\"https://www.groen.be/buurtnatuur\" target='_blank'>meld je aan voor e-mailupdates</a>.</p> \n"
|
||||
,
|
||||
|
||||
"<b>Begin meteen door <a href=\"https://www.openstreetmap.org/user/new\" target=\"_blank\">een account te maken\n" +
|
||||
" te maken</a> of\n" +
|
||||
" <span onclick=\"authOsm()\" class=\"activate-osm-authentication\">in te loggen</span>.</b>",
|
||||
"",
|
||||
|
||||
"<h4>Tips</h4>" +
|
||||
|
||||
"<ul>" +
|
||||
"<li>Over groen ingekleurde gebieden weten we alles wat we willen weten.</li>" +
|
||||
"<li>Bij rood ingekleurde gebieden ontbreekt nog heel wat info: klik een gebied aan en beantwoord de vragen.</li>" +
|
||||
"<li>Je kan altijd een vraag overslaan als je het antwoord niet weet of niet zeker bent</li>" +
|
||||
"<li>Je kan altijd een foto toevoegen</li>" +
|
||||
"<li>Je kan ook zelf een gebied toevoegen door op de kaart te klikken</li>" +
|
||||
"<li>Open buurtnatuur.be <b>op je smartphone</b> om al wandelend foto's te maken en vragen te beantwoorden</li>" +
|
||||
"</ul>" +
|
||||
"<small>" +
|
||||
"<p>" +
|
||||
"De oorspronkelijke data komt van <b>OpenStreetMap</b> en je antwoorden worden daar bewaard.<br/> Omdat iedereen vrij kan meewerken aan dit project, kunnen we niet garanderen dat er geen fouten opduiken." +
|
||||
"Kan je hier niet aanpassen wat je wilt, dan kan je dat zelf via OpenStreetMap.org doen. Groen kan <b>geen enkele verantwoordelijkheid</b> nemen over de kaart." +
|
||||
"</p>" +
|
||||
"Je privacy is belangrijk. We tellen wel hoeveel gebruikers deze website bezoeken. We plaatsen een cookie waar geen persoonlijke informatie in bewaard wordt. " +
|
||||
"Als je inlogt, komt er een tweede cookie bij met je inloggegevens." +
|
||||
"</small>"
|
||||
);
|
||||
|
||||
this.icon = "./assets/themes/buurtnatuur/groen_logo.svg"
|
||||
this.socialImage = "assets/themes/buurtnatuur/social_image.jpg"
|
||||
this.description = "Met deze tool kan je natuur in je buurt in kaart brengen en meer informatie geven over je favoriete plekje"
|
||||
this.enableMoreQuests = false;
|
||||
this.enableShareScreen = false
|
||||
}
|
||||
}
|
|
@ -36,10 +36,6 @@ export class OnlyShowIfConstructor implements TagDependantUIElementConstructor{
|
|||
return this._embedded.IsQuestioning(properties);
|
||||
}
|
||||
|
||||
Priority(): number {
|
||||
return this._embedded.Priority();
|
||||
}
|
||||
|
||||
GetContent(tags: any): Translation {
|
||||
if(!this.IsKnown(tags)){
|
||||
return undefined;
|
||||
|
@ -78,10 +74,6 @@ class OnlyShowIf extends UIElement implements TagDependantUIElement {
|
|||
}
|
||||
}
|
||||
|
||||
Priority(): number {
|
||||
return this._embedded.Priority();
|
||||
}
|
||||
|
||||
IsKnown(): boolean {
|
||||
if(!this.Matches()){
|
||||
return false;
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
import {And, Tag} from "../../Logic/Tags";
|
||||
import {TagRenderingOptions} from "../TagRenderingOptions";
|
||||
|
||||
export class AccessTag extends TagRenderingOptions {
|
||||
|
||||
private static options = {
|
||||
priority: 20,
|
||||
question: "Is dit gebied toegankelijk?",
|
||||
freeform: {
|
||||
key: "access:description",
|
||||
template: "Iets anders: $$$",
|
||||
renderTemplate: "De toegankelijkheid van dit gebied is: {access:description}",
|
||||
placeholder: "Specifieer"
|
||||
},
|
||||
mappings: [
|
||||
{k: new And([new Tag("access", "yes"), new Tag("fee", "")]), txt: "Publiek toegankelijk"},
|
||||
{k: new And([new Tag("access", "no"), new Tag("fee", "")]), txt: "Niet toegankelijk"},
|
||||
{k: new And([new Tag("access", "private"), new Tag("fee", "")]), txt: "Niet toegankelijk, want privegebied"},
|
||||
{k: new And([new Tag("access", "permissive"), new Tag("fee", "")]), txt: "Toegankelijk, maar het is privegebied"},
|
||||
{k: new And([new Tag("access", "guided"), new Tag("fee", "")]), txt: "Enkel met een gids of tijdens een activiteit toegankelijk"},
|
||||
{
|
||||
k: new And([new Tag("access", "yes"),
|
||||
new Tag("fee", "yes")]),
|
||||
txt: "Toegankelijk mits betaling",
|
||||
priority: 10
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super(AccessTag.options);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -5,24 +5,21 @@ import {TagRenderingOptions} from "../TagRenderingOptions";
|
|||
export class OperatorTag extends TagRenderingOptions {
|
||||
|
||||
|
||||
private static options = {
|
||||
priority: 15,
|
||||
question: "Wie beheert dit gebied?",
|
||||
freeform: {
|
||||
key: "operator",
|
||||
template: "Beheer door $$$",
|
||||
renderTemplate: "Beheer door {operator}",
|
||||
placeholder: "organisatie"
|
||||
},
|
||||
mappings: [
|
||||
{k: new Tag("operator", "Natuurpunt"), txt: "Natuurpunt"},
|
||||
{k: new Tag("operator", "Agentschap Natuur en Bos"), txt: "het Agentschap Natuur en Bos (ANB)"},
|
||||
{k: new Tag("operator", "private"), txt: "Beheer door een privépersoon"}
|
||||
]
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super(OperatorTag.options);
|
||||
super({
|
||||
question: "Wie beheert dit gebied?",
|
||||
freeform: {
|
||||
key: "operator",
|
||||
template: "Beheer door $$$",
|
||||
renderTemplate: "Beheer door {operator}",
|
||||
placeholder: "organisatie"
|
||||
},
|
||||
mappings: [
|
||||
{k: new Tag("operator", "Natuurpunt"), txt: "Natuurpunt"},
|
||||
{k: new Tag("operator", "Agentschap Natuur en Bos"), txt: "het Agentschap Natuur en Bos (ANB)"},
|
||||
{k: new Tag("operator", "private"), txt: "Beheer door een privépersoon"}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -11,7 +11,6 @@ export class TagRenderingOptions implements TagDependantUIElementConstructor {
|
|||
* Notes: by not giving a 'question', one disables the question form alltogether
|
||||
*/
|
||||
public options: {
|
||||
priority?: number;
|
||||
question?: string | Translation;
|
||||
freeform?: {
|
||||
key: string;
|
||||
|
@ -22,7 +21,7 @@ export class TagRenderingOptions implements TagDependantUIElementConstructor {
|
|||
extraTags?: TagsFilter
|
||||
};
|
||||
multiAnswer?: boolean,
|
||||
mappings?: { k: TagsFilter; txt: string | Translation; priority?: number, substitute?: boolean, hideInAnwser?: boolean }[]
|
||||
mappings?: { k: TagsFilter; txt: string | Translation; substitute?: boolean, hideInAnwser?: boolean }[]
|
||||
};
|
||||
|
||||
constructor(options: {
|
||||
|
@ -146,8 +145,4 @@ export class TagRenderingOptions implements TagDependantUIElementConstructor {
|
|||
return !this.IsQuestioning(properties);
|
||||
}
|
||||
|
||||
Priority(): number {
|
||||
return this.options.priority ?? 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,6 @@ export interface TagDependantUIElementConstructor {
|
|||
construct(dependencies: Dependencies): TagDependantUIElement;
|
||||
IsKnown(properties: any): boolean;
|
||||
IsQuestioning(properties: any): boolean;
|
||||
Priority(): number;
|
||||
GetContent(tags: any): Translation;
|
||||
|
||||
}
|
||||
|
@ -23,7 +22,5 @@ export abstract class TagDependantUIElement extends UIElement {
|
|||
|
||||
abstract IsQuestioning(): boolean;
|
||||
|
||||
abstract Priority() : number;
|
||||
|
||||
abstract IsSkipped() : boolean;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue