mapcomplete/Customizations/Questions/NameInline.ts

28 lines
916 B
TypeScript
Raw Normal View History

2020-07-05 18:59:47 +02:00
import {And, Tag} from "../../Logic/TagsFilter";
import {UIElement} from "../../UI/UIElement";
import Translations from "../../UI/i18n/Translations";
2020-07-31 17:38:03 +02:00
import {TagRenderingOptions} from "../TagRenderingOptions";
2020-08-22 03:15:42 +02:00
import Translation from "../../UI/i18n/Translation";
2020-07-05 18:59:47 +02:00
export class NameInline extends TagRenderingOptions{
2020-08-22 03:15:42 +02:00
constructor(category: string | Translation ) {
2020-07-05 18:59:47 +02:00
super({
question: "",
freeform: {
renderTemplate: "{name}",
template: Translations.t.general.nameInlineQuestion.Subs({category: category}),
2020-07-05 18:59:47 +02:00
key: "name",
extraTags: new Tag("noname", "") // Remove 'noname=yes'
},
mappings: [
{k: new Tag("noname","yes"), txt: Translations.t.general.noNameCategory.Subs({category: category})},
{k: null, txt: category}
2020-07-05 18:59:47 +02:00
]
});
}
}