mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Poprawiono listę uwag eksploatacyjnych
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="timetable_comments" v-if="getSceneriesWithComments(train.timetableData).length > 0 && isInfoShown">
|
<div class="timetable_comments" v-if="getSceneriesWithComments(train.timetableData).length > 0 && isInfoShown">
|
||||||
{{ $t('trains.comment') }} <b>{{ getSceneriesWithComments(train.timetableData).join(',') }}</b>
|
{{ $t('trains.comment') }} <b>{{ getSceneriesWithComments(train.timetableData) }}</b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
v-if="getSceneriesWithComments(train.timetableData).length > 0"
|
v-if="getSceneriesWithComments(train.timetableData).length > 0"
|
||||||
class="image-warning"
|
class="image-warning"
|
||||||
:src="icons.warning"
|
:src="icons.warning"
|
||||||
:title="`${$t('trains.timetable-comments')} (${getSceneriesWithComments(train.timetableData).join(',')})`"
|
:title="`${$t('trains.timetable-comments')} (${getSceneriesWithComments(train.timetableData)})`"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default defineComponent({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
displayStopList(stops: TrainStop[]): string | undefined {
|
displayStopList(stops: TrainStop[]): string | undefined {
|
||||||
if (!stops) return '';
|
if (!stops) return '';
|
||||||
@@ -91,13 +91,16 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getSceneriesWithComments(timetableData: Train['timetableData']) {
|
getSceneriesWithComments(timetableData: Train['timetableData']) {
|
||||||
return (
|
const commentList = timetableData?.followingStops.reduce((acc, stop, i) => {
|
||||||
timetableData?.followingStops.reduce((acc, stop) => {
|
if (stop.comments) acc.push(stop.stopNameRAW);
|
||||||
if (stop.comments) acc.push(stop.stopNameRAW);
|
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, [] as string[]) || []
|
}, [] as string[]) || []
|
||||||
);
|
|
||||||
|
const moreCount = commentList.length - 10;
|
||||||
|
|
||||||
|
|
||||||
|
return commentList.slice(0,10).join(", ") + (moreCount > 0 ? `... (+${moreCount})` : '');
|
||||||
},
|
},
|
||||||
|
|
||||||
displayDistance(distance: number) {
|
displayDistance(distance: number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user