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 ShopSecondHand from "../Questions/bike/ShopSecondHand";
|
||||
import { TagRenderingOptions } from "../TagRendering";
|
||||
import {PhoneNumberQuestion} from "../Questions/PhoneNumberQuestion";
|
||||
|
||||
|
||||
export default class BikeShops extends LayerDefinition {
|
||||
|
@ -50,6 +51,7 @@ export default class BikeShops extends LayerDefinition {
|
|||
this.elementsToShow = [
|
||||
new ImageCarouselWithUploadConstructor(),
|
||||
new ShopName(),
|
||||
new PhoneNumberQuestion("{name}"),
|
||||
new ShopRetail(),
|
||||
new ShopRental(),
|
||||
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 to = Translations.t.cyclofix.shop.diy
|
||||
super({
|
||||
priority: 5,
|
||||
question: to.question,
|
||||
mappings: [
|
||||
{k: new Tag(key, "yes"), txt: to.yes},
|
||||
|
|
|
@ -6,7 +6,6 @@ export default class ShopPump extends TagRenderingOptions {
|
|||
constructor() {
|
||||
const to = Translations.t.cyclofix.shop.qName
|
||||
super({
|
||||
priority: 5,
|
||||
question: to.question,
|
||||
freeform: {
|
||||
key: "name",
|
||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopPump extends TagRenderingOptions {
|
|||
const key = 'service:bicycle:pump'
|
||||
const to = Translations.t.cyclofix.shop.pump
|
||||
super({
|
||||
priority: 5,
|
||||
question: to.question,
|
||||
mappings: [
|
||||
{k: new Tag(key, "yes"), txt: to.yes},
|
||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopRental extends TagRenderingOptions {
|
|||
const key = 'service:bicycle:rental'
|
||||
const to = Translations.t.cyclofix.shop.rental
|
||||
super({
|
||||
priority: 5,
|
||||
question: to.question,
|
||||
mappings: [
|
||||
{k: new Tag(key, "yes"), txt: to.yes},
|
||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopRepair extends TagRenderingOptions {
|
|||
const key = 'service:bicycle:repair'
|
||||
const to = Translations.t.cyclofix.shop.repair
|
||||
super({
|
||||
priority: 5,
|
||||
question: to.question,
|
||||
mappings: [
|
||||
{k: new Tag(key, "yes"), txt: to.yes},
|
||||
|
|
|
@ -8,7 +8,6 @@ export default class ShopRetail extends TagRenderingOptions {
|
|||
const key = 'service:bicycle:retail'
|
||||
const to = Translations.t.cyclofix.shop.retail
|
||||
super({
|
||||
priority: 5,
|
||||
question: to.question,
|
||||
mappings: [
|
||||
{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 to = Translations.t.cyclofix.shop.secondHand
|
||||
super({
|
||||
priority: 5,
|
||||
question: to.question,
|
||||
mappings: [
|
||||
{k: new Tag(key, "yes"), txt: to.yes},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {UIEventSource} from "./UIEventSource";
|
||||
import {TagDependantUIElement} from "../Customizations/UIElementConstructor";
|
||||
|
||||
export abstract class UIElement {
|
||||
|
||||
|
|
|
@ -461,7 +461,19 @@ export default class Translations {
|
|||
}),
|
||||
noNameCategory: new T({
|
||||
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