Warning, /pim/kube/views/people/qml/PersonPage.qml is written in an unsupported language. File is not indexed.

0001  /*
0002   Copyright (C) 2017 Michael Bohlender, <bohlender@kolabsys.com>
0003   Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
0004 
0005   This program is free software; you can redistribute it and/or modify
0006   it under the terms of the GNU General Public License as published by
0007   the Free Software Foundation; either version 2 of the License, or
0008   (at your option) any later version.
0009 
0010   This program is distributed in the hope that it will be useful,
0011   but WITHOUT ANY WARRANTY; without even the implied warranty of
0012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0013   GNU General Public License for more details.
0014 
0015   You should have received a copy of the GNU General Public License along
0016   with this program; if not, write to the Free Software Foundation, Inc.,
0017   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018 */
0019 
0020 import QtQuick 2.7
0021 import QtQuick.Controls 2.0
0022 import QtQuick.Layouts 1.1
0023 
0024 import org.kube.framework 1.0 as Kube
0025 
0026 
0027 Flickable {
0028     id: personPageFlickable
0029 
0030     anchors {
0031         fill: parent
0032         leftMargin: Kube.Units.largeSpacing
0033     }
0034 
0035     ScrollBar.vertical: Kube.ScrollBar { }
0036     contentHeight: contentColumn.height
0037 
0038     clip: true
0039 
0040     Kube.ScrollHelper {
0041         flickable: personPageFlickable
0042         anchors.fill: parent
0043     }
0044 
0045 
0046     ColumnLayout {
0047         id: contentColumn
0048 
0049         anchors {
0050             left: parent.left
0051             right: parent.right
0052         }
0053 
0054         spacing: Kube.Units.largeSpacing
0055 
0056         Item {
0057             width: parent.width
0058             height: Kube.Units.smallSpacing
0059         }
0060 
0061 
0062         Item {
0063 
0064             height: Kube.Units.gridUnit * 8
0065             width: personPageRoot.width - Kube.Units.largeSpacing
0066 
0067             Rectangle {
0068                 id: avatar
0069 
0070                 height: parent.height
0071                 width: height
0072                 Kube.KubeImage {
0073                     anchors.fill: parent
0074                     visible: contactController.imageData != ""
0075                     imageData: contactController.imageData
0076                 }
0077                 Kube.Icon {
0078                     anchors.fill: parent
0079                     visible: contactController.imageData == ""
0080                     iconName: Kube.Icons.user
0081                 }
0082                 color: Kube.Colors.buttonColor
0083             }
0084 
0085             Kube.Heading {
0086                 id: nameLabel
0087 
0088                 anchors {
0089                     top: avatar.top
0090                     left: avatar.right
0091                     leftMargin: Kube.Units.largeSpacing
0092                 }
0093 
0094                 text: contactController.name
0095             }
0096 
0097             Kube.Label {
0098                 id: jobTitle
0099 
0100                 anchors {
0101                     top: nameLabel.bottom
0102                     left: avatar.right
0103                     leftMargin: Kube.Units.largeSpacing
0104                 }
0105 
0106                 text: contactController.jobTitle
0107             }
0108 
0109             Rectangle {
0110                 id: company
0111                 visible: contactController.company != ""
0112 
0113                 anchors {
0114                     bottom: avatar.bottom
0115                     left: avatar.right
0116                     leftMargin: Kube.Units.largeSpacing
0117                 }
0118 
0119                 height: Kube.Units.gridUnit * 3
0120                 width: Kube.Units.gridUnit * 10
0121 
0122                 border.width: 1
0123                 border.color: Kube.Colors.buttonColor
0124 
0125                 Rectangle {
0126                     id: av
0127 
0128                     height: parent.height
0129                     width: height
0130 
0131                     color: Kube.Colors.buttonColor
0132                 }
0133 
0134                 Kube.Label {
0135                     anchors {
0136                         verticalCenter: av.verticalCenter
0137                         left: av.right
0138                         leftMargin: Kube.Units.smallSpacing
0139                     }
0140 
0141                     text: contactController.company
0142                 }
0143             }
0144         }
0145 
0146         Flow {
0147             id: emails
0148 
0149             width: personPageRoot.width - Kube.Units.largeSpacing
0150 
0151             Repeater {
0152                 model: contactController.mails.model
0153 
0154                 delegate: Row {
0155                     spacing: Kube.Units.smallSpacing
0156                     Kube.Label { text: qsTr("(main)"); visible: model.isMain }
0157                     Kube.Label { text: model.email ; color: Kube.Colors.highlightColor }
0158                     Item { width: Kube.Units.smallSpacing; height: 1 }
0159                 }
0160             }
0161         }
0162 
0163         // Flow {
0164         //     id: phone
0165 
0166         //     width: personPageRoot.width - Kube.Units.largeSpacing
0167         //     spacing: Kube.Units.smallSpacing
0168 
0169         //     Repeater {
0170         //         model: contactController.phones.model
0171         //         Row {
0172         //             spacing: Kube.Units.smallSpacing
0173         //             Kube.Label { text: qsTr("(main)") }
0174         //             Kube.Label { text: model.number ; opacity: 0.6 }
0175         //             Item { width: Kube.Units.smallSpacing; height: 1 }
0176         //         }
0177         //     }
0178         // }
0179 
0180         // Column {
0181         //     id: address
0182 
0183         //     width: personPageRoot.width - Kube.Units.largeSpacing
0184 
0185         //     Kube.Label { text: contactController.street }
0186         //     Kube.Label { text: contactController.city }
0187         //     Kube.Label { text: contactController.country }
0188         // }
0189         Item {
0190             width: parent.width
0191             height: Kube.Units.largeSpacing
0192         }
0193     }
0194 }
0195 
0196 //                     Column {
0197 //
0198 //                         width: parent.width
0199 //
0200 //                         spacing: Kube.Units.smallSpacing
0201 //
0202 //                         Text {
0203 //
0204 //                             text: root.firstname +  " is part of these groups:"
0205 //                         }
0206 //
0207 //                         GroupGrid {
0208 //                             id: groups
0209 //
0210 //                             width: root.width - Kube.Units.largeSpacing
0211 //
0212 //                             model: GroupModel1 {}
0213 //                         }
0214 //                     }
0215 
0216 //                     Column {
0217 //
0218 //                         width: parent.width
0219 //
0220 //                         spacing: Kube.Units.smallSpacing
0221 //
0222 //                         Text {
0223 //                             id: commonPeopleLabel
0224 //
0225 //                             text: root.firstname +  " is associated with:"
0226 //                         }
0227 //
0228 //                         PeopleGrid {
0229 //                             id: commonPeople
0230 //
0231 //                             width: root.width - Kube.Units.largeSpacing
0232 //
0233 //                             model: PeopleModel2 {}
0234 //                         }
0235 //                     }
0236 
0237