Warning, /graphics/arianna/src/content/ui/BookDetailsPage.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: Carl Schwan <carl@carlschwan.eu>
0002 // SPDX-License-Identifier: LGPL-2.1-only or LGPL-3.0-only or LicenseRef-KDE-Accepted-LGPL
0003 
0004 import QtQuick 2.15
0005 import QtQuick.Controls 2.15 as QQC2
0006 import QtQuick.Layouts 1.15
0007 import org.kde.kirigami 2.13 as Kirigami
0008 import org.kde.kirigamiaddons.formcard 1.0 as FormCard
0009 import org.kde.arianna 1.0
0010 
0011 FormCard.FormCardPage {
0012     id: root
0013 
0014     property var metadata
0015 
0016     title: i18nc("@info:title", "Book Details")
0017 
0018     FormCard.FormHeader {
0019         title: root.metadata.title
0020     }
0021 
0022     FormCard.FormCard {
0023         FormCard.FormTextDelegate {
0024             text: i18n("Author:")
0025             description: root.metadata.creator
0026             visible: description.length > 0
0027         }
0028 
0029         FormCard.FormDelegateSeparator {}
0030 
0031         FormCard.FormTextDelegate {
0032             text: i18n("Description:")
0033             description: root.metadata.description
0034             visible: description.length > 0
0035         }
0036 
0037         FormCard.FormDelegateSeparator {}
0038 
0039         FormCard.FormTextDelegate {
0040             text: i18n("Publisher:")
0041             description: root.metadata.publisher
0042             visible: description.length > 0
0043         }
0044 
0045         FormCard.FormDelegateSeparator {}
0046 
0047         FormCard.FormTextDelegate {
0048             text: i18n("Language:")
0049             description: Qt.locale(root.metadata.language).nativeLanguageName
0050             visible: description.length > 0
0051         }
0052 
0053         FormCard.FormDelegateSeparator {}
0054 
0055         FormCard.FormTextDelegate {
0056             text: i18n("Publishing date:")
0057             description: /^\d+$/.test(root.metadata.pubdate) ? root.metadata.pubdate : new Date(root.metadata.pubdate).toLocaleDateString()
0058             visible: description.length > 0
0059         }
0060 
0061         FormCard.FormDelegateSeparator {}
0062 
0063         FormCard.FormTextDelegate {
0064             text: i18n("Copyright:")
0065             description: root.metadata.rights
0066             visible: description.length > 0
0067         }
0068     }
0069 }