diff --git a/src/components/tabs/stock-list/StockWarnings.vue b/src/components/tabs/stock-list/StockWarnings.vue index 185a897..4f609f9 100644 --- a/src/components/tabs/stock-list/StockWarnings.vue +++ b/src/components/tabs/stock-list/StockWarnings.vue @@ -16,6 +16,8 @@ {{ [...store.cargoWarnings].map((v) => $t(`cargo-warnings.${v}`)).join('; ') }} +
(!) {{ $t('stocklist.warning-prsm4-not-at-the-rear') }}
+
(!) @@ -68,6 +70,12 @@ export default defineComponent({ this.store.stockList.some((stock) => isTractionUnit(stock.vehicleRef) && stock.vehicleRef.type.startsWith('EP')) ); }, + + isRearPRSM4() { + if (this.store.stockList.length <= 1) return true; + + return this.store.stockList.findIndex((stock) => stock.vehicleRef.type.startsWith('PRSM4')) == (this.store.stockList.length - 1 || -1); + }, }, }); diff --git a/src/locales/en.json b/src/locales/en.json index 5547060..584a98d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -84,6 +84,7 @@ "warning-too-many-locos": "This train has too many traction units!", "warning-too-heavy": "This train is too heavy! Check {href}", "warning-team-only-vehicle": "There's at least one vehicle available only for TD2 team members in your stock composition! ({0})", + "warning-prsm4-not-at-the-rear": "PRSM4 welding car must be at the end of a train!", "acceptable-mass-docs": "acceptable rolling stock masses (PL)", "stock-loading-error": "An error occurred: cannot parse data from the file - make sure it's in a proper format!", "stock-clipboard-error": "An error occurred: cannot read data from the clipboard - make sure the site has been granted right permissions for this action!" diff --git a/src/locales/pl.json b/src/locales/pl.json index 36cd088..845c8a6 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -84,6 +84,7 @@ "warning-too-many-locos": "Ten skład posiada za dużo pojazdów trakcyjnych!", "warning-too-heavy": "Ten skład jest za ciężki! Sprawdź {href}", "warning-team-only-vehicle": "W zestawieniu znajduje się co najmniej jeden pojazd dostępny tylko dla członków zespołu TD2! ({0})", + "warning-prsm4-not-at-the-rear": "Zgrzewarka PRSM4 może znajdować się jedynie na końcu składu w przypadku jazdy pociągowej!", "acceptable-mass-docs": "dopuszczalne masy składów", "stock-loading-error": "Wystąpił błąd: nie można przetworzyć danych ze schowka! Upewnij się, że są one w poprawnym formacie!", "stock-clipboard-error": "Wystąpił błąd: nie można odczytać danych ze schowka! Upewnij się, że nadałeś uprawnienia stronie do tej akcji!"