chore: journal timetables buttons alignment

This commit is contained in:
2024-08-15 15:01:36 +02:00
parent c29c3c6abe
commit 300e70dcfe
2 changed files with 21 additions and 17 deletions
@@ -5,6 +5,15 @@
<b>{{ $t('journal.stock-info') }}</b> <b>{{ $t('journal.stock-info') }}</b>
<img :src="`/images/icon-arrow-${showExtraInfo ? 'asc' : 'desc'}.svg`" alt="Arrow icon" /> <img :src="`/images/icon-arrow-${showExtraInfo ? 'asc' : 'desc'}.svg`" alt="Arrow icon" />
</button> </button>
<button
v-if="timetable.terminated == false"
class="btn--action btn-timetable"
@click.stop="showTimetable(timetable, $event.currentTarget)"
>
<img src="/images/icon-train.svg" alt="train icon" />
<b>{{ $t('journal.timetable-online-button') }}</b>
</button>
</div> </div>
<div class="details-body" v-if="timetable.stockString && timetable.stockMass && showExtraInfo"> <div class="details-body" v-if="timetable.stockString && timetable.stockMass && showExtraInfo">
@@ -77,9 +86,13 @@
import { PropType, defineComponent } from 'vue'; import { PropType, defineComponent } from 'vue';
import StockList from '../../Global/StockList.vue'; import StockList from '../../Global/StockList.vue';
import { API } from '../../../typings/api'; import { API } from '../../../typings/api';
import modalTrainMixin from '../../../mixins/modalTrainMixin';
export default defineComponent({ export default defineComponent({
components: { StockList }, components: { StockList },
mixins: [modalTrainMixin],
props: { props: {
showExtraInfo: { showExtraInfo: {
type: Boolean, type: Boolean,
@@ -118,6 +131,12 @@ export default defineComponent({
onImageError(e: Event) { onImageError(e: Event) {
const imageEl = e.target as HTMLImageElement; const imageEl = e.target as HTMLImageElement;
imageEl.src = '/images/icon-unknown.png'; imageEl.src = '/images/icon-unknown.png';
},
showTimetable(timetable: API.TimetableHistory.Data, target: EventTarget | null) {
if (timetable?.terminated) return;
this.selectModalTrainById(`${timetable.driverName}${timetable.trainNo}`, target);
} }
} }
}); });
@@ -134,6 +153,7 @@ export default defineComponent({
.details-actions { .details-actions {
display: flex; display: flex;
gap: 0.5em;
button img { button img {
height: 1.25em; height: 1.25em;
@@ -66,15 +66,6 @@
: `${$t('journal.timetable-abandoned')} ${localeTime(timetable.endDate, $i18n.locale)}` : `${$t('journal.timetable-abandoned')} ${localeTime(timetable.endDate, $i18n.locale)}`
}} }}
</b> </b>
<button
v-if="timetable.terminated == false"
class="btn--action btn-timetable"
@click.stop="showTimetable(timetable, $event.currentTarget)"
>
<img src="/images/icon-train.svg" alt="train icon" />
<b>{{ $t('journal.timetable-online-button') }}</b>
</button>
</span> </span>
</div> </div>
</template> </template>
@@ -104,14 +95,6 @@ export default defineComponent({
required: true required: true
} }
}, },
methods: {
showTimetable(timetable: API.TimetableHistory.Data, target: EventTarget | null) {
if (timetable?.terminated) return;
this.selectModalTrainById(`${timetable.driverName}${timetable.trainNo}`, target);
}
}
}); });
</script> </script>
@@ -180,6 +163,7 @@ export default defineComponent({
@include smallScreen { @include smallScreen {
.item-general { .item-general {
flex-direction: column;
justify-content: center; justify-content: center;
} }
} }