1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
<template>
<div class="org-chart-node">
<div class="inner-box">
<router-link :to="{
name: 'contact',
params: {
selectedGroup: selectedChart,
selectedContact: data.key,
},
}">
<Avatar
:disable-tooltip="true"
:display-name="data.fullName"
:is-no-user="true"
:size="60"
:url="data.photoUrl"
class="org-chart-node__avatar" />
</router-link>
<div class="panel" />
<div class="main-container">
<h3 class="fullName">
{{ data.fullName }}
</h3>
<h4 class="title">
{{ data.title }}
</h4>
</div>
<div class="description">
<p v-if="data._directSubordinates">
{{ t('contacts', 'Manages') }}: {{ data._directSubordinates }}
</p>
<p v-if="data._totalSubordinates">
{{ t('contacts', 'Oversees') }}: {{ data._totalSubordinates }}
</p>
</div>
</div>
</div>
</template>
<script>
import Avatar from '@nextcloud/vue/dist/Components/NcAvatar'
export default {
name: 'ChartTemplate',
components: {
Avatar,
},
props: {
data: {
type: Object,
default: () => {},
},
onAvatarClick: {
type: Function,
default: () => {},
},
},
computed: {
selectedChart() {
return this.$route.params.selectedChart
},
},
}
</script>
<style lang="scss" scoped>
.org-chart-node {
background-color: var(--color-main-background);
height: 175px;
border-radius: var(--border-radius-large);
overflow: visible;
&__avatar {
margin-top: -30px;
border: 1px solid var(--color-border);
}
.inner-box {
display: flex;
flex-direction: column;
align-items: center;
height: 175px;
padding-top: 0;
margin-top: 30px;
border: 1px solid var(--color-border);
border-radius: var(--border-radius-large);
background-color: var(--color-main-background);
.main-container {
padding: 20px;
text-align: center;
flex: 1;
.fullName {
color: var(--color-primary-element);
font-weight: bold;
}
.title {
margin-top: 4px;
}
}
.description {
display: flex;
justify-content: space-between;
width: 100%;
padding: 15px;
}
}
.inner-box-highlight {
border: 2px solid var(--color-primary) !important;
}
.panel {
width: 100%;
margin: -34px -1px 0 -1px;
background-color: var(--color-primary);
height: 15px;
border-top-left-radius: var(--border-radius-large);
border-top-right-radius: var(--border-radius-large);
}
}
</style>
|