Warning, /utilities/kongress/src/contents/ui/Conferences.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2020 Dimitris Kardarakos <dimkard@posteo.net>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 import QtQuick 2.7
0008 import QtQuick.Controls 2.4 as Controls
0009 import org.kde.kirigami 2.12 as Kirigami
0010 import org.kde.kongress 0.1 as Kongress
0011 
0012 Kirigami.ScrollablePage {
0013     id: root
0014 
0015     title: i18n("Conferences")
0016 
0017     signal selected(var selectedConferenceId)
0018 
0019     Kirigami.PlaceholderMessage {
0020         anchors.centerIn: parent
0021 
0022         visible: !conferenceModel.busyDownlading && view.count === 0
0023         width: parent.width - (Kirigami.Units.largeSpacing * 4)
0024         text: i18n("No conference found")
0025 
0026         helpfulAction: Kirigami.Action {
0027             text: i18n("Reload")
0028             onTriggered: Kongress.ConferenceController.loadConferences()
0029         }
0030     }
0031 
0032     Controls.BusyIndicator {
0033         anchors.centerIn: parent
0034 
0035         running: conferenceModel && conferenceModel.busyDownlading
0036         implicitWidth: Kirigami.Units.iconSizes.enormous
0037         implicitHeight: width
0038 
0039     }
0040 
0041 
0042     Kirigami.CardsListView {
0043         id: view
0044 
0045         enabled: conferenceModel && !conferenceModel.busyDownlading && count > 0
0046         model: conferenceModel
0047 
0048         section {
0049             property: "pastUpcoming"
0050             criteria: ViewSection.FullString
0051             delegate: Kirigami.ListSectionHeader {
0052                 width: ListView.view.width
0053                 label: section
0054             }
0055         }
0056 
0057         delegate: Kirigami.AbstractCard {
0058             id: card
0059 
0060             showClickFeedback: true
0061 
0062             header: Kirigami.Heading {
0063                 text: model && model.name
0064                 wrapMode: Text.WordWrap
0065             }
0066 
0067             contentItem: Controls.Label {
0068                 wrapMode: Text.WordWrap
0069                 text: model && model.description
0070             }
0071 
0072             onClicked: selected(model.id)
0073         }
0074     }
0075 
0076     Kongress.ConferenceModel {
0077         id: conferenceModel
0078 
0079         controller: Kongress.ConferenceController
0080     }
0081 }