Commit 7cb85638 authored by Volker Krause's avatar Volker Krause
Browse files

Show program membership information

Particularly useful for things like DB BahnCard, which is relevant for the
ticket validity.
parent a158782b
......@@ -16,14 +16,16 @@ Kirigami.ScrollablePage {
id: root
/** The reservation batch identifier (@see ReservationManager). */
property alias batchId: _controller.batchId
/** Currently selected reservation of the batch. */
/** Currently selected reservation id of the batch. */
property var currentReservationId: batchId
/** Currently selected reservation of the batch. */
readonly property var currentReservation: ReservationManager.reservation(currentReservationId);
/** @deprecated */
readonly property var reservation: ReservationManager.reservation(currentReservationId);
/** Reservation::reservationFor, unique for all travelers on a multi-traveler reservation set */
readonly property var reservationFor: reservation.reservationFor
property var editor
readonly property string passId: PkPassManager.passId(reservation)
readonly property string passId: PkPassManager.passId(currentReservation)
property QtObject controller: TimelineDelegateController {
id: _controller
......@@ -75,7 +77,7 @@ Kirigami.ScrollablePage {
// TODO this needs multi-traveler support!
Instantiator {
model: reservation.potentialAction
model: currentReservation.potentialAction
delegate: Component {
Kirigami.Action {
text: {
......@@ -108,7 +110,7 @@ Kirigami.ScrollablePage {
},
Kirigami.Action {
iconName: "folder-documents-symbolic"
text: i18n("Documents (%1)", root.reservation.subjectOf.length)
text: i18n("Documents (%1)", root.currentReservation.subjectOf.length)
onTriggered: applicationWindow().pageStack.push(docsComponent, {"controller": root.controller });
},
Kirigami.Action {
......
......@@ -162,6 +162,25 @@ App.DetailsPage {
text: index % 2 == 0 ? res.underName.name : res.reservationNumber
}
}
// frequent traveler program
Kirigami.Separator {
Kirigami.FormData.isSection: true
Kirigami.FormData.label: i18n("Frequent Traveler Program")
visible: programName.visible || membershipNumber.visible
}
QQC2.Label {
id: programName
Kirigami.FormData.label: i18nc("name of a frequent flyer program", "Program:")
text: root.currentReservation.programMembershipUsed.programName
visible: text
}
QQC2.Label {
id: membershipNumber
Kirigami.FormData.label: i18n("Number:")
text: root.currentReservation.programMembershipUsed.membershipNumber
visible: text
}
}
}
}
......@@ -226,24 +226,44 @@ App.DetailsPage {
Kirigami.Separator {
Kirigami.FormData.label: i18n("Seat")
Kirigami.FormData.isSection: true
visible: reservation.reservedTicket.ticketedSeat.seatNumber != ""
|| reservation.reservedTicket.ticketedSeat.seatSection != ""
|| reservation.reservedTicket.ticketedSeat.seatingType != ""
visible: coachLabel.visible || seatLabel.visible || classLabel.visible
}
QQC2.Label {
id: coachLabel
Kirigami.FormData.label: i18nc("coach of a train", "Coach:")
text: reservation.reservedTicket.ticketedSeat.seatSection
visible: reservation.reservedTicket.ticketedSeat.seatSection != ""
text: currentReservation.reservedTicket.ticketedSeat.seatSection
visible: text
}
QQC2.Label {
id: seatLabel
Kirigami.FormData.label: i18n("Seat:")
text: reservation.reservedTicket.ticketedSeat.seatNumber
visible: reservation.reservedTicket.ticketedSeat.seatNumber != ""
text: currentReservation.reservedTicket.ticketedSeat.seatNumber
visible: text
}
QQC2.Label {
id: classLabel
Kirigami.FormData.label: i18n("Class:")
text: reservation.reservedTicket.ticketedSeat.seatingType
visible: reservation.reservedTicket.ticketedSeat.seatingType != ""
text: currentReservation.reservedTicket.ticketedSeat.seatingType
visible: text
}
// program membership
Kirigami.Separator {
Kirigami.FormData.label: i18nc("bonus, discount or frequent traveler program", "Program")
Kirigami.FormData.isSection: true
visible: programNameLabel.visible || membershipNumberLabel.visible
}
QQC2.Label {
id: programNameLabel
Kirigami.FormData.label: i18n("Name:")
text: root.currentReservation.programMembershipUsed.programName
visible: text
}
QQC2.Label {
id: membershipNumberLabel
Kirigami.FormData.label: i18n("Number:")
text: root.currentReservation.programMembershipUsed.membershipNumber
visible: text
}
// booking details
......
Supports Markdown
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