Warning, /pim/itinerary/src/app/HotelDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import QtQuick.Controls as QQC2
0010 import org.kde.kirigami as Kirigami
0011 import org.kde.itinerary
0012 
0013 TimelineDelegate {
0014     id: root
0015 
0016     headerIconSource: "go-home-symbolic"
0017     headerItem: QQC2.Label {
0018         id: headerLabel
0019         text: root.rangeType == TimelineElement.RangeEnd ?
0020             i18n("Check-out %1", reservationFor.name) : reservationFor.name
0021         color: root.headerTextColor
0022         elide: Text.ElideRight
0023         Layout.fillWidth: true
0024         Accessible.ignored: true
0025     }
0026 
0027     contentItem: Column {
0028         id: topLayout
0029         spacing: Kirigami.Units.smallSpacing
0030 
0031         QQC2.Label {
0032             visible: text !== ""
0033             width: topLayout.width
0034             text: Localizer.formatAddressWithContext(reservationFor.address, null, Settings.homeCountryIsoCode)
0035             wrapMode: Text.WordWrap
0036         }
0037         QQC2.Label {
0038             text: i18n("Check-in time: %1", Localizer.formatTime(reservation, "checkinTime"))
0039             color: Kirigami.Theme.textColor
0040             visible: root.rangeType == TimelineElement.RangeBegin && !Util.isStartOfDay(reservation, "checkinTime")
0041         }
0042         QQC2.Label {
0043             text: root.rangeType == TimelineElement.RangeBegin ?
0044                 i18n("Check-out time: %1", !Util.isStartOfDay(reservation, "checkoutTime") ? Localizer.formatDateTime(reservation, "checkoutTime") : Localizer.formatDate(reservation, "checkoutTime")) :
0045                 i18n("Check-out time: %1", Localizer.formatTime(reservation, "checkoutTime"))
0046             color: Kirigami.Theme.textColor
0047             visible: root.rangeType == TimelineElement.RangeBegin || !Util.isStartOfDay(reservation, "checkoutTime")
0048         }
0049 
0050     }
0051 
0052     onClicked: showDetailsPage(hotelDetailsPage, root.batchId)
0053     Accessible.name: headerLabel.text
0054 }