2020-08-30 01:13:18 +02:00
|
|
|
import {Tag} from "../../../Logic/Tags";
|
2020-07-20 23:43:42 +02:00
|
|
|
import Translations from "../../../UI/i18n/Translations";
|
2020-07-21 02:55:28 +02:00
|
|
|
import Combine from "../../../UI/Base/Combine";
|
2020-07-31 17:38:03 +02:00
|
|
|
import {TagRenderingOptions} from "../../TagRenderingOptions";
|
2020-07-16 15:29:50 +02:00
|
|
|
|
2020-07-21 02:55:28 +02:00
|
|
|
class ParkingTypeHelper {
|
|
|
|
static GenerateMappings() {
|
2020-07-20 23:43:42 +02:00
|
|
|
const images = {
|
2020-07-27 14:00:02 +02:00
|
|
|
stands: "assets/bike/parking_staple.svg",
|
|
|
|
wall_loops: "assets/bike/parking_wall_loops.svg",
|
|
|
|
handlebar_holder: "assets/bike/parking_handlebar_holder.svg",
|
|
|
|
rack: "assets/bike/parking_rack.svg",
|
|
|
|
shed: "assets/bike/parking_shed.svg"
|
2020-07-21 02:55:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-07-27 14:00:02 +02:00
|
|
|
const toImg = (url) => `<br /><img width="150px" src=${url}>`
|
2020-07-21 02:55:28 +02:00
|
|
|
const mappings = [];
|
2020-07-21 01:13:51 +02:00
|
|
|
const to = Translations.t.cyclofix.parking.type
|
2020-07-21 02:55:28 +02:00
|
|
|
|
|
|
|
for (const imagesKey in images) {
|
|
|
|
const mapping =
|
|
|
|
{
|
|
|
|
k: new Tag("bicycle_parking", imagesKey),
|
|
|
|
txt: new Combine([
|
|
|
|
to[imagesKey],
|
|
|
|
to.eg,
|
|
|
|
toImg(images[imagesKey])
|
|
|
|
])
|
|
|
|
};
|
|
|
|
|
|
|
|
mappings.push(mapping);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return mappings;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class ParkingType extends TagRenderingOptions {
|
|
|
|
constructor() {
|
|
|
|
|
|
|
|
const to = Translations.t.cyclofix.parking.type
|
|
|
|
|
|
|
|
|
2020-07-16 15:29:50 +02:00
|
|
|
super({
|
|
|
|
priority: 5,
|
2020-07-21 02:55:28 +02:00
|
|
|
question: to.question,
|
2020-07-16 15:29:50 +02:00
|
|
|
freeform: {
|
|
|
|
key: "bicycle_parking",
|
|
|
|
extraTags: new Tag("fixme", "Freeform bicycle_parking= tag used: possibly a wrong value"),
|
2020-07-20 23:43:42 +02:00
|
|
|
template: to.template.txt,
|
|
|
|
renderTemplate: to.render.txt,
|
2020-07-21 02:55:28 +02:00
|
|
|
placeholder: Translations.t.cyclofix.freeFormPlaceholder,
|
2020-07-16 15:29:50 +02:00
|
|
|
},
|
2020-07-21 02:55:28 +02:00
|
|
|
mappings: ParkingTypeHelper.GenerateMappings()
|
|
|
|
|
2020-07-16 15:29:50 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|