37
37
:path="'/' + albumName"
38
38
:title="albumName"
39
39
@refresh="fetchAlbumContent">
40
- <div v-if="album.location !== ''" slot="subtitle" class="album__location">
40
+ <div v-if="album.location !== ''"
41
+ slot="subtitle"
42
+ class="album__location">
41
43
<MapMarker />{{ album.location }}
42
44
</div>
43
45
53
55
</template>
54
56
55
57
<template v-if="album !== undefined" slot="right">
56
- <UploadPicker v-if="album.nbItems !== 0"
57
- :accept="allowedMimes"
58
- :context="uploadContext"
59
- :destination="album.basename"
60
- :root="uploadContext.root"
61
- :multiple="true"
62
- @uploaded="onUpload" />
58
+ <NcButton @click="showAddPhotosModal = true">
59
+ <template #icon>
60
+ <Plus :size="20" />
61
+ </template>
62
+ {{ t('photos', 'Add photos to this album' ) }}
63
+ </NcButton>
63
64
64
65
<NcButton v-if="sharingEnabled"
65
66
type="tertiary"
165
166
</template>
166
167
167
168
<script>
168
- import { addNewFileMenuEntry, removeNewFileMenuEntry } from '@nextcloud/files'
169
169
import { getCurrentUser } from '@nextcloud/auth'
170
170
import { mapActions, mapGetters } from 'vuex'
171
171
import { NcActions, NcActionButton, NcButton, NcModal, NcEmptyContent, NcActionSeparator, NcLoadingIcon, isMobile } from '@nextcloud/vue'
172
- import { UploadPicker, getUploader } from '@nextcloud/upload'
172
+ import { getUploader } from '@nextcloud/upload'
173
173
import debounce from 'debounce'
174
174
175
175
import Close from 'vue-material-design-icons/Close.vue'
@@ -180,7 +180,6 @@ import ImagePlus from 'vue-material-design-icons/ImagePlus.vue'
180
180
import MapMarker from 'vue-material-design-icons/MapMarker.vue'
181
181
import Pencil from 'vue-material-design-icons/Pencil.vue'
182
182
import Plus from 'vue-material-design-icons/Plus.vue'
183
- import PlusSvg from '@mdi/svg/svg/plus.svg'
184
183
import ShareVariant from 'vue-material-design-icons/ShareVariant.vue'
185
184
186
185
import AbortControllerMixin from '../mixins/AbortControllerMixin.js'
@@ -197,7 +196,6 @@ import FilesPicker from '../components/FilesPicker.vue'
197
196
import HeaderNavigation from '../components/HeaderNavigation.vue'
198
197
199
198
import { genFileInfo } from '../utils/fileUtils.js'
200
- import allowedMimes from '../services/AllowedMimes.js'
201
199
import client from '../services/DavClient.js'
202
200
import DavRequest from '../services/DavRequest.js'
203
201
import logger from '../services/logger.js'
@@ -228,7 +226,6 @@ export default {
228
226
Pencil,
229
227
Plus,
230
228
ShareVariant,
231
- UploadPicker,
232
229
},
233
230
234
231
mixins: [
@@ -248,26 +245,11 @@ export default {
248
245
249
246
data() {
250
247
return {
251
- allowedMimes,
252
-
253
248
showAddPhotosModal: false,
254
249
showManageCollaboratorView: false,
255
250
showEditAlbumForm: false,
256
251
257
252
loadingAddCollaborators: false,
258
-
259
- uploader: getUploader(),
260
-
261
- newFileMenuEntry: {
262
- id: 'album-add',
263
- displayName: t('photos', 'Add photos to this album'),
264
- templateName: '',
265
- if: (context) => context.route === this.$route.name,
266
- /** Existing icon css class */
267
- iconSvgInline: PlusSvg,
268
- /** Function to be run after creation */
269
- handler: () => { this.showAddPhotosModal = true },
270
- },
271
253
}
272
254
},
273
255
@@ -296,20 +278,6 @@ export default {
296
278
sharingEnabled() {
297
279
return OC.Share !== undefined
298
280
},
299
-
300
- /**
301
- * The upload picker context
302
- * We're uploading to the album folder, and the backend handle
303
- * the writing to the default location as well as the album update.
304
- * The context is also used for the NewFileMenu.
305
- */
306
- uploadContext() {
307
- return {
308
- ...this.album,
309
- route: this.$route.name,
310
- root: `dav/photos/${getCurrentUser()?.uid}/albums`,
311
- }
312
- },
313
281
},
314
282
315
283
watch: {
@@ -322,11 +290,6 @@ export default {
322
290
323
291
mounted() {
324
292
this.fetchAlbumContent()
325
- addNewFileMenuEntry(this.newFileMenuEntry)
326
- },
327
-
328
- destroyed() {
329
- removeNewFileMenuEntry(this.newFileMenuEntry)
330
293
},
331
294
332
295
methods: {
@@ -427,15 +390,6 @@ export default {
427
390
this.loadingAddCollaborators = false
428
391
}
429
392
},
430
-
431
- /**
432
- * A new File has been uploaded, let's add it
433
- *
434
- * @param {Upload[]} uploads
435
- */
436
- onUpload: debounce(function() {
437
- this.fetchAlbumContent()
438
- }, 500),
439
393
},
440
394
}
441
395
</script>
@@ -457,26 +411,4 @@ export default {
457
411
color: var(--color-text-lighter);
458
412
}
459
413
}
460
-
461
- .photos-navigation {
462
- position: relative;
463
- // Add space at the bottom for the progress bar.
464
- &--uploading {
465
- margin-bottom: 30px;
466
- }
467
- }
468
-
469
- :deep(.upload-picker) {
470
- .upload-picker__progress {
471
- position: absolute;
472
- bottom: -30px;
473
- left: 64px;
474
- margin: 0;
475
- }
476
- .upload-picker__cancel {
477
- position: absolute;
478
- bottom: -24px;
479
- right: 50px;
480
- }
481
- }
482
414
</style>
0 commit comments