Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
mateuswetah 2018-05-03 23:18:37 -03:00
commit 0c09569a67
1 changed files with 27 additions and 5 deletions

View File

@ -5,13 +5,13 @@
:can-cancel="false"/>
<div class="card">
<div class="card-content">
<router-link
class="card-footer-item"
:to="{ path: $routerHelper.getItemEditPath(collectionId, itemId)}">
{{ $i18n.get('edit') + ' ' + $i18n.get('item') }}
</router-link>
<div
class="card-image"
v-if="item.document">
@ -56,7 +56,21 @@
<div
class="box">
<p>--</p>
<div
v-if="attachments && attachments.length > 0">
<span
v-for="(attachment, index) in attachments"
:key="index"
>
<a
target="blank"
:href="attachment.guid.rendered">{{ attachment.guid.rendered }}</a>
<br>
</span>
</div>
<p v-else>--</p>
<p>
<i>
{{ $i18n.get('label_attachments') }}
@ -83,15 +97,20 @@ export default {
},
methods: {
...mapActions('item', [
'fetchItem'
'fetchItem',
'fetchAttachments'
]),
...mapGetters('item', [
'getItem'
'getItem',
'getAttachments'
]),
},
computed: {
item(){
return this.getItem();
},
attachments(){
return this.getAttachments();
}
},
created(){
@ -107,6 +126,9 @@ export default {
this.fetchItem(this.itemId).then(() => {
loadingInstance.isLoading = false;
});
// Get attachments
this.fetchAttachments(this.itemId);
}
}