44-->
55<template >
66 <div class =" settings-addressbook-list" >
7- <IconContactPlus class =" settings-line__icon" />
8- <li :class =" { 'addressbook--disabled': !addressbook.enabled }" class =" addressbook" >
9- <div class =" addressbook__content" >
10- <!-- addressbook name -->
11- <span class =" addressbook__name" :title =" addressbook.displayName" >
12- {{ addressbook.enabled ? addressbook.displayName : t('contacts', '{addressbookname} (Hidden)', { addressbookname: addressbook.displayName }) }}
7+ <NcListItem
8+ :class =" { 'addressbook--disabled': !addressbook.enabled }"
9+ :force-display-actions =" true"
10+ :name =" addressbook.enabled ? addressbook.displayName : t('contacts', '{addressbookname} (Hidden)', { addressbookname: addressbook.displayName })" >
11+ <template #icon >
12+ <IconContactPlus class =" settings-line__icon" />
13+ </template >
14+
15+ <template #subname >
16+ <span v-if =" addressbook.dav.description" >{{ addressbook.dav.description }}, </span >
17+ <span v-if =" addressbook.enabled" class =" addressbook__count-wrapper" >
18+ <span class =" addressbook__count" >{{ n('contacts', '%n contact', '%n contacts', contactsCount) }}</span >
19+ <span class =" addressbook__count" > - {{ n('contacts', '%n group', '%n groups', groupsCount) }}</span >
1320 </span >
21+ </template >
1422
15- <div v-if =" addressbook.dav.description" class =" addressbook__description" >
16- {{ addressbook.dav.description }}
17- </div >
18- <!-- counters -->
19- <div v-if =" addressbook.enabled" class =" addressbook__count-wrapper" >
20- <span class =" addressbook__count" >{{ n('contacts', '%n contact', '%n contacts', contactsCount) }}</span >
21- <span class =" addressbook__count" >- {{ n('contacts', '%n group', '%n groups', groupsCount) }}</span >
22- </div >
23- </div >
24-
25- <!-- sharing Ncbutton -->
26- <NcButton
27- v-if =" !addressbook.readOnly && !isSharedWithMe"
28- v-tooltip.top =" sharedWithTooltip"
29- :class =" { 'addressbook__share--shared': hasShares }"
30- :name =" sharedWithTooltip"
31- href =" #"
32- class =" addressbook__share"
33- @click =" toggleShare" >
34- <template #icon >
35- <IconShare :size =" 20" />
36- </template >
37- </NcButton >
23+ <template #extra-actions >
24+ <!-- sharing Ncbutton -->
25+ <ActionButton
26+ v-if =" !addressbook.readOnly && !isSharedWithMe"
27+ :title =" sharedWithTooltip"
28+ :class =" { 'addressbook__share--shared': hasShares }"
29+ variant =" tertiary"
30+ href =" #"
31+ class =" addressbook__share"
32+ @click =" toggleShare" >
33+ <template #icon >
34+ <IconShare :size =" 20" />
35+ </template >
36+ </ActionButton >
37+ </template >
3838
39- <!-- popovermenu -->
40- <Actions class =" addressbook__menu" menu-align =" right" >
39+ <template #actions >
4140 <!-- copy addressbook link -->
4241 <ActionLink
4342 :href =" addressbook.url"
111110 </template >
112111 {{ t('contacts', 'Delete') }}
113112 </ActionButton >
114- </Actions >
115- <!-- sharing input -->
116- <ShareAddressBook v-if =" shareOpen && !addressbook.readOnly" :addressbook =" addressbook" />
117- </li >
113+ </template >
114+ </NcListItem >
115+ <ShareAddressBook v-if =" shareOpen && !addressbook.readOnly" :addressbook =" addressbook" />
118116 </div >
119117</template >
120118
@@ -125,9 +123,8 @@ import {
125123 NcActionCheckbox as ActionCheckbox ,
126124 NcActionInput as ActionInput ,
127125 NcActionLink as ActionLink ,
128- NcActions as Actions ,
129126 NcLoadingIcon as IconLoading ,
130- NcButton ,
127+ NcListItem ,
131128} from ' @nextcloud/vue'
132129import IconContactPlus from ' vue-material-design-icons/AccountMultiplePlusOutline.vue'
133130import IconRename from ' vue-material-design-icons/PencilOutline.vue'
@@ -146,15 +143,14 @@ export default {
146143 ActionCheckbox,
147144 ActionInput,
148145 ActionLink,
149- Actions,
150- NcButton,
151146 IconDelete,
152147 IconDownload,
153148 IconRename,
154149 IconContactPlus,
155150 IconShare,
156151 IconLoading,
157152 ShareAddressBook,
153+ NcListItem,
158154 },
159155
160156 mixins: [CopyToClipboardMixin],
@@ -358,88 +354,8 @@ export default {
358354 </script >
359355
360356<style lang="scss" scoped>
361- .addressbook {
362- display : flex ;
363- flex-wrap : wrap ;
364- align-items : center ;
365- white-space : nowrap ;
366- text-overflow : ellipsis ;
367- padding : var (--default-grid-baseline ) 0 ;
368-
369- > .addressbook__content {
370- + a ,
371- + div {
372- // put actions at the end
373- margin-inline-start : auto ;
374- }
375- }
376-
377- & __name {
378- display : block ;
379- flex : 0 1 auto ;
380- white-space : nowrap ;
381- overflow : hidden ;
382- text-overflow : ellipsis ;
383- }
384-
385- & __content {
386- display : flex ;
387- flex-wrap : wrap ;
388- flex-direction : column ;
389- flex : 0 1 auto ;
390- max-width : calc (100% - 2 * 44px );
391- }
392-
393- & __description {
394- color : var (--color-text-lighter );
395- }
396-
397- & __count-wrapper {
398- display : flex ;
399- }
400-
401- & __count {
402- margin-inline-start : calc (var (--default-grid-baseline ) * 0.5 );
403- font-size : smaller ;
404- color : var (--color-text-lighter );
405- }
406-
407- & __count :not (:last-child ) {
408- margin-inline-end : var (--default-grid-baseline );
409- }
410-
411- & __share ,
412- & __menu .icon-more {
413- opacity : .5 ;
414- & :hover ,
415- & :focus ,
416- & :active {
417- opacity : .7 ;
418- }
419- }
420- & __share {
421- background-color : transparent ;
422- border : none ;
423- box-shadow : none ;
424-
425- & --shared {
426- opacity : .7 ;
427- }
428- }
429- & --disabled & __name {
430- opacity : .5 ;
431- }
432- }
433-
434357.settings-addressbook-list {
435358 display : flex ;
436- width : 100% ;
437- .material-design-icon {
438- justify-content : flex-start ;
439- }
440- }
441-
442- .addressbook-shares {
443- padding-top : calc (var (--default-grid-baseline ) * 2 );
359+ flex-direction : column ;
444360}
445361 </style >
0 commit comments