diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts
index c3008f8d44..68173c8e29 100644
--- a/Customizations/AllKnownLayouts.ts
+++ b/Customizations/AllKnownLayouts.ts
@@ -4,16 +4,19 @@ import {GRB} from "./Layouts/GRB";
import {Statues} from "./Layouts/Statues";
import {Bookcases} from "./Layouts/Bookcases";
import Cyclofix from "./Layouts/Cyclofix";
+import {All} from "./Layouts/All";
export class AllKnownLayouts {
public static allSets: any = AllKnownLayouts.AllLayouts();
private static AllLayouts() {
+ const all = new All();
const layouts = [
new Groen(),
new GRB(),
new Cyclofix(),
- new Bookcases()
+ new Bookcases(),
+ all
/*new Toilets(),
new Statues(),
*/
@@ -21,6 +24,7 @@ export class AllKnownLayouts {
const allSets = {};
for (const layout of layouts) {
allSets[layout.name] = layout;
+ all.layers = all.layers.concat(layout.layers);
}
return allSets;
}
diff --git a/Customizations/LayerDefinition.ts b/Customizations/LayerDefinition.ts
index 945f299337..03822e3fdb 100644
--- a/Customizations/LayerDefinition.ts
+++ b/Customizations/LayerDefinition.ts
@@ -7,6 +7,7 @@ import {FilteredLayer} from "../Logic/FilteredLayer";
import {Changes} from "../Logic/Changes";
import {UserDetails} from "../Logic/OsmConnection";
import {TagRenderingOptions} from "./TagRendering";
+import {TagDependantUIElementConstructor} from "./UIElementConstructor";
export class LayerDefinition {
@@ -27,7 +28,7 @@ export class LayerDefinition {
/**
* These are the questions/shown attributes in the popup
*/
- elementsToShow: TagRenderingOptions[];
+ elementsToShow: TagDependantUIElementConstructor[];
style: (tags: any) => { color: string, icon: any };
diff --git a/Customizations/Layers/Bookcases.ts b/Customizations/Layers/Bookcases.ts
index 04cda67759..0c17586163 100644
--- a/Customizations/Layers/Bookcases.ts
+++ b/Customizations/Layers/Bookcases.ts
@@ -1,6 +1,6 @@
import {LayerDefinition} from "../LayerDefinition";
import L from "leaflet";
-import {Tag} from "../../Logic/TagsFilter";
+import {And, Regex, Tag} from "../../Logic/TagsFilter";
import {QuestionDefinition} from "../../Logic/Question";
import {TagRenderingOptions} from "../TagRendering";
import {NameInline} from "../Questions/NameInline";
@@ -21,7 +21,6 @@ export class Bookcases extends LayerDefinition {
this.elementsToShow = [
new TagRenderingOptions({
- priority: 13,
question: "Heeft dit boekenruilkastje een naam?",
freeform: {
key: "name",
@@ -44,66 +43,114 @@ export class Bookcases extends LayerDefinition {
key: "capacity",
placeholder: "aantal"
},
- priority: 15
}
),
new TagRenderingOptions({
question: "Wat voor soort boeken heeft dit boekenruilkastje?",
- mappings:[
- {k: new Tag("books","children"), txt: "Voornamelijk kinderboeken"},
- {k: new Tag("books","adults"), txt: "Voornamelijk boeken voor volwassenen"},
- {k: new Tag("books","children;adults"), txt: "Zowel kinderboeken als boeken voor volwassenen"}
+ mappings: [
+ {k: new Tag("books", "children"), txt: "Voornamelijk kinderboeken"},
+ {k: new Tag("books", "adults"), txt: "Voornamelijk boeken voor volwassenen"},
+ {k: new Tag("books", "children;adults"), txt: "Zowel kinderboeken als boeken voor volwassenen"}
],
- priority: 14
}),
-
+
new TagRenderingOptions({
- question: "",
- freeform:{
+ question: "Staat dit boekenruilkastje binnen of buiten?",
+ mappings: [
+ {k: new Tag("indoor", "yes"), txt: "Dit boekenruilkastje staat binnen"},
+ {k: new Tag("indoor", "no"), txt: "Dit boekenruilkastje staat buiten"},
+ {k: new Tag("indoor", ""), txt: "Dit boekenruilkastje staat buiten"}
+ ]
+ }),
+
+ new TagRenderingOptions({
+ question: "Is dit boekenruilkastje vrij toegankelijk?",
+ mappings: [
+ {k: new Tag("access", "yes"), txt: "Ja, vrij toegankelijk"},
+ {k: new Tag("access", "customers"), txt: "Enkel voor klanten"},
+ ]
+ }).OnlyShowIf(new Tag("indoor", "yes")),
+ new TagRenderingOptions({
+ question: "Wie (welke organisatie) beheert dit boekenruilkastje?",
+ freeform: {
+ key: "opeartor",
+ renderTemplate: "Dit boekenruilkastje wordt beheerd door {operator}",
+ template: "Dit boekenruilkastje wordt beheerd door $$$"
+ }
+ }),
+
+ new TagRenderingOptions({
+ question: "Zijn er openingsuren voor dit boekenruilkastje?",
+ mappings: [
+ {k: new Tag("opening_hours", "24/7"), txt: "Dag en nacht toegankelijk"},
+ {k: new Tag("opening_hours", ""), txt: "Dag en nacht toegankelijk"},
+ {k: new Tag("opening_hours", "sunrise-sunset"), txt: "Van zonsopgang tot zonsondergang"},
+ ],
+ freeform: {
+ key: "opening_hours",
+ renderTemplate: "De openingsuren zijn {opening_hours}",
+ template: "De openingsuren zijn $$$"
+ }
+ }),
+
+ new TagRenderingOptions({
+ question: "Is dit boekenruilkastje deel van een netwerk?",
+ freeform: {
+ key: "brand",
+ renderTemplate: "Deel van het netwerk {brand}",
+ template: "Deel van het netwerk $$$"
+ },
+ mappings: [{
+ k: new And([new Tag("brand", "Little Free Library"), new Tag("nobrand", "")]),
+ txt: "Little Free Library"
+ },
+ {
+ k: new And([new Tag("brand", ""), new Tag("nobrand", "yes")]),
+ txt: "Maakt geen deel uit van een groter netwerk"
+ }]
+ }).OnlyShowIf(new And(
+ [new Tag("brand", "!(Little Free Library)"),
+ new Tag("ref", "")])),
+
+ new TagRenderingOptions({
+ question: "Wat is het LFL-referentienummer van dit boekenruilkastje?",
+ freeform: {
+ key: "ref",
+ template: "Het refernetienummer is $$$",
+ renderTemplate: "Gekend als Little Free Library {ref}"
+ }
+ }).OnlyShowIf(new Tag("brand", "Little Free Library")),
+
+ new TagRenderingOptions({
+ question: "Wanneer werd dit boekenruilkastje geinstalleerd?",
+ priority: -1,
+ freeform: {
key: "start_date",
renderTemplate: "Geplaatst op {start_date}",
template: "Geplaatst op $$$"
}
}),
-
+
new TagRenderingOptions({
question: "Is er een website waar we er meer informatie is over dit boekenruilkastje?",
- freeform:{
- key:"website",
+ freeform: {
+ key: "website",
renderTemplate: "Meer informatie over dit boekenruilkastje",
- template: "$$$",
- placeholder:"website"
-
- },
- priority: 5
+ template: "$$$",
+ placeholder: "website"
+ }
}),
-
-
-
+ new TagRenderingOptions({
+ freeform: {
+ key: "description",
+ renderTemplate: "Beschrijving door de uitbater
{description}",
+ template: "$$$",
+ }
+ })
+
];
- /*
- this.elementsToShow = [
-
-
-
- new TagMappingOptions({key: "operator", template: "Onder de hoede van {operator}"}),
- new TagMappingOptions({key: "brand", template: "Deel van het netwerk {brand}"}),
- new TagMappingOptions({key: "ref", template: "Referentienummer {ref}"}),
-
- new TagMappingOptions({key: "description", template: "Extra beschrijving:
{description}
"}), - ] - ;*/ - - /* this.questions = [ - QuestionDefinition.textQuestion("Heeft dit boekenkastje een peter, meter of voogd?", "operator", 10), - // QuestionDefinition.textQuestion("Wie kunnen we (per email) contacteren voor dit boekenruilkastje?", "email", 5), - - - ] - ; - */ this.style = function (tags) { return { diff --git a/Customizations/Layouts/All.ts b/Customizations/Layouts/All.ts new file mode 100644 index 0000000000..a415c2ea01 --- /dev/null +++ b/Customizations/Layouts/All.ts @@ -0,0 +1,18 @@ +import {Layout} from "../Layout"; + +export class All extends Layout{ + constructor() { + super( + "all", + "All quest layers", + [], + 15, + 51.2, + 3.2, + "