|
| 1 | +<!-- |
| 2 | + - SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
| 3 | + - SPDX-License-Identifier: AGPL-3.0-or-later |
| 4 | +--> |
| 5 | + |
| 6 | +<template> |
| 7 | + <div class="usergroup-details-container"> |
| 8 | + <div class="usergroup-details-grid"> |
| 9 | + <div class="usergroup-details__header-wrapper"> |
| 10 | + <div class="usergroup-details-grid__avatar"> |
| 11 | + <NcAvatar :disable-tooltip="true" |
| 12 | + :display-name="userGroup.displayName" |
| 13 | + :is-no-user="true" |
| 14 | + :size="75" /> |
| 15 | + </div> |
| 16 | + <div class="usergroup-details__header"> |
| 17 | + <div class="usergroup-name-wrapper"> |
| 18 | + <h2 class="usergroup-name"> |
| 19 | + <span :title="userGroup.displayName">{{ userGroup.displayName }}</span> |
| 20 | + </h2> |
| 21 | + <div class="usergroup-details__subtitle"> |
| 22 | + {{ t('contacts', 'This is a read-only group managed by administrators. Group members can only view this group.') }} |
| 23 | + </div> |
| 24 | + </div> |
| 25 | + <div class="actions"> |
| 26 | + <NcButton variant="secondary" @click.stop.prevent="copyToClipboard(userGroupUrl)"> |
| 27 | + <template #icon> |
| 28 | + <CopyIcon :size="20" /> |
| 29 | + </template> |
| 30 | + {{ t('contacts', 'Copy link') }} |
| 31 | + </NcButton> |
| 32 | + </div> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + <div class="usergroup-details__main-content"> |
| 36 | + <h3 class="usergroup-details__content-heading"> |
| 37 | + {{ t('contacts', 'Members') }} |
| 38 | + </h3> |
| 39 | + <div class="usergroup-details__member-grid"> |
| 40 | + <UserGroupMember v-for="member in userGroup.members" |
| 41 | + :key="`user-group-member-${member}`" |
| 42 | + :member="member" /> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | +</template> |
| 48 | + |
| 49 | +<script> |
| 50 | +import { NcAvatar, NcButton } from '@nextcloud/vue' |
| 51 | +import CopyIcon from 'vue-material-design-icons/ContentCopy.vue' |
| 52 | +
|
| 53 | +import CopyToClipboardMixin from '../mixins/CopyToClipboardMixin.js' |
| 54 | +import UserGroup from '../models/userGroup.ts' |
| 55 | +import UserGroupMember from './UserGroupDetails/UserGroupMember.vue' |
| 56 | +
|
| 57 | +export default { |
| 58 | + name: 'UserGroupDetails', |
| 59 | +
|
| 60 | + components: { |
| 61 | + CopyIcon, |
| 62 | + NcAvatar, |
| 63 | + NcButton, |
| 64 | + UserGroupMember, |
| 65 | + }, |
| 66 | +
|
| 67 | + mixins: [CopyToClipboardMixin], |
| 68 | +
|
| 69 | + props: { |
| 70 | + userGroup: { |
| 71 | + type: UserGroup, |
| 72 | + required: true, |
| 73 | + }, |
| 74 | + }, |
| 75 | +
|
| 76 | + computed: { |
| 77 | + userGroupUrl() { |
| 78 | + return window.location.href |
| 79 | + }, |
| 80 | + }, |
| 81 | +} |
| 82 | +</script> |
| 83 | + |
| 84 | +<style lang="scss" scoped> |
| 85 | +.usergroup-details { |
| 86 | + &-container { |
| 87 | + padding-inline: 20px; |
| 88 | + margin-top: 1rem; |
| 89 | + } |
| 90 | +
|
| 91 | + &-grid { |
| 92 | + display: grid; |
| 93 | + grid-template-columns: 1fr; |
| 94 | + gap: 36px; |
| 95 | + max-width: 800px; |
| 96 | + margin-inline: auto; |
| 97 | +
|
| 98 | + .usergroup-name-wrapper { |
| 99 | + width: 100%; |
| 100 | + } |
| 101 | + } |
| 102 | +
|
| 103 | + &__header-wrapper { |
| 104 | + display: grid; |
| 105 | + grid-template-columns: auto 1fr; |
| 106 | + align-items: center; |
| 107 | + gap: 24px; |
| 108 | + } |
| 109 | +
|
| 110 | + &__header { |
| 111 | + background-color: transparent; |
| 112 | + display: flex; |
| 113 | + flex-direction: column; |
| 114 | + align-items: flex-start; |
| 115 | + gap: 2px; |
| 116 | + width: 100%; |
| 117 | +
|
| 118 | + .usergroup-name { |
| 119 | + font-size: 1.5rem; |
| 120 | + font-weight: bold; |
| 121 | + margin: 0px; |
| 122 | + margin-bottom: 2px; |
| 123 | + } |
| 124 | + } |
| 125 | +
|
| 126 | + &__subtitle { |
| 127 | + color: var(--color-text-maxcontrast); |
| 128 | + margin-bottom: 8px; |
| 129 | + } |
| 130 | +
|
| 131 | + &__main-content { |
| 132 | + margin-inline-start: 99px; |
| 133 | +
|
| 134 | + @media (max-width: 768px) { |
| 135 | + margin-inline-start: 0px; |
| 136 | + } |
| 137 | + } |
| 138 | +
|
| 139 | + &__content-heading { |
| 140 | + font-weight: bold; |
| 141 | + font-size: 1.2rem; |
| 142 | + line-height: 0px; |
| 143 | + margin-top: 4px; |
| 144 | + margin-bottom: 8px; |
| 145 | + } |
| 146 | +
|
| 147 | + &__member-grid { |
| 148 | + display: grid; |
| 149 | + grid-template-columns: repeat(2, 1fr); |
| 150 | + gap: 8px; |
| 151 | + max-width: 500px; |
| 152 | +
|
| 153 | + @media (max-width: 768px) { |
| 154 | + grid-template-columns: 1fr; |
| 155 | + } |
| 156 | +
|
| 157 | + @media (min-width: 1200px) { |
| 158 | + grid-template-columns: repeat(3, 1fr); |
| 159 | + } |
| 160 | + } |
| 161 | +
|
| 162 | +} |
| 163 | +</style> |
0 commit comments