mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
fix: progress indicator
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
class="stop-label"
|
class="stop-label"
|
||||||
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
|
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
|
||||||
>
|
>
|
||||||
<router-link v-if="/(, podg|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
|
<router-link v-if="/(, podg$|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
|
||||||
<span class="name" v-html="stop.nameHtml"></span>
|
<span class="name" v-html="stop.nameHtml"></span>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
<div class="general-stops" v-if="train.timetableData">
|
<div class="general-stops" v-if="train.timetableData">
|
||||||
<span v-if="train.timetableData.followingStops.length > 2">
|
<span v-if="train.timetableData.followingStops.length > 2">
|
||||||
{{ $t('trains.via-title') }}
|
{{ $t('trains.via-title') }}
|
||||||
<span v-html="displayStopList(train.timetableData.followingStops)"></span>
|
<span v-html="getTrainStopsHtml(train.timetableData.followingStops)"></span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ export default defineComponent({
|
|||||||
i < this.train.timetableData!.followingStops.length;
|
i < this.train.timetableData!.followingStops.length;
|
||||||
i++
|
i++
|
||||||
) {
|
) {
|
||||||
if (/(, po|sbl|, pe)/gi.test(this.train.timetableData!.followingStops[i].stopNameRAW))
|
if (/(, po$|sbl|, pe$)/gi.test(this.train.timetableData!.followingStops[i].stopNameRAW))
|
||||||
activeMinorStopList.push(i);
|
activeMinorStopList.push(i);
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,18 +75,18 @@ export default defineComponent({
|
|||||||
return positionString.charAt(0).toUpperCase() + positionString.slice(1);
|
return positionString.charAt(0).toUpperCase() + positionString.slice(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
displayStopList(stops: TrainStop[]): string | undefined {
|
getTrainStopsHtml(stops: TrainStop[]): string {
|
||||||
if (!stops) return '';
|
if (!stops) return '';
|
||||||
|
|
||||||
return stops
|
return stops
|
||||||
.reduce((acc: string[], stop: TrainStop, i: number) => {
|
.reduce((acc: string[], stop: TrainStop, i: number) => {
|
||||||
if (stop.stopType.includes('ph') && !stop.stopNameRAW.includes(', po'))
|
if (stop.stopType.includes('ph'))
|
||||||
acc.push(
|
acc.push(
|
||||||
`<strong style='color:${stop.confirmed ? 'springgreen' : 'white'}'>${
|
`<strong style='color:${stop.confirmed ? 'springgreen' : 'white'}'>${
|
||||||
stop.stopName
|
stop.stopName
|
||||||
}</strong>`
|
}</strong>`
|
||||||
);
|
);
|
||||||
else if (i > 0 && i < stops.length - 1 && !/(, po|sbl)/gi.test(stop.stopNameRAW))
|
else if (i > 0 && i < stops.length - 1 && !/(, po$|sbl)/gi.test(stop.stopNameRAW))
|
||||||
acc.push(
|
acc.push(
|
||||||
`<span style='color:${stop.confirmed ? 'springgreen' : 'lightgray'}'>${
|
`<span style='color:${stop.confirmed ? 'springgreen' : 'lightgray'}'>${
|
||||||
stop.stopName
|
stop.stopName
|
||||||
|
|||||||
Reference in New Issue
Block a user