Add phone number to bikeshop
This commit is contained in:
parent
21280fd156
commit
68929e4067
11 changed files with 34 additions and 8 deletions
|
@ -11,6 +11,7 @@ import ShopDiy from "../Questions/bike/ShopDiy";
|
||||||
import ShopName from "../Questions/bike/ShopName";
|
import ShopName from "../Questions/bike/ShopName";
|
||||||
import ShopSecondHand from "../Questions/bike/ShopSecondHand";
|
import ShopSecondHand from "../Questions/bike/ShopSecondHand";
|
||||||
import { TagRenderingOptions } from "../TagRendering";
|
import { TagRenderingOptions } from "../TagRendering";
|
||||||
|
import {PhoneNumberQuestion} from "../Questions/PhoneNumberQuestion";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeShops extends LayerDefinition {
|
export default class BikeShops extends LayerDefinition {
|
||||||
|
@ -50,6 +51,7 @@ export default class BikeShops extends LayerDefinition {
|
||||||
this.elementsToShow = [
|
this.elementsToShow = [
|
||||||
new ImageCarouselWithUploadConstructor(),
|
new ImageCarouselWithUploadConstructor(),
|
||||||
new ShopName(),
|
new ShopName(),
|
||||||
|
new PhoneNumberQuestion("{name}"),
|
||||||
new ShopRetail(),
|
new ShopRetail(),
|
||||||
new ShopRental(),
|
new ShopRental(),
|
||||||
new ShopRepair(),
|
new ShopRepair(),
|
||||||
|
|
18
Customizations/Questions/PhoneNumberQuestion.ts
Normal file
18
Customizations/Questions/PhoneNumberQuestion.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import {TagRenderingOptions} from "../TagRendering";
|
||||||
|
import {UIElement} from "../../UI/UIElement";
|
||||||
|
import Translations from "../../UI/i18n/Translations";
|
||||||
|
|
||||||
|
export class PhoneNumberQuestion extends TagRenderingOptions {
|
||||||
|
|
||||||
|
constructor(category: string | UIElement) {
|
||||||
|
super({
|
||||||
|
question: Translations.t.general.questions.phoneNumberOf.Subs({category: category}),
|
||||||
|
freeform: {
|
||||||
|
renderTemplate: Translations.t.general.questions.phoneNumberIs.Subs({category: category}),
|
||||||
|
template: "$phone$",
|
||||||
|
key: "phone"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,6 @@ export default class ShopPump extends TagRenderingOptions {
|
||||||
const key = 'service:bicycle:diy'
|
const key = 'service:bicycle:diy'
|
||||||
const to = Translations.t.cyclofix.shop.diy
|
const to = Translations.t.cyclofix.shop.diy
|
||||||
super({
|
super({
|
||||||
priority: 5,
|
|
||||||
question: to.question,
|
question: to.question,
|
||||||
mappings: [
|
mappings: [
|
||||||
{k: new Tag(key, "yes"), txt: to.yes},
|
{k: new Tag(key, "yes"), txt: to.yes},
|
||||||
|
|
|
@ -6,7 +6,6 @@ export default class ShopPump extends TagRenderingOptions {
|
||||||
constructor() {
|
constructor() {
|
||||||
const to = Translations.t.cyclofix.shop.qName
|
const to = Translations.t.cyclofix.shop.qName
|
||||||
super({
|
super({
|
||||||
priority: 5,
|
|
||||||
question: to.question,
|
question: to.question,
|
||||||
freeform: {
|
freeform: {
|
||||||
key: "name",
|
key: "name",
|
||||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopPump extends TagRenderingOptions {
|
||||||
const key = 'service:bicycle:pump'
|
const key = 'service:bicycle:pump'
|
||||||
const to = Translations.t.cyclofix.shop.pump
|
const to = Translations.t.cyclofix.shop.pump
|
||||||
super({
|
super({
|
||||||
priority: 5,
|
|
||||||
question: to.question,
|
question: to.question,
|
||||||
mappings: [
|
mappings: [
|
||||||
{k: new Tag(key, "yes"), txt: to.yes},
|
{k: new Tag(key, "yes"), txt: to.yes},
|
||||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopRental extends TagRenderingOptions {
|
||||||
const key = 'service:bicycle:rental'
|
const key = 'service:bicycle:rental'
|
||||||
const to = Translations.t.cyclofix.shop.rental
|
const to = Translations.t.cyclofix.shop.rental
|
||||||
super({
|
super({
|
||||||
priority: 5,
|
|
||||||
question: to.question,
|
question: to.question,
|
||||||
mappings: [
|
mappings: [
|
||||||
{k: new Tag(key, "yes"), txt: to.yes},
|
{k: new Tag(key, "yes"), txt: to.yes},
|
||||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopRepair extends TagRenderingOptions {
|
||||||
const key = 'service:bicycle:repair'
|
const key = 'service:bicycle:repair'
|
||||||
const to = Translations.t.cyclofix.shop.repair
|
const to = Translations.t.cyclofix.shop.repair
|
||||||
super({
|
super({
|
||||||
priority: 5,
|
|
||||||
question: to.question,
|
question: to.question,
|
||||||
mappings: [
|
mappings: [
|
||||||
{k: new Tag(key, "yes"), txt: to.yes},
|
{k: new Tag(key, "yes"), txt: to.yes},
|
||||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopRetail extends TagRenderingOptions {
|
||||||
const key = 'service:bicycle:retail'
|
const key = 'service:bicycle:retail'
|
||||||
const to = Translations.t.cyclofix.shop.retail
|
const to = Translations.t.cyclofix.shop.retail
|
||||||
super({
|
super({
|
||||||
priority: 5,
|
|
||||||
question: to.question,
|
question: to.question,
|
||||||
mappings: [
|
mappings: [
|
||||||
{k: new Tag(key, "yes"), txt: to.yes},
|
{k: new Tag(key, "yes"), txt: to.yes},
|
||||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopPump extends TagRenderingOptions {
|
||||||
const key = 'service:bicycle:second_hand'
|
const key = 'service:bicycle:second_hand'
|
||||||
const to = Translations.t.cyclofix.shop.secondHand
|
const to = Translations.t.cyclofix.shop.secondHand
|
||||||
super({
|
super({
|
||||||
priority: 5,
|
|
||||||
question: to.question,
|
question: to.question,
|
||||||
mappings: [
|
mappings: [
|
||||||
{k: new Tag(key, "yes"), txt: to.yes},
|
{k: new Tag(key, "yes"), txt: to.yes},
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {UIEventSource} from "./UIEventSource";
|
import {UIEventSource} from "./UIEventSource";
|
||||||
|
import {TagDependantUIElement} from "../Customizations/UIElementConstructor";
|
||||||
|
|
||||||
export abstract class UIElement {
|
export abstract class UIElement {
|
||||||
|
|
||||||
|
|
|
@ -461,7 +461,19 @@ export default class Translations {
|
||||||
}),
|
}),
|
||||||
noNameCategory: new T({
|
noNameCategory: new T({
|
||||||
nl: "{category} zonder naam"
|
nl: "{category} zonder naam"
|
||||||
|
}),
|
||||||
|
questions: {
|
||||||
|
phoneNumberOf: new T({
|
||||||
|
en: "What is the phone number of {category}?",
|
||||||
|
nl: "Wat is het telefoonnummer van {category}?"
|
||||||
|
|
||||||
|
}),
|
||||||
|
phoneNumberIs: new T({
|
||||||
|
en: "The phone number of this {category} is <a href='tel:{phone}'>{phone}</a>",
|
||||||
|
nl: "Het telefoonnummer van {category} is <a href='tel:{phone}'>{phone}</a>"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue