1717 @closing =" handleClosing"
1818 @closed =" handleClosed" >
1919 <template v-if =" fileInfo " #subname >
20- <NcIconSvgWrapper v-if =" fileInfo.isFavourited"
21- :path =" mdiStar"
22- :name =" t('files', 'Favorite')"
23- inline />
24- {{ size }}
25- <NcDateTime :timestamp =" fileInfo.mtime" />
20+ <div class =" sidebar__subname" >
21+ <NcIconSvgWrapper v-if =" fileInfo.isFavourited"
22+ :path =" mdiStar"
23+ :name =" t('files', 'Favorite')"
24+ inline />
25+ <span >{{ size }}</span >
26+ <span class =" sidebar__subname-separator" >•</span >
27+ <NcDateTime :timestamp =" fileInfo.mtime" />
28+ <span class =" sidebar__subname-separator" >•</span >
29+ <span >{{ t('files', 'Owner') }}</span >
30+ <NcUserBubble :user =" ownerId"
31+ :display-name =" nodeOwnerLabel" />
32+ </div >
2633 </template >
2734
2835 <!-- TODO: create a standard to allow multiple elements here? -->
@@ -96,6 +103,7 @@ import { encodePath } from '@nextcloud/paths'
96103import { generateUrl } from ' @nextcloud/router'
97104import { ShareType } from ' @nextcloud/sharing'
98105import { mdiStar , mdiStarOutline } from ' @mdi/js'
106+ import { useFilesStore } from ' ../store/files.ts'
99107import axios from ' @nextcloud/axios'
100108import $ from ' jquery'
101109
@@ -104,6 +112,7 @@ import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
104112import NcDateTime from ' @nextcloud/vue/dist/Components/NcDateTime.js'
105113import NcEmptyContent from ' @nextcloud/vue/dist/Components/NcEmptyContent.js'
106114import NcIconSvgWrapper from ' @nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
115+ import NcUserBubble from ' @nextcloud/vue/dist/Components/NcUserBubble.js'
107116
108117import FileInfo from ' ../services/FileInfo.js'
109118import LegacyView from ' ../components/LegacyView.vue'
@@ -123,15 +132,17 @@ export default {
123132 NcIconSvgWrapper,
124133 SidebarTab,
125134 SystemTags,
135+ NcUserBubble,
126136 },
127137
128138 setup () {
129139 const currentUser = getCurrentUser ()
140+ const filesStore = useFilesStore ()
130141
131142 // Non reactive properties
132143 return {
133144 currentUser,
134-
145+ filesStore,
135146 mdiStar,
136147 mdiStarOutline,
137148 }
@@ -146,6 +157,7 @@ export default {
146157 error: null ,
147158 loading: true ,
148159 fileInfo: null ,
160+ node: null ,
149161 isFullScreen: false ,
150162 hasLowHeight: false ,
151163 }
@@ -287,6 +299,25 @@ export default {
287299 isSystemTagsEnabled () {
288300 return getCapabilities ()? .systemtags ? .enabled === true
289301 },
302+ ownerId () {
303+ return this .node ? .attributes ? .[' owner-id' ] ?? this .currentUser .uid
304+ },
305+ currentUserIsOwner () {
306+ return this .ownerId === this .currentUser .uid
307+ },
308+ nodeOwnerLabel () {
309+ let ownerDisplayName = this .node ? .attributes ? .[' owner-display-name' ]
310+ if (this .currentUserIsOwner ) {
311+ ownerDisplayName = ` ${ ownerDisplayName} (${ t (' files' , ' You' )} )`
312+ }
313+ return ownerDisplayName
314+ },
315+ sharedMultipleTimes () {
316+ if (Array .isArray (node .attributes ? .[' share-types' ]) && node .attributes ? .[' share-types' ].length > 1 ) {
317+ return t (' files' , ' Shared multiple times with different people' )
318+ }
319+ return null
320+ },
290321 },
291322 created () {
292323 subscribe (' files:node:deleted' , this .onNodeDeleted )
@@ -460,6 +491,7 @@ export default {
460491 this .fileInfo = await FileInfo (this .davPath )
461492 // adding this as fallback because other apps expect it
462493 this .fileInfo .dir = this .file .split (' /' ).slice (0 , - 1 ).join (' /' )
494+ this .node = this .filesStore .getNode ((this .fileInfo .path + ' /' + this .fileInfo .name ).replace (' //' , ' /' ))
463495
464496 // DEPRECATED legacy views
465497 // TODO: remove
@@ -589,10 +621,25 @@ export default {
589621 }
590622}
591623
592- .sidebar__description {
593- display: flex;
594- flex- direction: column;
595- width: 100 % ;
596- gap: 8px 0 ;
624+ .sidebar__subname {
625+ display: flex;
626+ align- items: center;
627+ gap: 0 8px ;
628+
629+ & - separator {
630+ display: inline- block;
631+ font- weight: bold ! important;
632+ }
633+
634+ .user - bubble__wrapper {
635+ display: inline- flex;
636+ }
597637}
638+
639+ .sidebar__description {
640+ display: flex;
641+ flex- direction: column;
642+ width: 100 % ;
643+ gap: 8px 0 ;
644+ }
598645< / style>
0 commit comments