Various bug fixes and updates

This commit is contained in:
Pieter Vander Vennet 2020-09-09 18:42:13 +02:00
parent 97ec893479
commit e069b31e4e
29 changed files with 482 additions and 148 deletions

View file

@ -17,7 +17,7 @@ export class AccessTag extends TagRenderingOptions {
{k: new And([new Tag("access", "no"), new Tag("fee", "")]), txt: "Niet toegankelijk"},
{k: new And([new Tag("access", "private"), new Tag("fee", "")]), txt: "Niet toegankelijk, want privegebied"},
{k: new And([new Tag("access", "permissive"), new Tag("fee", "")]), txt: "Toegankelijk, maar het is privegebied"},
{k: new And([new Tag("access", "guided"), new Tag("fee", "")]), txt: "Enkel met gids of op activiteit"},
{k: new And([new Tag("access", "guided"), new Tag("fee", "")]), txt: "Enkel met een gids of tijdens een activiteit toegankelijk"},
{
k: new And([new Tag("access", "yes"),
new Tag("fee", "yes")]),

View file

@ -1,4 +1,4 @@
import {Tag} from "../../Logic/Tags";
import {RegexTag, Tag} from "../../Logic/Tags";
import Translations from "../../UI/i18n/Translations";
import {TagRenderingOptions} from "../TagRenderingOptions";
import Translation from "../../UI/i18n/Translation";
@ -8,18 +8,10 @@ export class NameInline extends TagRenderingOptions{
constructor(category: string | Translation ) {
super({
question: "",
freeform: {
renderTemplate: "{name}",
template: Translations.t.general.nameInlineQuestion.Subs({category: category}),
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}
{k: new Tag("noname", "yes"), txt: Translations.t.general.noNameCategory.Subs({category: category})},
{k: new RegexTag("name", /.+/), txt: "{name}"},
{k:new Tag("name",""), txt: category}
]
});
}

View file

@ -3,31 +3,29 @@
* One is a big 'name-question', the other is the 'edit name' in the title.
* THis one is the big question
*/
import {Tag} from "../../Logic/Tags";
import {And, Tag} from "../../Logic/Tags";
import {TagRenderingOptions} from "../TagRenderingOptions";
export class NameQuestion extends TagRenderingOptions{
static options = {
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: "", // We don't actually render it, only ask
placeholder: "",
extraTags: new Tag("noname","")
},
mappings: [
{k: new Tag("noname", "yes"), txt: "Dit gebied heeft geen naam"},
]
}
export class NameQuestion extends TagRenderingOptions {
constructor() {
super(NameQuestion.options);
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"},
]
});
}
}

View file

@ -1,5 +1,5 @@
import {Img} from "../../UI/Img";
import {Tag} from "../../Logic/Tags";
import {RegexTag, Tag} from "../../Logic/Tags";
import {TagRenderingOptions} from "../TagRenderingOptions";
@ -18,7 +18,7 @@ export class OsmLink extends TagRenderingOptions {
placeholder: "",
},
mappings: [
{k: new Tag("id", "node/-1"), txt: "<span class='alert'>Uploading</span>"}
{k: new RegexTag("id", /node\/-.+/), txt: "<span class='alert'>Uploading</span>"}
]
}