From 31362d166c5caf5506e162a51e7911fb8d2904e6 Mon Sep 17 00:00:00 2001 From: Erwin Sperling Date: Mon, 23 Dec 2024 21:12:52 +0100 Subject: [PATCH] adds remark icons, some style fixes --- front/bahnui-front/src/App.vue | 33 +++-- .../src/assets/icons/boarding-ramp.svg | 122 ++++++++++++++++++ .../assets/icons/no-bicycle-conveyance.svg | 119 +++++++++++++++++ front/bahnui-front/src/components/routing.vue | 16 ++- front/bahnui-front/src/components/search.vue | 34 +++-- front/bahnui-front/src/lib/remarks.js | 16 ++- front/bahnui-front/src/locales/de.json | 21 ++- front/bahnui-front/src/locales/en.json | 3 + front/bahnui-front/src/locales/fr.json | 54 ++++++++ front/bahnui-front/src/locales/ua.json | 54 ++++++++ front/bahnui-front/src/main.js | 4 +- 11 files changed, 440 insertions(+), 36 deletions(-) create mode 100644 front/bahnui-front/src/assets/icons/boarding-ramp.svg create mode 100644 front/bahnui-front/src/assets/icons/no-bicycle-conveyance.svg create mode 100644 front/bahnui-front/src/locales/fr.json create mode 100644 front/bahnui-front/src/locales/ua.json diff --git a/front/bahnui-front/src/App.vue b/front/bahnui-front/src/App.vue index d7a9a43..bdcca70 100644 --- a/front/bahnui-front/src/App.vue +++ b/front/bahnui-front/src/App.vue @@ -1,14 +1,17 @@ @@ -137,7 +137,7 @@ toName : "", connections: [], showRouting: false, - time: {value:new Date().toLocaleTimeString("de"), menu:false}, + time: {value:new Date().toLocaleTimeString("de", {hour: '2-digit', minute:'2-digit'}), menu:false}, date: {value:new Date(), menu:false}, services: services, selectedService: services[0].id, @@ -149,10 +149,10 @@ return this.isMobile ? "displaytall" : "displaywide"; }, searchStationFrom() { - client.get("/searchStation", {params: {text: this.fromName, service:this.selectedService}}).then(res => this.from = {name: res.data.name, id: res.data.id}); + client.get("/searchStation", {params: {text: this.fromName, service:this.selectedService}}).then(res => this.chooseFrom(res.data)); }, searchStationTo() { - client.get("/searchStation", {params: {text: this.toName, service:this.selectedService}}).then(res => this.to = {name: res.data.name, id: res.data.id}); + client.get("/searchStation", {params: {text: this.toName, service:this.selectedService}}).then(res => this.chooseTo(res.data)); }, searchConnection() { if (this.from.id && this.to.id){ @@ -173,12 +173,9 @@ if (this.from.menu){ let time = Date.now() this.from.update = time; - console.log("timeLoadChoicesFrom") let timer = setInterval(() => { if (time == this.from.update){ this.loadChoicesFrom(); - } else { - console.log("nicht laden") } clearInterval(timer); }, 500); @@ -192,8 +189,6 @@ let timer = setInterval(() => { if (time == this.to.update){ this.loadChoicesTo(); - } else { - console.log("nicht laden") } clearInterval(timer); }, 500); @@ -219,6 +214,11 @@ alert("testAlert") } }, + computed: { + formattedDate() { + return this.date.value.toLocaleDateString("de"); + } + }, watch: { fromName: function() { this.timeLoadChoicesFrom(); @@ -226,6 +226,11 @@ toName: function() { this.timeLoadChoicesTo(); }, + selectedService: function() { + this.searchStationFrom(); + this.searchStationTo(); + }, + }, } @@ -257,6 +262,11 @@ margin-left: auto; margin-right: auto; } + .selectItem{ + margin-top:10px; + background-color:white; + cursor: pointer; + } @font-face { font-family: "Raveo-display-bold"; src: url("../assets/Raveo Display Bold.woff2") format("opentype"); diff --git a/front/bahnui-front/src/lib/remarks.js b/front/bahnui-front/src/lib/remarks.js index 6b27d37..3e5bda8 100644 --- a/front/bahnui-front/src/lib/remarks.js +++ b/front/bahnui-front/src/lib/remarks.js @@ -4,11 +4,11 @@ let remarkfunctions = { return (null); } else if (remark.code === "55"){ return new URL('../assets/icons/55.svg', import.meta.url); - } else if (remark.code === "wifi"){ + } else if (remark.code === "wifi" || remark.code === "WF"){ return new URL('../assets/icons/wifi.svg', import.meta.url); } else if (remark.code === "air-conditioned"){ return new URL('../assets/icons/air-conditioned.svg', import.meta.url); - } else if (remark.code === "barrier-free-vehicle"){ + } else if (remark.code === "barrier-free-vehicle" || remark.code === "EA" || remark.code === "RZ" || remark.code === "OB"){ return new URL('../assets/icons/barrier-free-vehicle.svg', import.meta.url); } else if (remark.code === "compulsory-reservation"){ return new URL('../assets/icons/compulsory-reservation.svg', import.meta.url); @@ -16,14 +16,18 @@ let remarkfunctions = { return new URL('../assets/icons/on-board-restaurant.svg', import.meta.url); } else if (remark.code === "power-sockets"){ return new URL('../assets/icons/power-sockets.svg', import.meta.url); - } else if (remark.code === "wheelchair-space"){ + } else if (remark.code === 'wheelchairs-space' || remark.code === "RO"){ return new URL('../assets/icons/wheelchair-space.svg', import.meta.url); - } else if (remark.code === "bicycle-conveyance"){ + } else if (remark.code === "bicycle-conveyance" || remark.code === "FK"){ return new URL('../assets/icons/bicycle-conveyance.svg', import.meta.url); - } else if (remark.code === "bicycle-conveyance-reservation"){ + } else if (remark.code === "bicycle-conveyance-reservation" || remark.code === "FR"){ return new URL('../assets/icons/bicycle-conveyance-reservation.svg', import.meta.url); - } else if (remark.code === "2nd-class-only"){ + } else if (remark.code === "2nd-class-only" || remark.code === "J2" || remark.code === "K2"){ return new URL('../assets/icons/2nd-class-only.svg', import.meta.url); + } else if (remark.code === "boarding-ramp" || remark.code === "EF"){ + return new URL('../assets/icons/boarding-ramp.svg', import.meta.url); + } else if (remark.code === "no-bicycle-conveyance"){ + return new URL('../assets/icons/no-bicycle-conveyance.svg', import.meta.url); } else { return null; diff --git a/front/bahnui-front/src/locales/de.json b/front/bahnui-front/src/locales/de.json index 8721d5b..1c62461 100644 --- a/front/bahnui-front/src/locales/de.json +++ b/front/bahnui-front/src/locales/de.json @@ -17,6 +17,9 @@ } }, "routing":{ + "text":{ + "track":"Gleis" + }, "remarks":{ "bicycle-conveyance":"Fahrradmitnahme möglich", "bicycle-conveyance-reservation":"Fahrradmitnahme reservierungspflichtig", @@ -29,7 +32,23 @@ "compulsary-reservation":"Reservierungspflicht", "2nd-class-only":"Nur 2. Klasse", "RZ":"Rollstuhlgerechter Einstieg", - "on-board-restaurant":"Boardrestaurant vorhanden" + "on-board-restaurant":"Boardrestaurant vorhanden", + "EA":"Behindertengerechte Ausstattung", + "FM": "Fahrkartenautomat im Fahrzeug", + "boarding-ramp": "Einstieghilfe im Fahrzeug", + "no-bicycle-conveyance": "Einstieghilfe im Fahrzeug", + "OB": "Niederflurfahrzeug", + "RO": "Rollstuhlstellplatz", + "OA": "Rollstuhlstellplatz, Voranmeldung unter +43 5 1717", + "EF": "Fahrzeuggebundene Einstieghilfe", + "OC": "Rollstuhltaugliches WC", + "FK": "Fahrradmitnahme möglich", + "K2": "Nur 2. Klasse", + "J2": "in Sitzwagen nur 2. Klasse", + "SB": "Zustieg nur mit gültiger Fahrkarte", + "WV": "WLAN verfügbar", + "fC": "Kleinbus, Fahrtanmeldung bei Gruppen ab 10 Personen unter gruppen.vmobil.at", + "FR":"Fahrradmitnahme reservierungspflichtig" } } } \ No newline at end of file diff --git a/front/bahnui-front/src/locales/en.json b/front/bahnui-front/src/locales/en.json index c428ce8..7a9e3ab 100644 --- a/front/bahnui-front/src/locales/en.json +++ b/front/bahnui-front/src/locales/en.json @@ -17,6 +17,9 @@ } }, "routing":{ + "text":{ + "track":"Track" + }, "remarks":{ "bicycle-conveyance":"bicycles allowed", "bicycle-conveyance-reservation":"bicycles need reservation", diff --git a/front/bahnui-front/src/locales/fr.json b/front/bahnui-front/src/locales/fr.json new file mode 100644 index 0000000..daa99fa --- /dev/null +++ b/front/bahnui-front/src/locales/fr.json @@ -0,0 +1,54 @@ +{ + "global":{ + "option":{ + "mobile": "mobile" + } + }, + "search":{ + "fields":{ + "service":"service", + "date":"date", + "time":"heure", + "from":"de", + "to":"à" + }, + "buttons":{ + "searchConnection":"rechercher" + } + }, + "routing":{ + "text":{ + "track":"voie" + }, + "remarks":{ + "bicycle-conveyance":"Fahrradmitnahme möglich", + "bicycle-conveyance-reservation":"Fahrradmitnahme reservierungspflichtig", + "power-sockets":"Steckdosen für Laptops vorhanden", + "barrier-free-vehicle":"Behindertengerechtes Fahrzeug", + "wheelchairs-space":"Rollstuhlplatz vorhanden", + "air-conditioned":"klimatisiertes Fahrzeug", + "55":"Rauchen verboten", + "wifi":"WLAN vorhanden", + "compulsary-reservation":"Reservierungspflicht", + "2nd-class-only":"Nur 2. Klasse", + "RZ":"Rollstuhlgerechter Einstieg", + "on-board-restaurant":"Boardrestaurant vorhanden", + "EA":"Behindertengerechte Ausstattung", + "FM": "Fahrkartenautomat im Fahrzeug", + "boarding-ramp": "Einstieghilfe im Fahrzeug", + "no-bicycle-conveyance": "Einstieghilfe im Fahrzeug", + "OB": "Niederflurfahrzeug", + "RO": "Rollstuhlstellplatz", + "OA": "Rollstuhlstellplatz, Voranmeldung unter +43 5 1717", + "EF": "Fahrzeuggebundene Einstieghilfe", + "OC": "Rollstuhltaugliches WC", + "FK": "Fahrradmitnahme möglich", + "K2": "Nur 2. Klasse", + "J2": "in Sitzwagen nur 2. Klasse", + "SB": "Zustieg nur mit gültiger Fahrkarte", + "WV": "WLAN verfügbar", + "fC": "Kleinbus, Fahrtanmeldung bei Gruppen ab 10 Personen unter gruppen.vmobil.at", + "FR":"Fahrradmitnahme reservierungspflichtig" + } + } +} \ No newline at end of file diff --git a/front/bahnui-front/src/locales/ua.json b/front/bahnui-front/src/locales/ua.json new file mode 100644 index 0000000..f4c3eb8 --- /dev/null +++ b/front/bahnui-front/src/locales/ua.json @@ -0,0 +1,54 @@ +{ + "global":{ + "option":{ + "mobile": "mobile" + } + }, + "search":{ + "fields":{ + "service":"service", + "date":"дата", + "time":"час", + "from":"від", + "to":"в" + }, + "buttons":{ + "searchConnection":"rechercher" + } + }, + "routing":{ + "text":{ + "track":"Gleis" + }, + "remarks":{ + "bicycle-conveyance":"Fahrradmitnahme möglich", + "bicycle-conveyance-reservation":"Fahrradmitnahme reservierungspflichtig", + "power-sockets":"Steckdosen für Laptops vorhanden", + "barrier-free-vehicle":"Behindertengerechtes Fahrzeug", + "wheelchairs-space":"Rollstuhlplatz vorhanden", + "air-conditioned":"klimatisiertes Fahrzeug", + "55":"Rauchen verboten", + "wifi":"WLAN vorhanden", + "compulsary-reservation":"Reservierungspflicht", + "2nd-class-only":"Nur 2. Klasse", + "RZ":"Rollstuhlgerechter Einstieg", + "on-board-restaurant":"Boardrestaurant vorhanden", + "EA":"Behindertengerechte Ausstattung", + "FM": "Fahrkartenautomat im Fahrzeug", + "boarding-ramp": "Einstieghilfe im Fahrzeug", + "no-bicycle-conveyance": "Einstieghilfe im Fahrzeug", + "OB": "Niederflurfahrzeug", + "RO": "Rollstuhlstellplatz", + "OA": "Rollstuhlstellplatz, Voranmeldung unter +43 5 1717", + "EF": "Fahrzeuggebundene Einstieghilfe", + "OC": "Rollstuhltaugliches WC", + "FK": "Fahrradmitnahme möglich", + "K2": "Nur 2. Klasse", + "J2": "in Sitzwagen nur 2. Klasse", + "SB": "Zustieg nur mit gültiger Fahrkarte", + "WV": "WLAN verfügbar", + "fC": "Kleinbus, Fahrtanmeldung bei Gruppen ab 10 Personen unter gruppen.vmobil.at", + "FR":"Fahrradmitnahme reservierungspflichtig" + } + } +} \ No newline at end of file diff --git a/front/bahnui-front/src/main.js b/front/bahnui-front/src/main.js index 7f0812a..78c94a9 100644 --- a/front/bahnui-front/src/main.js +++ b/front/bahnui-front/src/main.js @@ -12,6 +12,8 @@ import SearchBahn from './components/search.vue' import { createI18n } from 'vue-i18n' import de from "./locales/de.json"; import en from "./locales/en.json"; +import fr from "./locales/fr.json"; +import ua from "./locales/ua.json"; const app = createApp(App) @@ -31,7 +33,7 @@ const vuetify = createVuetify({ const i18n = createI18n({ locale: "en", fallbackLocale: "en", - messages: { de, en }, + messages: { de, en, fr, ua }, }) app.use(vuetify).use(router).use(i18n).mount('#app')