Commit ae43b249 authored by Volker Krause's avatar Volker Krause

Move barcodes out of the FormLayout

This allows us to make them use the full screen width, while the form
layout only is as wide as its other content.
parent b8200602
......@@ -27,11 +27,11 @@ App.DetailsPage {
id: root
title: i18n("Bus Ticket")
Kirigami.FormLayout {
width: root.width
ColumnLayout {
width: parent.width
QQC2.Label {
Kirigami.FormData.isSection: true
Layout.fillWidth: true
text: reservationFor.busName + " " + reservationFor.busNumber
horizontalAlignment: Qt.AlignHCenter
font.bold: true
......@@ -39,66 +39,69 @@ App.DetailsPage {
// ticket barcode
App.TicketTokenDelegate {
Kirigami.FormData.isSection: true
resIds: _reservationManager.reservationsForBatch(root.batchId)
}
// departure data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Departure")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "departureTime")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.departureBusStop.name
}
App.PlaceDelegate {
place: reservationFor.departureBusStop
}
Kirigami.FormLayout {
Layout.fillWidth: true
// arrival data
Kirigami.Separator {
Kirigami.FormData.label: i18n("Arrival")
Kirigami.FormData.isSection: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "arrivalTime")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.arrivalBusStop.name
}
App.PlaceDelegate {
place: reservationFor.arrivalBusStop
}
// departure data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Departure")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "departureTime")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.departureBusStop.name
}
App.PlaceDelegate {
place: reservationFor.departureBusStop
}
// seat reservation
Kirigami.Separator {
Kirigami.FormData.label: i18n("Seat")
Kirigami.FormData.isSection: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Seat:")
text: reservation.reservedTicket.ticketedSeat.seatNumber
}
// arrival data
Kirigami.Separator {
Kirigami.FormData.label: i18n("Arrival")
Kirigami.FormData.isSection: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "arrivalTime")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.arrivalBusStop.name
}
App.PlaceDelegate {
place: reservationFor.arrivalBusStop
}
// booking details
Kirigami.Separator {
Kirigami.FormData.label: i18n("Booking")
Kirigami.FormData.isSection: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Reference:")
text: reservation.reservationNumber
}
QQC2.Label {
Kirigami.FormData.label: i18n("Under name:")
text: reservation.underName.name
// seat reservation
Kirigami.Separator {
Kirigami.FormData.label: i18n("Seat")
Kirigami.FormData.isSection: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Seat:")
text: reservation.reservedTicket.ticketedSeat.seatNumber
}
// booking details
Kirigami.Separator {
Kirigami.FormData.label: i18n("Booking")
Kirigami.FormData.isSection: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Reference:")
text: reservation.reservationNumber
}
QQC2.Label {
Kirigami.FormData.label: i18n("Under name:")
text: reservation.underName.name
}
}
}
}
......@@ -27,41 +27,45 @@ App.DetailsPage {
id: root
title: i18n("Event")
Kirigami.FormLayout {
width: root.width
ColumnLayout {
width: parent.width
QQC2.Label {
Kirigami.FormData.isSection: true
Layout.fillWidth: true
text: reservationFor.name
horizontalAlignment: Qt.AlignHCenter
font.bold: true
}
App.TicketTokenDelegate {
Kirigami.FormData.isSection: true
resIds: _reservationManager.reservationsForBatch(root.batchId)
}
QQC2.Label {
Kirigami.FormData.label: i18n("Location:")
text: reservationFor.location.name
}
Kirigami.FormLayout {
Layout.fillWidth: true
App.PlaceDelegate {
place: reservationFor.location
}
QQC2.Label {
Kirigami.FormData.label: i18n("Entrance:")
text: Localizer.formatDateTime(reservationFor, "doorTime")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Start Time:")
text: Localizer.formatDateTime(reservationFor, "startDate")
}
QQC2.Label {
Kirigami.FormData.label: i18n("End Time:")
text: Localizer.formatDateTime(reservationFor, "endDate")
QQC2.Label {
Kirigami.FormData.label: i18n("Location:")
text: reservationFor.location.name
}
App.PlaceDelegate {
place: reservationFor.location
}
QQC2.Label {
Kirigami.FormData.label: i18n("Entrance:")
text: Localizer.formatDateTime(reservationFor, "doorTime")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Start Time:")
text: Localizer.formatDateTime(reservationFor, "startDate")
}
QQC2.Label {
Kirigami.FormData.label: i18n("End Time:")
text: Localizer.formatDateTime(reservationFor, "endDate")
}
}
}
}
......@@ -33,11 +33,11 @@ App.DetailsPage {
}
}
Kirigami.FormLayout {
width: root.width
ColumnLayout {
width: parent.width
QQC2.Label {
Kirigami.FormData.isSection: true
Layout.fillWidth: true
text: reservationFor.airline.iataCode + " " + reservationFor.flightNumber
horizontalAlignment: Qt.AlignHCenter
font.bold: true
......@@ -45,106 +45,109 @@ App.DetailsPage {
// ticket barcode
App.TicketTokenDelegate {
Kirigami.FormData.isSection: true
resIds: _reservationManager.reservationsForBatch(root.batchId)
onCurrentReservationIdChanged: root.currentReservationId = currentReservationId
}
// flight details
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Flight")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Boarding:")
text: Localizer.formatDateTime(reservationFor, "boardingTime")
visible: reservationFor.boardingTime > 0
Kirigami.FormLayout {
Layout.fillWidth: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Boarding group:")
text: reservation.boardingGroup
visible: reservation.boardingGroup.length > 0
// flight details
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Flight")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Boarding:")
text: Localizer.formatDateTime(reservationFor, "boardingTime")
visible: reservationFor.boardingTime > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Seat:")
text: reservation.airplaneSeat
visible: reservation.airplaneSeat.length > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Boarding group:")
text: reservation.boardingGroup
visible: reservation.boardingGroup.length > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Airline:")
text: reservationFor.airline.name
visible: reservationFor.airline.name.length > 0
}
}
QQC2.Label {
Kirigami.FormData.label: i18n("Seat:")
text: reservation.airplaneSeat
visible: reservation.airplaneSeat.length > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Airline:")
text: reservationFor.airline.name
visible: reservationFor.airline.name.length > 0
}
// departure data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Departure")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "departureTime")
visible: reservationFor.departureTime > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Airport:")
text: reservationFor.departureAirport.name + " (" + reservationFor.departureAirport.iataCode + ")"
visible: reservationFor.departureAirport.name.length > 0
}
App.PlaceDelegate {
place: reservationFor.departureAirport
}
QQC2.Label {
Kirigami.FormData.label: i18n("Terminal:")
text: reservationFor.departureTerminal
visible: reservationFor.departureTerminal.length > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Gate:")
text: reservationFor.departureGate
visible: reservationFor.departureGate.length > 0
}
// departure data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Departure")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "departureTime")
visible: reservationFor.departureTime > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Airport:")
text: reservationFor.departureAirport.name + " (" + reservationFor.departureAirport.iataCode + ")"
visible: reservationFor.departureAirport.name.length > 0
}
App.PlaceDelegate {
place: reservationFor.departureAirport
}
QQC2.Label {
Kirigami.FormData.label: i18n("Terminal:")
text: reservationFor.departureTerminal
visible: reservationFor.departureTerminal.length > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Gate:")
text: reservationFor.departureGate
visible: reservationFor.departureGate.length > 0
}
// arrival data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Arrival")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "arrivalTime")
visible: reservationFor.arrivalTime > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Airport:")
text: reservationFor.arrivalAirport.name + " (" + reservationFor.arrivalAirport.iataCode + ")"
visible: reservationFor.arrivalAirport.name.length > 0
}
App.PlaceDelegate {
place: reservationFor.arrivalAirport
}
QQC2.Label {
Kirigami.FormData.label: i18n("Terminal:")
text: reservationFor.arrivalTerminal
visible: reservationFor.arrivalTerminal.length > 0
}
// booking details
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Booking")
}
Repeater {
model: resIds.length * 2
delegate: QQC2.Label {
property var res: _reservationManager.reservation(resIds[Math.floor(index/2)]);
Kirigami.FormData.label: index % 2 == 0 ? i18n("Under name:") : i18n("Reference:")
text: index % 2 == 0 ? res.underName.name : res.reservationNumber
// arrival data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Arrival")
}
QQC2.Label {
Kirigami.FormData.label: i18n("Time:")
text: Localizer.formatDateTime(reservationFor, "arrivalTime")
visible: reservationFor.arrivalTime > 0
}
QQC2.Label {
Kirigami.FormData.label: i18n("Airport:")
text: reservationFor.arrivalAirport.name + " (" + reservationFor.arrivalAirport.iataCode + ")"
visible: reservationFor.arrivalAirport.name.length > 0
}
App.PlaceDelegate {
place: reservationFor.arrivalAirport
}
QQC2.Label {
Kirigami.FormData.label: i18n("Terminal:")
text: reservationFor.arrivalTerminal
visible: reservationFor.arrivalTerminal.length > 0
}
// booking details
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Booking")
}
Repeater {
model: resIds.length * 2
delegate: QQC2.Label {
property var res: _reservationManager.reservation(resIds[Math.floor(index/2)]);
Kirigami.FormData.label: index % 2 == 0 ? i18n("Under name:") : i18n("Reference:")
text: index % 2 == 0 ? res.underName.name : res.reservationNumber
}
}
}
}
......
......@@ -51,11 +51,11 @@ App.DetailsPage {
actions.contextualActions.push(alternativeAction.createObject(root));
}
Kirigami.FormLayout {
width: root.width
ColumnLayout {
width: parent.width
QQC2.Label {
Kirigami.FormData.isSection: true
Layout.fillWidth: true
text: reservationFor.trainName + " " + reservationFor.trainNumber
horizontalAlignment: Qt.AlignHCenter
font.bold: true
......@@ -63,113 +63,116 @@ App.DetailsPage {
// ticket barcode
App.TicketTokenDelegate {
Kirigami.FormData.isSection: true
resIds: _reservationManager.reservationsForBatch(root.batchId)
}
// departure data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Departure")
}
RowLayout {
Kirigami.FormData.label: i18n("Time:")
QQC2.Label {
text: Localizer.formatDateTime(reservationFor, "departureTime")
Kirigami.FormLayout {
Layout.fillWidth: true
// departure data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Departure")
}
QQC2.Label {
text: (departure.departureDelay >= 0 ? "+" : "") + departure.departureDelay
color: (departure.departureDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor
visible: departure.hasExpectedDepartureTime
RowLayout {
Kirigami.FormData.label: i18n("Time:")
QQC2.Label {
text: Localizer.formatDateTime(reservationFor, "departureTime")
}
QQC2.Label {
text: (departure.departureDelay >= 0 ? "+" : "") + departure.departureDelay
color: (departure.departureDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor
visible: departure.hasExpectedDepartureTime
}
}
}
QQC2.Label {
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.departureStation.name
}
App.PlaceDelegate {
place: reservationFor.departureStation
}
RowLayout {
Kirigami.FormData.label: i18n("Platform:")
QQC2.Label {
text: departure.hasExpectedPlatform ? departure.expectedPlatform : reservationFor.departurePlatform
color: departure.platformChanged ? Kirigami.Theme.negativeTextColor :
departure.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor :
Kirigami.Theme.textColor;
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.departureStation.name
}
App.PlaceDelegate {
place: reservationFor.departureStation
}
RowLayout {
Kirigami.FormData.label: i18n("Platform:")
QQC2.Label {
text: departure.hasExpectedPlatform ? departure.expectedPlatform : reservationFor.departurePlatform
color: departure.platformChanged ? Kirigami.Theme.negativeTextColor :
departure.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor :
Kirigami.Theme.textColor;
}
QQC2.Label {
text: i18n("(was: %1)", reservationFor.departurePlatform)
visible: departure.platformChanged && reservationFor.departurePlatform != ""
}
}
// arrival data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Arrival")
}
RowLayout {
Kirigami.FormData.label: i18n("Arrival time:")
QQC2.Label {
text: Localizer.formatDateTime(reservationFor, "arrivalTime")
}
QQC2.Label {
text: (arrival.arrivalDelay >= 0 ? "+" : "") + arrival.arrivalDelay
color: (arrival.arrivalDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor
visible: arrival.hasExpectedArrivalTime
}
}
QQC2.Label {
text: i18n("(was: %1)", reservationFor.departurePlatform)
visible: departure.platformChanged && reservationFor.departurePlatform != ""
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.arrivalStation.name
}
App.PlaceDelegate {
place: reservationFor.arrivalStation
}
RowLayout {
Kirigami.FormData.label: i18n("Platform:")
QQC2.Label {
text: arrival.hasExpectedPlatform ? arrival.expectedPlatform : reservationFor.arrivalPlatform
color: arrival.platformChanged ? Kirigami.Theme.negativeTextColor :
arrival.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor :
Kirigami.Theme.textColor;
}
QQC2.Label {
text: i18n("(was: %1)", reservationFor.arrivalPlatform)
visible: arrival.platformChanged && reservationFor.arrivalPlatform != ""
}
}
}
// arrival data
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Arrival")
}
RowLayout {
Kirigami.FormData.label: i18n("Arrival time:")
// seat reservation
Kirigami.Separator {
Kirigami.FormData.label: i18n("Seat")
Kirigami.FormData.isSection: true
visible: reservation.reservedTicket.ticketedSeat.seatNumber != "" || reservation.reservedTicket.ticketedSeat.seatSection != ""
}
QQC2.Label {
text: Localizer.formatDateTime(reservationFor, "arrivalTime")
Kirigami.FormData.label: i18n("Coach:")
text: reservation.reservedTicket.ticketedSeat.seatSection
visible: reservation.reservedTicket.ticketedSeat.seatSection != ""
}
QQC2.Label {
text: (arrival.arrivalDelay >= 0 ? "+" : "") + arrival.arrivalDelay
color: (arrival.arrivalDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor
visible: arrival.hasExpectedArrivalTime
Kirigami.FormData.label: i18n("Seat:")
text: reservation.reservedTicket.ticketedSeat.seatNumber
visible: reservation.reservedTicket.ticketedSeat.seatNumber != ""
}
// booking details
Kirigami.Separator {
Kirigami.FormData.label: i18n("Booking")
Kirigami.FormData.isSection: true
}
}
QQC2.Label {
Kirigami.FormData.label: i18n("Station:")
text: reservationFor.arrivalStation.name
}
App.PlaceDelegate {
place: reservationFor.arrivalStation
}
RowLayout {
Kirigami.FormData.label: i18n("Platform:")
QQC2.Label {
text: arrival.hasExpectedPlatform ? arrival.expectedPlatform : reservationFor.arrivalPlatform
color: arrival.platformChanged ? Kirigami.Theme.negativeTextColor :
arrival.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor :
Kirigami.Theme.textColor;
Kirigami.FormData.label: i18n("Reference:")
text: reservation.reservationNumber
}
QQC2.Label {
text: i18n("(was: %1)", reservationFor.arrivalPlatform)
visible: arrival.platformChanged && reservationFor.arrivalPlatform != ""
Kirigami.FormData.label: i18n("Under name:")
text: reservation.underName.name
}
}
// seat reservation
Kirigami.Separator {
Kirigami.FormData.label: i18n("Seat")
Kirigami.FormData.isSection: true
visible: reservation.reservedTicket.ticketedSeat.seatNumber != "" || reservation.reservedTicket.ticketedSeat.seatSection != ""
}
QQC2.Label {
Kirigami.FormData.label: i18n("Coach:")
text: reservation.reservedTicket.ticketedSeat.seatSection
visible: reservation.reservedTicket.ticketedSeat.seatSection != ""
}
QQC2.Label {
Kirigami.FormData.label: i18n("Seat:")
text: reservation.reservedTicket.ticketedSeat.seatNumber
visible: reservation.reservedTicket.ticketedSeat.seatNumber != ""
}
// booking details
Kirigami.Separator {
Kirigami.FormData.label: i18n("Booking")
Kirigami.FormData.isSection: true
}
QQC2.Label {
Kirigami.FormData.label: i18n("Reference:")
text: reservation.reservationNumber
}
QQC2.Label {
Kirigami.FormData.label: i18n("Under name:")
text: reservation.underName.name
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment