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 { fetchNode } from ' ../services/WebdavClient.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,6 +132,7 @@ export default {
123132 NcIconSvgWrapper,
124133 SidebarTab,
125134 SystemTags,
135+ NcUserBubble,
126136 },
127137
128138 setup () {
@@ -146,6 +156,7 @@ export default {
146156 error: null ,
147157 loading: true ,
148158 fileInfo: null ,
159+ node: null ,
149160 isFullScreen: false ,
150161 hasLowHeight: false ,
151162 }
@@ -287,6 +298,25 @@ export default {
287298 isSystemTagsEnabled () {
288299 return getCapabilities ()? .systemtags ? .enabled === true
289300 },
301+ ownerId () {
302+ return this .node ? .attributes ? .[' owner-id' ] ?? this .currentUser .uid
303+ },
304+ currentUserIsOwner () {
305+ return this .ownerId === this .currentUser .uid
306+ },
307+ nodeOwnerLabel () {
308+ let ownerDisplayName = this .node ? .attributes ? .[' owner-display-name' ]
309+ if (this .currentUserIsOwner ) {
310+ ownerDisplayName = ` ${ ownerDisplayName} (${ t (' files' , ' You' )} )`
311+ }
312+ return ownerDisplayName
313+ },
314+ sharedMultipleTimes () {
315+ if (Array .isArray (node .attributes ? .[' share-types' ]) && node .attributes ? .[' share-types' ].length > 1 ) {
316+ return t (' files' , ' Shared multiple times with different people' )
317+ }
318+ return null
319+ },
290320 },
291321 created () {
292322 subscribe (' files:node:deleted' , this .onNodeDeleted )
@@ -460,6 +490,7 @@ export default {
460490 this .fileInfo = await FileInfo (this .davPath )
461491 // adding this as fallback because other apps expect it
462492 this .fileInfo .dir = this .file .split (' /' ).slice (0 , - 1 ).join (' /' )
493+ this .node = await fetchNode ({ path: (this .fileInfo .path + ' /' + this .fileInfo .name ).replace (' //' , ' /' ) })
463494
464495 // DEPRECATED legacy views
465496 // TODO: remove
@@ -589,10 +620,25 @@ export default {
589620 }
590621}
591622
592- .sidebar__description {
593- display: flex;
594- flex- direction: column;
595- width: 100 % ;
596- gap: 8px 0 ;
623+ .sidebar__subname {
624+ display: flex;
625+ align- items: center;
626+ gap: 0 8px ;
627+
628+ & - separator {
629+ display: inline- block;
630+ font- weight: bold ! important;
631+ }
632+
633+ .user - bubble__wrapper {
634+ display: inline- flex;
635+ }
597636}
637+
638+ .sidebar__description {
639+ display: flex;
640+ flex- direction: column;
641+ width: 100 % ;
642+ gap: 8px 0 ;
643+ }
598644< / style>
0 commit comments