Dodano ostrzeżenie dla dystansów RJ większych niż 200km

This commit is contained in:
2021-06-12 20:59:48 +02:00
parent 3a104556f7
commit fed467cb72
3 changed files with 23 additions and 3 deletions
+19 -1
View File
@@ -1,5 +1,9 @@
<template>
<div class="train-table">
<div class="traffic-warning" v-if="distanceLimitExceeded">
{{ $t("trains.distance-exceeded") }}
</div>
<div class="no-trains" v-if="computedTrains.length == 0 && timetableLoaded">
{{ $t("trains.no-trains") }}
</div>
@@ -303,6 +307,15 @@ export default class TrainTable extends Vue {
return this.timetableDataStatus == DataStatus.Error;
}
get distanceLimitExceeded() {
return (
this.computedTrains.findIndex(
(train) =>
train.timetableData && train.timetableData.routeDistance > 200
) != -1
);
}
changeScheduleShowState(elementId: number) {
if (elementId < 0) return;
@@ -383,6 +396,12 @@ img.train-image {
width: 12em;
}
.traffic-warning {
padding: 1em 0.5em;
margin-bottom: 0.5em;
background: firebrick;
}
.train {
&-list {
@include smallScreen() {
@@ -395,7 +414,6 @@ img.train-image {
margin-bottom: 1em;
background-color: var(--clr-secondary);
cursor: pointer;
}