forked from MapComplete/MapComplete
New question system
This commit is contained in:
parent
1738fc4252
commit
d1f8080c24
45 changed files with 1391 additions and 689 deletions
29
Customizations/Questions/NameInline.ts
Normal file
29
Customizations/Questions/NameInline.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import {TagRenderingOptions} from "../TagRendering";
|
||||
import {And, Tag} from "../../Logic/TagsFilter";
|
||||
|
||||
|
||||
export class NameInline extends TagRenderingOptions{
|
||||
|
||||
static Upper(string){
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
constructor(category: string) {
|
||||
super({
|
||||
question: "",
|
||||
|
||||
freeform: {
|
||||
renderTemplate: "{name}",
|
||||
template: "De naam van dit "+category+" is $$$",
|
||||
key: "name",
|
||||
extraTags: new Tag("noname", "") // Remove 'noname=yes'
|
||||
},
|
||||
|
||||
mappings: [
|
||||
{k: new Tag("noname","yes"), txt: NameInline.Upper(category)+" zonder naam"},
|
||||
{k: null, txt: NameInline.Upper(category)}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue