diff --git a/src/components/JournalView/JournalDispatchersList.vue b/src/components/JournalView/JournalDispatchersList.vue index b21cf65..2e2790a 100644 --- a/src/components/JournalView/JournalDispatchersList.vue +++ b/src/components/JournalView/JournalDispatchersList.vue @@ -24,6 +24,7 @@ {{ $t('journal.history-dispatcher') }} {{ $t('journal.history-level') }} {{ $t('journal.history-rate') }} + {{ $t('journal.history-region') }} {{ $t('journal.history-date') }} @@ -54,6 +55,12 @@ {{ historyItem.dispatcherRate }} + + {{ + regions.find((r) => r.id == historyItem.region)?.value || '???' + }} + + {{ $d(historyItem.timestampFrom) }} @@ -108,6 +115,7 @@ import imageMixin from '../../mixins/imageMixin'; import { DataStatus } from '../../scripts/enums/DataStatus'; import { useStore } from '../../store/store'; import Loading from '../Global/Loading.vue'; +import { regions } from '../../data/options.json'; export default defineComponent({ components: { Loading }, @@ -137,11 +145,14 @@ export default defineComponent({ return { DataStatus, store: useStore(), + regions, }; }, computed: { computedDispatcherHistory() { + console.log(this.dispatcherHistory.length); + return this.dispatcherHistory.reduce((acc, historyItem, i) => { if (this.isAnotherDay(i - 1, i)) acc.push(new Date(historyItem.timestampFrom).toLocaleDateString('pl-PL')); acc.push(historyItem); diff --git a/src/locales/en.json b/src/locales/en.json index 404f722..4d72ffd 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -346,6 +346,7 @@ "history-dispatcher": "Dispatcher", "history-level": "Level", "history-rate": "Rate", + "history-region": "Region", "history-date": "Service date" }, "scenery": { diff --git a/src/locales/pl.json b/src/locales/pl.json index 4e23274..7aaf23b 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -349,6 +349,7 @@ "history-dispatcher": "Dyżurny", "history-level": "Poziom", "history-rate": "Ocena", + "history-region": "Region", "history-date": "Data służby" }, "scenery": { diff --git a/src/styles/badge.scss b/src/styles/badge.scss index 65b6598..bd260ea 100644 --- a/src/styles/badge.scss +++ b/src/styles/badge.scss @@ -46,13 +46,33 @@ } .region-badge { - padding: 0 0.5em; + padding: 0.25em 0.5em; border-radius: 0.5em; font-weight: bold; + color: white; - &.eu { + &[aria-describedby='eu'] { background-color: forestgreen; } + + &[aria-describedby='cae'] { + background-color: lightcoral; + color: black; + } + + &[aria-describedby='usw'] { + background-color: lightblue; + color: black; + } + + &[aria-describedby='us'] { + background-color: lightblue; + color: black; + } + + &[aria-describedby='ru'] { + background-color: lightslategray; + } } .train-badge {