chore: entry details backwards comp.

This commit is contained in:
2024-09-03 15:18:59 +02:00
parent 275d602f97
commit f4b0c39185
5 changed files with 36 additions and 18 deletions
@@ -2,7 +2,7 @@
<div>
<div class="details-actions">
<button class="btn--action" @click="toggleExtraInfo">
<b>{{ $t('journal.stock-info') }}</b>
<b>{{ $t('journal.entry-details') }}</b>
<img :src="`/images/icon-arrow-${showExtraInfo ? 'asc' : 'desc'}.svg`" alt="Arrow icon" />
</button>
@@ -16,18 +16,18 @@
</router-link>
</div>
<div class="details-body" v-if="timetable.stockString && timetable.stockMass && showExtraInfo">
<div class="details-body" v-if="showExtraInfo">
<hr />
<EntryStops :timetable="timetable" />
<div class="stock-specs">
<div class="stock-specs" v-if="timetable.authorName">
<span class="badge">
<span>{{ $t('journal.dispatcher-name') }}</span>
<span>{{ timetable.authorName }}</span>
</span>
</div>
<div class="stock-specs">
<div class="stock-specs" v-if="timetable.stockMass && timetable.stockHistory.length > 0">
<span class="badge">
<span>{{ $t('journal.stock-max-speed') }}</span>
<span>{{ timetable.maxSpeed }}km/h</span>
@@ -71,14 +71,16 @@
</button>
</div>
<StockList
:trainStockList="
(currentHistoryIndex == 0
? timetable.stockString
: stockHistory[currentHistoryIndex].stockString
).split(';')
"
/>
<div v-if="timetable.stockString">
<StockList
:trainStockList="
(currentHistoryIndex == 0
? timetable.stockString
: stockHistory[currentHistoryIndex].stockString
).split(';')
"
/>
</div>
</div>
<div v-if="timetable.twr">TWR: {{ timetable.warningNotes }}</div>
@@ -124,13 +124,17 @@ export default defineComponent({
const [arrival, name, departure] = pathEl.split(',');
const sceneryName = name.split(' ').slice(0, -1).join(' ');
const sceneryHash = name.split(' ').pop()?.replace('.sc', '') ?? '';
const isVisited = this.timetable.visitedSceneries.includes(sceneryHash);
return {
arrival,
sceneryName,
sceneryHash,
departure,
isVisited: this.timetable.visitedSceneries?.includes(sceneryHash) ?? false
isVisited,
isVisitedOffline:
!isVisited &&
this.timetable.visitedSceneries.includes(`${sceneryName} ${sceneryHash}.sc`)
};
});
},
@@ -162,7 +166,7 @@ export default defineComponent({
: timetable.checkpointDeparturesScheduled.at(i);
const stopTime = Number(timetable.checkpointStopTypes.at(i)?.split(',')[0]) || 0;
const stopType = timetable.checkpointStopTypes.at(i)?.split(',')[1] || '';
const stopType = timetable.checkpointStopTypes.at(i)?.split(',').slice(1).join(',') || 'pt';
acc.push({
stopName,
@@ -209,6 +213,10 @@ export default defineComponent({
&[data-confirmed='true'] > .stop-name {
color: lightgreen;
}
&[data-confirmed='true'] > .stop-date:not([data-preponed='true']):not([data-delayed='true']) {
color: lightgreen;
}
}
.stop-name {
@@ -217,6 +225,8 @@ export default defineComponent({
}
.stop-date {
color: #ccc;
s {
color: #aaa;
}
@@ -226,7 +236,7 @@ export default defineComponent({
}
&[data-preponed='true'] {
color: lightgreen;
color: mediumspringgreen;
}
}