Adaptations to new attachments endpoint.
This commit is contained in:
parent
9587ec512a
commit
9ac139dfb5
|
@ -13,7 +13,7 @@
|
||||||
<div
|
<div
|
||||||
v-if="file.media_type == 'image'"
|
v-if="file.media_type == 'image'"
|
||||||
class="image"
|
class="image"
|
||||||
:style="{ 'background-image': 'url(' + file.thumbnails['tainacan-medium'] ? file.thumbnails['tainacan-medium'][0] : file.thumbnails['medium'][0] + ')' }"/>
|
:style="{ 'background-image': 'url(' + (file.thumbnails['tainacan-medium'] ? file.thumbnails['tainacan-medium'][0] : file.thumbnails['medium'][0]) + ')' }"/>
|
||||||
<div
|
<div
|
||||||
:style="{ 'background-color': '#f2f2f2' }"
|
:style="{ 'background-color': '#f2f2f2' }"
|
||||||
v-else
|
v-else
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
||||||
<!-- Preview Modal ----------------- -->
|
<!-- Preview Modal ----------------- -->
|
||||||
<template v-if="modalOnClick">
|
<template v-if="modalOnClick">
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="is-flex rendered-content"
|
class="is-flex rendered-content"
|
||||||
v-html="file.description" />
|
v-html="file.description ? file.description : `<img alt='` + $i18n.get('label_thumbnail') + `' src='` + file.url + `'/>`" />
|
||||||
<iframe
|
<iframe
|
||||||
style="width: 100%; min-height: 50vh;"
|
style="width: 100%; min-height: 50vh;"
|
||||||
v-if="file.url != undefined && file.url != undefined && file.mime_type != undefined && file.mime_type == 'application/pdf'"
|
v-if="file.url != undefined && file.url != undefined && file.mime_type != undefined && file.mime_type == 'application/pdf'"
|
||||||
|
|
|
@ -219,7 +219,7 @@ export const fetchAttachments = ({ commit }, { page, attachmentsPerPage, itemId,
|
||||||
commit('cleanAttachments');
|
commit('cleanAttachments');
|
||||||
commit('setTotalAttachments', null);
|
commit('setTotalAttachments', null);
|
||||||
|
|
||||||
let endpoint = '/items/' + itemId + '/attachments?per_page=' + attachmentsPerPage + '&page=' + page;
|
let endpoint = '/items/' + itemId + '/attachments?perpage=' + attachmentsPerPage + '&paged=' + page;
|
||||||
|
|
||||||
if (documentId)
|
if (documentId)
|
||||||
endpoint += '&exclude=' + documentId;
|
endpoint += '&exclude=' + documentId;
|
||||||
|
|
Loading…
Reference in New Issue