More bookcase quests
This commit is contained in:
parent
811a98ebd3
commit
fc674e977b
2 changed files with 68 additions and 27 deletions
|
@ -4,6 +4,7 @@ import {Tag} from "../../Logic/TagsFilter";
|
||||||
import {QuestionDefinition} from "../../Logic/Question";
|
import {QuestionDefinition} from "../../Logic/Question";
|
||||||
import {TagRenderingOptions} from "../TagRendering";
|
import {TagRenderingOptions} from "../TagRendering";
|
||||||
import {NameInline} from "../Questions/NameInline";
|
import {NameInline} from "../Questions/NameInline";
|
||||||
|
import {NameQuestion} from "../Questions/NameQuestion";
|
||||||
|
|
||||||
export class Bookcases extends LayerDefinition {
|
export class Bookcases extends LayerDefinition {
|
||||||
|
|
||||||
|
@ -14,11 +15,26 @@ export class Bookcases extends LayerDefinition {
|
||||||
this.newElementTags = [new Tag("amenity", "public_bookcase")];
|
this.newElementTags = [new Tag("amenity", "public_bookcase")];
|
||||||
this.icon = "./assets/bookcase.svg";
|
this.icon = "./assets/bookcase.svg";
|
||||||
this.overpassFilter = new Tag("amenity", "public_bookcase");
|
this.overpassFilter = new Tag("amenity", "public_bookcase");
|
||||||
this.minzoom = 13;
|
this.minzoom = 11;
|
||||||
|
|
||||||
this.title = new NameInline("ruilboekenkastje");
|
this.title = new NameInline("ruilboekenkastje");
|
||||||
this.elementsToShow = [
|
this.elementsToShow = [
|
||||||
|
|
||||||
|
new TagRenderingOptions({
|
||||||
|
priority: 13,
|
||||||
|
question: "Heeft dit boekenruilkastje een naam?",
|
||||||
|
freeform: {
|
||||||
|
key: "name",
|
||||||
|
template: "De naam is $$$",
|
||||||
|
renderTemplate: "", // We don't actually render it, only ask
|
||||||
|
placeholder: "",
|
||||||
|
extraTags: new Tag("noname","")
|
||||||
|
},
|
||||||
|
mappings: [
|
||||||
|
{k: new Tag("noname", "yes"), txt: "Neen, er is geen naam aangeduid op het boekenruilkastje"},
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
|
||||||
new TagRenderingOptions(
|
new TagRenderingOptions(
|
||||||
{
|
{
|
||||||
question: "Hoeveel boeken passen in dit boekenruilkastje?",
|
question: "Hoeveel boeken passen in dit boekenruilkastje?",
|
||||||
|
@ -30,12 +46,57 @@ export class Bookcases extends LayerDefinition {
|
||||||
},
|
},
|
||||||
priority: 15
|
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"}
|
||||||
|
],
|
||||||
|
priority: 14
|
||||||
|
}),
|
||||||
|
|
||||||
|
new TagRenderingOptions({
|
||||||
|
question: "",
|
||||||
|
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",
|
||||||
|
renderTemplate: "<a href='{website}' target='_blank'>Meer informatie over dit boekenruilkastje</a>",
|
||||||
|
template: "$$$",
|
||||||
|
placeholder:"website"
|
||||||
|
|
||||||
|
},
|
||||||
|
priority: 5
|
||||||
|
}),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/*
|
||||||
|
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: <br /> <p>{description}</p>"}),
|
||||||
|
]
|
||||||
|
;*/
|
||||||
|
|
||||||
/* this.questions = [
|
/* this.questions = [
|
||||||
QuestionDefinition.noNameOrNameQuestion("Wat is de naam van dit boekenruilkastje?", "Dit boekenruilkastje heeft niet echt een naam", 20),
|
|
||||||
QuestionDefinition.textQuestion("Heeft dit boekenkastje een peter, meter of voogd?", "operator", 10),
|
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),
|
// QuestionDefinition.textQuestion("Wie kunnen we (per email) contacteren voor dit boekenruilkastje?", "email", 5),
|
||||||
|
|
||||||
|
@ -54,30 +115,7 @@ export class Bookcases extends LayerDefinition {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
this.elementsToShow = [
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
new TagMappingOptions({
|
|
||||||
key: "name",
|
|
||||||
template: "{name}",
|
|
||||||
missing: "Boekenruilkastje"
|
|
||||||
}
|
|
||||||
),
|
|
||||||
new TagMappingOptions({key: "capacity", template: "Plaats voor {capacity} boeken"}),
|
|
||||||
new TagMappingOptions({key: "operator", template: "Onder de hoede van {operator}"}),
|
|
||||||
new TagMappingOptions({
|
|
||||||
key: "website",
|
|
||||||
mapping: "Meer informatie beschikbaar op <a href='{website}'>{website}</a>"
|
|
||||||
}),
|
|
||||||
new TagMappingOptions({key: "start_date", template: "Geplaatst op {start_date}"}),
|
|
||||||
new TagMappingOptions({key: "brand", template: "Deel van het netwerk {brand}"}),
|
|
||||||
new TagMappingOptions({key: "ref", template: "Referentienummer {ref}"}),
|
|
||||||
|
|
||||||
new TagMappingOptions({key: "description", template: "Extra beschrijving: <br /> <p>{description}</p>"}),
|
|
||||||
]
|
|
||||||
;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,9 @@ export class ImageSearcher extends UIEventSource<string[]> {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (url.startsWith("File:")) {
|
if (url.startsWith("File:")) {
|
||||||
return new WikimediaImage(url);
|
return new WikimediaImage(url);
|
||||||
|
}else if (url.startsWith("https://commons.wikimedia.org/wiki/")) {
|
||||||
|
const commons = url.substr("https://commons.wikimedia.org/wiki/".length);
|
||||||
|
return new WikimediaImage(commons);
|
||||||
}else if(url.startsWith("https://i.imgur.com/")){
|
}else if(url.startsWith("https://i.imgur.com/")){
|
||||||
return new ImgurImage(url);
|
return new ImgurImage(url);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue