diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 18ae0309f79dabc92662497a0c29b81ce39d164b..25295d5b9faeecd659119573fcfe33785ff0ea7d 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -65,6 +65,7 @@ qml_lint( PkPassPage.qml PlaceDelegate.qml RestaurantDelegate.qml + RestaurantPage.qml TicketTokenDelegate.qml TimelineDelegate.qml TimelinePage.qml diff --git a/src/app/RestaurantDelegate.qml b/src/app/RestaurantDelegate.qml index ab9dee43cfd5ea02c77fd10796aeed6323db02ac..fd3e7e58294a403f5183a9693ae5eef1d3efbfab 100644 --- a/src/app/RestaurantDelegate.qml +++ b/src/app/RestaurantDelegate.qml @@ -61,16 +61,14 @@ App.TimelineDelegate { place: reservation.reservationFor Layout.fillWidth: true } - QQC2.Label { - text: qsTr("Person: %1") - .arg(reservation.partySize) - color: Kirigami.Theme.textColor - } - QQC2.Label { - text: qsTr("End: %1") - .arg(Localizer.formatTime(reservation, "endTime")) - color: Kirigami.Theme.textColor + } + + Component { + id: detailsComponent + App.RestaurantPage { + reservation: root.reservation } } -} + onClicked: applicationWindow().pageStack.push(detailsComponent); +} diff --git a/src/app/RestaurantPage.qml b/src/app/RestaurantPage.qml new file mode 100644 index 0000000000000000000000000000000000000000..5e324a937c5eb6086c02e6e91e413d01b412d9e6 --- /dev/null +++ b/src/app/RestaurantPage.qml @@ -0,0 +1,95 @@ +/* + Copyright (C) 2018 Volker Krause + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +import QtQuick 2.5 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.1 as QQC2 +import org.kde.kirigami 2.0 as Kirigami +import org.kde.kitinerary 1.0 +import org.kde.itinerary 1.0 +import "." as App + +App.DetailsPage { + id: root + title: qsTr("Restaurant Reservation") + + GridLayout { + id: grid + width: root.width + columns: 2 + + QQC2.Label { + Layout.columnSpan: 2 + Layout.fillWidth: true + text: reservation.reservationFor.name + horizontalAlignment: Qt.AlignHCenter + font.bold: true + } + + App.PlaceDelegate { + Layout.columnSpan: 2 + Layout.fillWidth: true + place: reservation.reservationFor + } + + // TODO make these interactive + QQC2.Label { + text: qsTr("Telephone:") + } + QQC2.Label { + text: reservation.reservationFor.telephone + } + QQC2.Label { + text: qsTr("Email:") + } + QQC2.Label { + text: reservation.reservationFor.email + } + + QQC2.Label { + text: qsTr("Start time:") + } + QQC2.Label { + text: Localizer.formatDateTime(reservation, "startTime") + } + QQC2.Label { + text: qsTr("End time:") + } + QQC2.Label { + text: Localizer.formatDateTime(reservation, "endTime") + } + QQC2.Label { + text: qsTr("Party size:") + } + QQC2.Label { + text: reservation.partySize + } + + QQC2.Label { + text: qsTr("Booking reference:") + } + QQC2.Label { + text: reservation.reservationNumber + } + QQC2.Label { + text: qsTr("Under name:") + } + QQC2.Label { + text: reservation.underName.name + } + } +} diff --git a/src/app/qml.qrc b/src/app/qml.qrc index 671bec1526dba057f9de98e3a4a9b4cff07b63a3..e387d243fabb85cd1cd41e91a9609e4baeb92bea 100644 --- a/src/app/qml.qrc +++ b/src/app/qml.qrc @@ -12,6 +12,7 @@ PkPassPage.qml PlaceDelegate.qml RestaurantDelegate.qml + RestaurantPage.qml TicketTokenDelegate.qml TimelineDelegate.qml TimelinePage.qml