mapcomplete/Customizations/Questions/NameQuestion.ts

31 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-07-05 16:59:47 +00:00
/**
* There are two ways to ask for names:
* One is a big 'name-question', the other is the 'edit name' in the title.
* THis one is the big question
*/
2020-09-09 16:42:13 +00:00
import {And, Tag} from "../../Logic/Tags";
2020-07-31 15:38:03 +00:00
import {TagRenderingOptions} from "../TagRenderingOptions";
2020-07-05 16:59:47 +00:00
2020-09-09 16:42:13 +00:00
export class NameQuestion extends TagRenderingOptions {
2020-07-05 16:59:47 +00:00
constructor() {
2020-09-09 16:42:13 +00:00
super({
priority: 10, // Move this last on the priority list, in order to prevent ppl to enter access restrictions and descriptions
question: "Wat is de <i>officiële</i> naam van dit gebied?<br><span class='question-subtext'>" +
"Zelf een naam bedenken wordt afgeraden.<br/>" +
"Een beschrijving van het gebied geven kan in een volgende stap.<br/>" +
"</span>",
freeform: {
key: "name",
template: "De naam is $$$",
renderTemplate: "Dit gebied heet <i>{name}</i>",
placeholder: "",
extraTags: new Tag("noname", "")
},
mappings: [
{k: new And([new Tag("name", ""), new Tag("noname", "yes")]), txt: "Dit gebied heeft geen naam"},
]
});
2020-07-05 16:59:47 +00:00
}
2020-09-09 16:42:13 +00:00
2020-07-05 16:59:47 +00:00
}