1 line
4.7 KiB
Plaintext
1 line
4.7 KiB
Plaintext
{"version":3,"file":"SharedAlbums-GGuqkf-J.chunk.mjs","sources":["../src/views/SharedAlbums.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<CollectionsList\n\t\t:collections=\"sharedAlbums\"\n\t\t:loading=\"loadingCollections\"\n\t\t:error=\"errorFetchingCollections\"\n\t\tclass=\"albums-list\">\n\t\t<HeaderNavigation\n\t\t\tkey=\"navigation\"\n\t\t\tslot=\"header\"\n\t\t\t:loading=\"loadingCollections\"\n\t\t\t:title=\"t('photos', 'Collaborative albums')\"\n\t\t\t:root-title=\"t('photos', 'Collaborative albums')\"\n\t\t\t@refresh=\"fetchSharedAlbums\" />\n\n\t\t<CollectionCover\n\t\t\t:key=\"collection.basename\"\n\t\t\tslot-scope=\"{ collection }\"\n\t\t\tparent-route=\"/sharedalbums\"\n\t\t\t:collection-name=\"collection.basename\"\n\t\t\t:alt-img=\"t('photos', 'Cover photo for shared album {albumName}', { albumName: collection.basename })\"\n\t\t\t:data-test=\"collection.basename\"\n\t\t\t:cover-url=\"collection.attributes['last-photo'] | coverUrl\">\n\t\t\t<span class=\"album__name\">\n\t\t\t\t{{ collection | albumOriginalName }}\n\t\t\t</span>\n\n\t\t\t<div slot=\"subtitle\" class=\"album__details\">\n\t\t\t\t{{ collection.attributes.date }} ⸱ {{ n('photos', '%n item', '%n photos and videos', collection.attributes.nbItems) }}\n\t\t\t\t<br>\n\t\t\t\t{{ t('photos', 'Shared by') }} <NcUserBubble :display-name=\"collection.attributes.collaborators[0].label\" :user=\"collection.attributes.collaborators[0].id\" />\n\t\t\t</div>\n\t\t</CollectionCover>\n\n\t\t<NcEmptyContent slot=\"empty-collections-list\" :name=\"t('photos', 'There is no album yet!')\">\n\t\t\t<ImageMultipleOutline slot=\"icon\" />\n\t\t</NcEmptyContent>\n\t</CollectionsList>\n</template>\n\n<script lang='ts'>\nimport type { Album } from '../store/albums.js'\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { translate, translatePlural } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'\nimport NcUserBubble from '@nextcloud/vue/components/NcUserBubble'\nimport ImageMultipleOutline from 'vue-material-design-icons/ImageMultipleOutline.vue'\nimport CollectionCover from '../components/Collection/CollectionCover.vue'\nimport CollectionsList from '../components/Collection/CollectionsList.vue'\nimport HeaderNavigation from '../components/HeaderNavigation.vue'\nimport FetchCollectionsMixin from '../mixins/FetchCollectionsMixin.js'\nimport { albumsExtraProps } from '../store/albums.ts'\n\nexport default {\n\tname: 'SharedAlbums',\n\tcomponents: {\n\t\tImageMultipleOutline,\n\t\tNcEmptyContent,\n\t\tCollectionsList,\n\t\tCollectionCover,\n\t\tHeaderNavigation,\n\t\tNcUserBubble,\n\t},\n\n\tfilters: {\n\t\tcoverUrl(lastPhoto: number): string {\n\t\t\tif (lastPhoto === -1) {\n\t\t\t\treturn ''\n\t\t\t}\n\n\t\t\treturn generateUrl(`/apps/photos/api/v1/preview/${lastPhoto}?x=${512}&y=${512}`)\n\t\t},\n\n\t\talbumOriginalName(album: Album): string {\n\t\t\treturn album.basename.replace(new RegExp(`\\\\(${album.attributes.collaborators[0].id}\\\\)$`), '')\n\t\t},\n\t},\n\n\tmixins: [FetchCollectionsMixin],\n\n\tcomputed: {\n\t\tsharedAlbums(): Record<string, Album> {\n\t\t\treturn this.$store.getters.sharedAlbums\n\t\t},\n\t},\n\n\tasync beforeMount() {\n\t\tthis.fetchSharedAlbums()\n\t},\n\n\tmethods: {\n\t\tfetchSharedAlbums() {\n\t\t\tthis.fetchCollections(\n\t\t\t\t`/photos/${getCurrentUser()?.uid}/sharedalbums`,\n\t\t\t\talbumsExtraProps,\n\t\t\t)\n\t\t},\n\n\t\tt: translate,\n\t\tn: translatePlural,\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.albums-list {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t.album__name {\n\t\tfont-weight: normal;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tfont-size: 20px;\n\t\tmargin-bottom: 12px;\n\t\tline-height: 30px;\n\t\tcolor: var(--color-main-text);\n\t}\n}\n</style>\n"],"names":["_sfc_main","ImageMultipleOutline","NcEmptyContent","CollectionsList","CollectionCover","HeaderNavigation","NcUserBubble","lastPhoto","generateUrl","album","FetchCollectionsMixin","getCurrentUser","albumsExtraProps","translate","translatePlural"],"mappings":"0xBA0DA,MAAAA,EAAA,CACA,KAAA,eACA,WAAA,CACA,qBAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,aAAAC,CACA,EAEA,QAAA,CACA,SAAAC,EAAA,CACA,OAAAA,IAAA,GACA,GAGAC,EAAA,+BAAAD,CAAA,cAAA,CACA,EAEA,kBAAAE,EAAA,CACA,OAAAA,EAAA,SAAA,QAAA,IAAA,OAAA,MAAAA,EAAA,WAAA,cAAA,CAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,CAEA,EAEA,OAAA,CAAAC,CAAA,EAEA,SAAA,CACA,cAAA,CACA,OAAA,KAAA,OAAA,QAAA,YAAA,CAEA,EAEA,MAAA,aAAA,CACA,KAAA,kBAAA,CACA,EAEA,QAAA,CACA,mBAAA,CACA,KAAA,iBACA,WAAAC,KAAA,GAAA,gBACAC,CACA,CACA,EAEA,EAAAC,EACA,EAAAC,CAAA,CAEA"} |