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

This commit is contained in:
weryques 2018-12-13 14:17:16 -02:00
commit 9b084279e2
5 changed files with 46 additions and 27 deletions

View File

@ -905,24 +905,24 @@ export default {
this.form.document_type = 'url';
this.form.document = this.urlLink;
this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type })
.then(item => {
this.item.document_as_html = item.document_as_html;
this.isLoading = false;
.then(item => {
this.item.document_as_html = item.document_as_html;
this.isLoading = false;
let oldThumbnail = this.item.thumbnail;
if (item.document_type == 'url' && oldThumbnail != item.thumbnail )
this.item.thumbnail = item.thumbnail;
})
.catch((errors) => {
for (let error of errors.errors) {
for (let metadatum of Object.keys(error)){
eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]});
let oldThumbnail = this.item.thumbnail;
if (item.document_type == 'url' && oldThumbnail != item.thumbnail )
this.item.thumbnail = item.thumbnail;
})
.catch((errors) => {
for (let error of errors.errors) {
for (let metadatum of Object.keys(error)){
eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]});
}
}
}
this.formErrorMessage = errors.error_message;
this.formErrorMessage = errors.error_message;
this.isLoading = false;
});
this.isLoading = false;
});
},
cancelURLSelection() {
this.isURLModalActive = false;
@ -945,11 +945,24 @@ export default {
});
},
deleteAttachment(attachment) {
this.removeAttachmentFromItem(attachment.id)
.then(() => { })
.catch((error) => {
this.$console.error(error);
});
this.$modal.open({
parent: this,
component: CustomDialog,
props: {
icon: 'alert',
title: this.$i18n.get('label_warning'),
message: this.$i18n.get('info_warning_attachment_delete'),
onConfirm: () => {
this.removeAttachmentFromItem(attachment.id)
.then(() => { })
.catch((error) => {
this.$console.error(error);
});
}
}
});
},
initializeMediaFrames() {

View File

@ -11,8 +11,10 @@
<p><strong>{{ $i18n.get('label_activity_author') }}:</strong> {{ activity.user_name }}</p>
</div>
<div>
<template v-for="(diff, attributeName) in activity.log_diffs">
<div class="columns">
<template v-for="(diff, attributeName, index) in activity.log_diffs">
<div
:key="index"
class="columns">
<!-- OLD -->
<div class="column is-6">
@ -45,8 +47,9 @@
<div
class="tainacan-attachments-in-modal"
v-if="diff.old.length">
<template v-for="attachment in diff.old">
<template v-for="(attachment, anotherIndex ) in diff.old">
<div
:key="anotherIndex"
class="box"
v-if="attachment.mime_type.includes('image')">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
@ -59,6 +62,7 @@
</figure>
</div>
<div
:key="anotherIndex"
class="box"
v-else-if="['pdf', 'audio', 'video'].includes(attachment.mime_type.split('/')[1])">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
@ -165,8 +169,9 @@
<div
class="tainacan-attachments-in-modal"
v-if="diff.new.length">
<template v-for="attachment in diff.new">
<template v-for="(attachment, index) in diff.new">
<div
:key="index"
class="box"
v-if="attachment.mime_type.includes('image')">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
@ -179,6 +184,7 @@
</figure>
</div>
<div
:key="index"
class="box"
v-else-if="['pdf', 'audio', 'video'].includes(attachment.mime_type.split('/')[1])">
<p class="tainacan-p-overflow">{{ `${$i18n.get('label_title')}: ${attachment.title}` }}</p>
@ -373,7 +379,6 @@
.tainacan-modal-content {
width: auto;
min-height: 600px;
border-radius: 10px;
}
.modal-card-body {

View File

@ -698,7 +698,6 @@
.tainacan-modal-content {
width: auto;
min-height: 600px;
border-radius: 10px;
}
.tainacan-modal-title {

View File

@ -6,7 +6,7 @@
.tainacan-modal-title {
display: flex;
flex-wrap: wrap;
margin-bottom: 40px;
margin-bottom: 30px;
justify-content: space-between;
align-items: flex-end;
@ -32,6 +32,7 @@
}
}
.tainacan-modal-content {
border-radius: 0px;
background-color: white;
padding: 40px 50px;
position: relative;

View File

@ -417,6 +417,7 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_collection_deleted' => __( 'Collection deleted.', 'tainacan' ),
'info_item_deleted' => __( 'Item deleted.', 'tainacan' ),
'info_taxonomy_deleted' => __( 'Taxonomy deleted', 'tainacan' ),
'info_warning_attachment_delete' => __( 'Do you really want to delete this attachment?', 'tainacan' ),
'info_warning_collection_delete' => __( 'Do you really want to permanently delete this collection?', 'tainacan' ),
'info_warning_collection_trash' => __( 'Do you really want to trash this collection?', 'tainacan' ),
'info_warning_item_delete' => __( 'Do you really want to permanently delete this item?', 'tainacan' ),