Merge branch 'develop' into feature/783

This commit is contained in:
mateuswetah 2023-10-19 09:53:38 -03:00
commit 4724cddeae
37 changed files with 1402 additions and 415 deletions

View File

@ -191,7 +191,7 @@ class Private_Files {
$upload_dir = wp_get_upload_dir(); $upload_dir = wp_get_upload_dir();
$base_upload_url = preg_replace('/^https?:\/\//', '', $upload_dir['baseurl']); $base_upload_url = preg_replace('/^https?:\/\//', '', $upload_dir['baseurl']);
$requested_uri = ($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); $requested_uri = ($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
if ( strpos($requested_uri, $base_upload_url) === false ) { if ( strpos($requested_uri, $base_upload_url) === false ) {
// Not uploads // Not uploads
@ -228,7 +228,7 @@ class Private_Files {
if ( !$existing_file && \file_exists( $prefixed_both ) ) { if ( !$existing_file && \file_exists( $prefixed_both ) ) {
$existing_file = $prefixed_both; $existing_file = $prefixed_both;
} }
echo "-----------> $file <br> $prefixed_file <br> $prefixed_collection $prefixed_both: $existing_file";
if ($existing_file) { if ($existing_file) {
$item = \Tainacan\Repositories\Items::get_instance()->fetch( (int) $item_id, (int) $collection_id ); $item = \Tainacan\Repositories\Items::get_instance()->fetch( (int) $item_id, (int) $collection_id );

View File

@ -41,7 +41,17 @@ class Collection extends Entity {
$submission_anonymous_user, $submission_anonymous_user,
$submission_default_status, $submission_default_status,
$submission_use_recaptcha, $submission_use_recaptcha,
$disabled_mappers; $disabled_mappers,
$item_enabled_document_types,
$item_document_label,
$item_thumbnail_label,
$item_enable_thubmnail,
$item_attachment_label,
$item_enable_attachments,
$item_enable_metadata_focus_mode,
$item_enable_metadata_required_filter,
$item_enable_metadata_searchbar,
$item_enable_metadata_collapses;
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -608,8 +618,6 @@ class Collection extends Entity {
/** /**
* Get the default metadata section properties. * Get the default metadata section properties.
* *
* @param [string] $value
*
* @return void * @return void
*/ */
function get_default_metadata_section_properties( ) { function get_default_metadata_section_properties( ) {
@ -625,6 +633,97 @@ class Collection extends Entity {
return $this->get_mapped_property( 'disabled_mappers' ); return $this->get_mapped_property( 'disabled_mappers' );
} }
/**
* Get the enabled document types for this collection.
*
* @return array The enabled document types.
*/
function get_item_enabled_document_types() {
return $this->get_mapped_property('item_enabled_document_types');
}
/**
* Get the label for the section in this collection.
*
* @return string The label for the section.
*/
function get_item_document_label() {
return $this->get_mapped_property('item_document_label');
}
/**
* Get the label for the thumbnail section in this collection.
*
* @return string The label for the thumbnail section.
*/
function get_item_thumbnail_label() {
return $this->get_mapped_property('item_thumbnail_label');
}
/**
* Check if thumbnail are enabled for this collection.
*
* @return string 'yes' if thumbnail are enabled, 'no' otherwise.
*/
function get_item_enable_thumbnail() {
return $this->get_mapped_property('item_enable_thumbnail');
}
/**
* Get the plural label for the attachment section in this collection.
*
* @return string The plural label for the attachment section.
*/
function get_item_attachment_label() {
return $this->get_mapped_property('item_attachment_label');
}
/**
* Check if attachments are enabled for this collection.
*
* @return string 'yes' if attachments are enabled, 'no' otherwise.
*/
function get_item_enable_attachments() {
return $this->get_mapped_property('item_enable_attachments');
}
/**
* Check if metadata focus mode is enabled for this collection.
*
* @return string 'yes' if metadata focus mode is enabled, 'no' otherwise.
*/
function get_item_enable_metadata_focus_mode() {
return $this->get_mapped_property('item_enable_metadata_focus_mode');
}
/**
* Check if metadata required filter is enabled for this collection.
*
* @return string 'yes' if metadata required filter is enabled, 'no' otherwise.
*/
function get_item_enable_metadata_required_filter() {
return $this->get_mapped_property('item_enable_metadata_required_filter');
}
/**
* Check if metadata search bar is enabled for this collection.
*
* @return string 'yes' if metadata search bar is enabled, 'no' otherwise.
*/
function get_item_enable_metadata_searchbar() {
return $this->get_mapped_property('item_enable_metadata_searchbar');
}
/**
* Check if metadata collapses are enabled for this collection.
*
* @return bool True if metadata collapses are enabled, 'no' otherwise.
*/
function get_item_enable_metadata_collapses() {
return $this->get_mapped_property('item_enable_metadata_collapses');
}
// Setters
/** /**
* Set the collection name * Set the collection name
* *
@ -908,6 +1007,105 @@ class Collection extends Entity {
return $this->set_mapped_property( 'disabled_mappers', $value); return $this->set_mapped_property( 'disabled_mappers', $value);
} }
/* Set the enabled document types for this collection.
*
* @param array $value The enabled document types.
* @return void
*/
function set_item_enabled_document_types( $value ) {
$this->set_mapped_property('item_enabled_document_types', $value);
}
/**
* Set the label for the document section in this collection.
*
* @param string $value The label for the document section.
* @return void
*/
function set_item_document_label( $value ) {
$this->set_mapped_property('item_document_label', $value);
}
/**
* Set the label for the thumbnail section in this collection.
*
* @param string $value The label for the thumbnail section.
* @return void
*/
function set_item_thumbnail_label( $value ) {
$this->set_mapped_property('item_thumbnail_label', $value);
}
/**
* Enable or disable thumbnail for this collection.
*
* @param string $value 'yes' to enable thumbnail, 'no' to disable.
* @return void
*/
function set_item_enable_thumbnail( $value ) {
$this->set_mapped_property('item_enable_thumbnail', $value);
}
/**
* Set the plural label for the attachment section in this collection.
*
* @param string $value The plural label for the attachment section.
* @return void
*/
function set_item_attachment_label( $value ) {
$this->set_mapped_property('item_attachment_label', $value);
}
/**
* Enable or disable attachments for this collection.
*
* @param string $value 'yes' to enable attachments, 'no' to disable.
* @return void
*/
function set_item_enable_attachments( $value ) {
$this->set_mapped_property('item_enable_attachments', $value);
}
/**
* Enable or disable metadata focus mode for this collection.
*
* @param string $value 'yes' to enable metadata focus mode, 'no' to disable.
* @return void
*/
function set_item_enable_metadata_focus_mode( $value ) {
$this->set_mapped_property('item_enable_metadata_focus_mode', $value);
}
/**
* Enable or disable metadata required filter for this collection.
*
* @param string $value 'yes' to enable metadata required filter, 'no' to disable.
* @return void
*/
function set_item_enable_metadata_required_filter( $value ) {
$this->set_mapped_property('item_enable_metadata_required_filter', $value);
}
/**
* Enable or disable metadata search bar for this collection.
*
* @param string $value 'yes' to enable metadata search bar, 'no' to disable.
* @return void
*/
function set_item_enable_metadata_searchbar( $value ) {
$this->set_mapped_property('item_enable_metadata_searchbar', $value);
}
/**
* Enable or disable metadata collapses for this collection.
*
* @param string $value 'yes' to enable metadata collapses, 'no' to disable.
* @return void
*/
function set_item_enable_metadata_collapses( $value ) {
$this->set_mapped_property('item_enable_metadata_collapses', $value);
}
/** /**
* Validate Collection * Validate Collection
* *

View File

@ -338,6 +338,131 @@ class Collections extends Repository {
'items' => [ 'type' => 'string' ], 'items' => [ 'type' => 'string' ],
'default' => [], 'default' => [],
], ],
'item_enabled_document_types' => [
'map' => 'meta',
'title' => __( 'Enabled document types', 'tainacan' ),
'type' => 'object',
'description' => __( 'The document types that are available in the item edition form.', 'tainacan' ),
'items' => [
'type' => 'object',
'properties' => [
'enabled' => [
'description' => __( 'Whether the document type is enabled or not.', 'tainacan' ),
'type' => 'string',
'enum' => [ 'yes', 'no' ],
],
'label' => [
'description' => __( 'The label that will represent the document type.', 'tainacan' ),
'type' => 'string',
],
'icon' => [
'description' => __( 'The slug of the icon that will represent the document type.', 'tainacan' ),
'type' => 'string',
],
]
],
'default' => [
'attachment' => [
'enabled' => 'yes',
'label' => __( 'File', 'tainacan' ),
'icon' => 'attachments'
],
'url' => [
'enabled' => 'yes',
'label' => __('URL', 'tainacan' ),
'icon' => 'url'
],
'text' => [
'enabled' => 'yes',
'label' => __('Text', 'tainacan' ),
'icon' => 'text'
]
]
],
'item_document_label' => [
'map' => 'meta',
'title' => __( 'Main document label', 'tainacan' ),
'type' => 'string',
'description' => __( 'The label for the main document section in the item edition form', 'tainacan' ),
'default' => __( 'Document', 'tainacan' ),
//'validation' => v::stringType(),
],
'item_thumbnail_label' => [
'map' => 'meta',
'title' => __( 'Thumbnail label', 'tainacan' ),
'type' => 'string',
'description' => __( 'The label for the thumbnail section in the item edition form', 'tainacan' ),
'default' => __( 'Thumbnail', 'tainacan' ),
//'validation' => v::stringType(),
],
'item_enable_thumbnail' => [
'map' => 'meta',
'title' => __( 'Item thumbnail', 'tainacan' ),
'type' => 'string',
'description' => __( 'If enabled, each item can have a thumbnail customized instead of the one automatically generated based on the item document.', 'tainacan' ),
'default' => 'yes',
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
'enum' => [ 'yes', 'no' ],
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
],
'item_attachment_label' => [
'map' => 'meta',
'title' => __( 'Attachments plural label', 'tainacan' ),
'type' => 'string',
'description' => __( 'The plural label for the attachments section in the item edition form', 'tainacan' ),
'default' => __( 'Attachments', 'tainacan' ),
//'validation' => v::stringType(),
],
'item_enable_attachments' => [
'map' => 'meta',
'title' => __( 'Item attachments', 'tainacan' ),
'type' => 'string',
'description' => __( 'If enabled, each item can have a set of files attached to it, complementary to the item document.', 'tainacan' ),
'default' => 'yes',
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
'enum' => [ 'yes', 'no' ],
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
],
'item_enable_metadata_focus_mode' => [
'map' => 'meta',
'title' => __( 'Metadata focus mode', 'tainacan' ),
'type' => 'string',
'description' => __( 'If enabled, a button can start a special navigation mode, that focus one metadatum per time in the item edition form.', 'tainacan' ),
'default' => 'yes',
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
'enum' => [ 'yes', 'no' ],
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
],
'item_enable_metadata_required_filter' => [
'map' => 'meta',
'title' => __( 'Metadata required filter', 'tainacan' ),
'type' => 'string',
'description' => __( 'If enabled, a switch can be toggled to display only required metadata in the item edition form.', 'tainacan' ),
'default' => 'yes',
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
'enum' => [ 'yes', 'no' ],
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
],
'item_enable_metadata_searchbar' => [
'map' => 'meta',
'title' => __( 'Metadata search bar', 'tainacan' ),
'type' => 'string',
'description' => __( 'If enabled, a search bar can be used for filtering the list of metadata in the item edition form.', 'tainacan' ),
'default' => 'yes',
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
'enum' => [ 'yes', 'no' ],
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
],
'item_enable_metadata_collapses' => [
'map' => 'meta',
'title' => __( 'Metadata collapses', 'tainacan' ),
'type' => 'string',
'description' => __( 'If enabled, each metadata in the item form will be wrapped in a collapsable component.', 'tainacan' ),
'default' => 'yes',
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
'enum' => [ 'yes', 'no' ],
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
]
] ); ] );
} }

View File

@ -103,7 +103,7 @@ class Items extends Repository {
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Document', 'tainacan' ), 'title' => __( 'Document', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'The document itself. An ID in case of attachment, an URL in case of link or a text in the case of text.', 'tainacan' ), 'description' => __( 'The item main content. May be a file attached, an URL or a text depending on the type of the document.', 'tainacan' ),
'on_error' => __( 'Invalid document', 'tainacan' ), 'on_error' => __( 'Invalid document', 'tainacan' ),
'default' => '' 'default' => ''
], ],

View File

@ -51,7 +51,7 @@
<b-input <b-input
id="tainacan-text-description" id="tainacan-text-description"
type="textarea" type="textarea"
rows="3" rows="4"
:placeholder="$i18n.get('instruction_collection_description')" :placeholder="$i18n.get('instruction_collection_description')"
v-model="form.description" v-model="form.description"
@focus="clearErrors('description')"/> @focus="clearErrors('description')"/>
@ -75,6 +75,24 @@
:loading="isUpdatingSlug"/> :loading="isUpdatingSlug"/>
</b-field> </b-field>
<!-- Items list options ------------------------ -->
<div
@click="showItemsListOptions = !showItemsListOptions;"
class="collection-form-section">
<span class="icon">
<i
class="tainacan-icon"
:class="showItemsListOptions ? 'tainacan-icon-arrowdown' : 'tainacan-icon-arrowright'" />
</span>
<strong>{{ $i18n.get('label_items_list_options') }}</strong>
<hr>
</div>
<transition name="filter-item">
<div
v-show="showItemsListOptions"
class="options-columns">
<!-- Change Default OrderBy Select and Order Button--> <!-- Change Default OrderBy Select and Order Button-->
<b-field <b-field
:addons="false" :addons="false"
@ -221,6 +239,157 @@
:message="$i18n.getHelperMessage('collections', 'hide_items_thumbnail_on_lists')"/> :message="$i18n.getHelperMessage('collections', 'hide_items_thumbnail_on_lists')"/>
</b-field> </b-field>
</div>
</transition>
<!-- Item edition form options ------------------------ -->
<div
@click="showItemEditionFormOptions = !showItemEditionFormOptions;"
class="collection-form-section">
<span class="icon">
<i
class="tainacan-icon"
:class="showItemEditionFormOptions ? 'tainacan-icon-arrowdown' : 'tainacan-icon-arrowright'" />
</span>
<strong>{{ $i18n.get('label_item_edition_form_options') }}</strong>
<hr>
</div>
<transition name="filter-item">
<div
v-show="showItemEditionFormOptions"
class="options-columns">
<!-- Allowed types of main document -------------------------------- -->
<div>
<b-field
:addons="false"
:label="$i18n.getHelperTitle('collections', 'item_enabled_document_types')">
<help-button
:title="$i18n.getHelperTitle('collections', 'item_enabled_document_types')"
:message="$i18n.getHelperMessage('collections', 'item_enabled_document_types')"/>
<div class="status-radios">
<b-checkbox
v-for="(documentType, slug) in form.item_enabled_document_types"
:key="slug"
v-model="documentType.enabled"
true-value="yes"
false-value="no">
<span class="icon">
<i :class="'tainacan-icon tainacan-icon-' + documentType.icon" />
</span>
{{ documentType.label }}
</b-checkbox>
</div>
</b-field>
<b-field
v-if="Object.values(form.item_enabled_document_types).some((aDocumentType) => aDocumentType.enabled === 'yes')"
:addons="false"
:label="$i18n.getHelperTitle('collections', 'item_document_label')">
<help-button
:title="$i18n.getHelperTitle('collections', 'item_document_label')"
:message="$i18n.getHelperMessage('collections', 'item_document_label')"/>
<b-input
id="tainacan-text-item-document-label"
v-model="form.item_document_label" />
</b-field>
</div>
<!-- Thumbnail Label -------------------------------- -->
<div>
<b-field
style="margin-top: 1.5rem; margin-bottom: 0rem;"
:addons="false"
:label="$i18n.getHelperTitle('collections', 'item_enable_thumbnail')">
&nbsp;
<b-switch
id="tainacan-checkbox-item-enable-thumbnail"
size="is-small"
true-value="yes"
false-value="no"
v-model="form.item_enable_thumbnail" />
<help-button
:title="$i18n.getHelperTitle('collections', 'item_enable_thumbnail')"
:message="$i18n.getHelperMessage('collections', 'item_enable_thumbnail')"/>
</b-field>
<b-field
v-if="form.item_enable_thumbnail === 'yes'"
:addons="false"
:label="$i18n.getHelperTitle('collections', 'item_thumbnail_label')">
<help-button
:title="$i18n.getHelperTitle('collections', 'item_thumbnail_label')"
:message="$i18n.getHelperMessage('collections', 'item_thumbnail_label')"/>
<b-input
id="tainacan-text-item-thumbnail-label"
v-model="form.item_thumbnail_label" />
</b-field>
</div>
<!-- Allow attachments ------------------------ -->
<div>
<b-field
style="margin-top: 1.5rem; margin-bottom: 0rem;"
:addons="false"
:label="$i18n.getHelperTitle('collections', 'item_enable_attachments')">
&nbsp;
<b-switch
id="tainacan-checkbox-item-enable-attachments"
size="is-small"
true-value="yes"
false-value="no"
v-model="form.item_enable_attachments" />
<help-button
:title="$i18n.getHelperTitle('collections', 'item_enable_attachments')"
:message="$i18n.getHelperMessage('collections', 'item_enable_attachments')"/>
</b-field>
<!-- Attachments Label -------------------------------- -->
<b-field
v-if="form.item_enable_attachments === 'yes'"
:addons="false"
:label="$i18n.getHelperTitle('collections', 'item_attachment_label')">
<help-button
:title="$i18n.getHelperTitle('collections', 'item_attachment_label')"
:message="$i18n.getHelperMessage('collections', 'item_attachment_label')"/>
<b-input
id="tainacan-text-item-attachment-label-singular"
v-model="form.item_attachment_label" />
</b-field>
</div>
<!-- Features related to how metadata are shown in the item edition form -------------------------------- -->
<b-field
:addons="false"
:label="$i18n.get('label_metadata_related_features')">
<div class="status-radios">
<b-checkbox
v-model="form.item_enable_metadata_collapses"
true-value="yes"
false-value="no">
{{ $i18n.getHelperTitle('collections', 'item_enable_metadata_collapses') }}
</b-checkbox>
<b-checkbox
v-model="form.item_enable_metadata_focus_mode"
true-value="yes"
false-value="no">
{{ $i18n.getHelperTitle('collections', 'item_enable_metadata_focus_mode') }}
</b-checkbox>
<b-checkbox
v-model="form.item_enable_metadata_required_filter"
true-value="yes"
false-value="no">
{{ $i18n.getHelperTitle('collections', 'item_enable_metadata_required_filter') }}
</b-checkbox>
<b-checkbox
v-model="form.item_enable_metadata_searchbar"
true-value="yes"
false-value="no">
{{ $i18n.getHelperTitle('collections', 'item_enable_metadata_searchbar') }}
</b-checkbox>
</div>
</b-field>
<!-- Comment Status ------------------------ --> <!-- Comment Status ------------------------ -->
<b-field <b-field
:addons="false" :addons="false"
@ -237,6 +406,27 @@
:message="$i18n.getHelperMessage('collections', 'allow_comments')"/> :message="$i18n.getHelperMessage('collections', 'allow_comments')"/>
</b-field> </b-field>
</div>
</transition>
<!-- Item submission options ------------------------ -->
<div
@click="showItemSubmissionOptions = !showItemSubmissionOptions;"
class="collection-form-section">
<span class="icon">
<i
class="tainacan-icon"
:class="showItemSubmissionOptions ? 'tainacan-icon-arrowdown' : 'tainacan-icon-arrowright'" />
</span>
<strong>{{ $i18n.get('label_item_submission_options') }}</strong>
<hr>
</div>
<transition name="filter-item">
<div
v-show="showItemSubmissionOptions"
class="options-columns">
<!-- Allows Submissions ------------------------ --> <!-- Allows Submissions ------------------------ -->
<b-field <b-field
:addons="false" :addons="false"
@ -258,7 +448,7 @@
<transition name="filter-item"> <transition name="filter-item">
<div <div
v-if="form.allows_submission === 'yes'" v-if="form.allows_submission === 'yes'"
class="item-submission-options"> class="item-submission-options field">
<!-- Allows Submissions by anonynmous user ------------------------ --> <!-- Allows Submissions by anonynmous user ------------------------ -->
<b-field <b-field
@ -335,6 +525,9 @@
</div> </div>
</transition> </transition>
</div>
</transition>
<!-- Hook for extra Form options --> <!-- Hook for extra Form options -->
<template v-if="hasEndLeftForm"> <template v-if="hasEndLeftForm">
<form <form
@ -509,6 +702,7 @@
<help-button <help-button
:title="$i18n.getHelperTitle('collections', 'cover_page_id')" :title="$i18n.getHelperTitle('collections', 'cover_page_id')"
:message="$i18n.getHelperMessage('collections', 'cover_page_id')"/> :message="$i18n.getHelperMessage('collections', 'cover_page_id')"/>
<template v-if="form.enable_cover_page == 'yes'">
<b-autocomplete <b-autocomplete
id="tainacan-text-cover-page" id="tainacan-text-cover-page"
:placeholder="$i18n.get('instruction_cover_page')" :placeholder="$i18n.get('instruction_cover_page')"
@ -519,7 +713,6 @@
@input="fecthCoverPages" @input="fecthCoverPages"
@focus="clearErrors('cover_page_id')" @focus="clearErrors('cover_page_id')"
v-if="coverPage == undefined || coverPage.title == undefined" v-if="coverPage == undefined || coverPage.title == undefined"
:disabled="form.enable_cover_page != 'yes'"
check-infinite-scroll check-infinite-scroll
@infinite-scroll="fetchMoreCoverPages"> @infinite-scroll="fetchMoreCoverPages">
<template slot-scope="props"> <template slot-scope="props">
@ -592,7 +785,9 @@
<span class="icon is-small"> <span class="icon is-small">
<i class="tainacan-icon tainacan-icon-add"/> <i class="tainacan-icon tainacan-icon-add"/>
</span> </span>
{{ $i18n.get('label_create_new_page') }}</a> {{ $i18n.get('label_create_new_page') }}
</a>
</template>
</b-field> </b-field>
<!-- Parent Collection -------------------------------- --> <!-- Parent Collection -------------------------------- -->
@ -723,7 +918,33 @@ export default {
submission_default_status: 'draft', submission_default_status: 'draft',
submission_anonymous_user: 'no', submission_anonymous_user: 'no',
hide_items_thumbnail_on_lists: '', hide_items_thumbnail_on_lists: '',
submission_use_recaptcha: 'no' submission_use_recaptcha: 'no',
item_enabled_document_types: {
attachment: {
enabled: 'yes',
label: this.$i18n.get( 'File', 'tainacan'),
icon: 'attachments'
},
url: {
enabled: 'yes',
label: this.$i18n.get( 'URL', 'tainacan'),
icon: 'url'
},
text: {
enabled: 'yes',
label: this.$i18n.get( 'Text', 'tainacan'),
icon: 'text'
}
},
item_document_label: this.$i18n.get( 'Document', 'tainacan' ),
item_thumbnail_label: this.$i18n.get( 'Thumbnail', 'tainacan' ),
item_enable_thumbnail: 'yes',
item_attachment_label: this.$i18n.get( 'Attachments', 'tainacan' ),
item_enable_attachments: 'yes',
item_enable_metadata_focus_mode: 'yes',
item_enable_metadata_required_filter: 'yes',
item_enable_metadata_searchbar: 'yes',
item_enable_metadata_collapses: 'yes'
}, },
thumbnail: {}, thumbnail: {},
cover: {}, cover: {},
@ -754,7 +975,10 @@ export default {
metadataSearchCancel: undefined, metadataSearchCancel: undefined,
isLoadingMetadata: true, isLoadingMetadata: true,
sortingMetadata: [], sortingMetadata: [],
localDefaultOrderBy: 'date' localDefaultOrderBy: 'date',
showItemsListOptions: false,
showItemEditionFormOptions: false,
showItemSubmissionOptions: false
} }
}, },
computed: { computed: {
@ -844,6 +1068,16 @@ export default {
this.form.submission_default_status = this.collection.submission_default_status; this.form.submission_default_status = this.collection.submission_default_status;
this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha; this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha;
this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists; this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists;
this.form.item_enabled_document_types = this.collection.item_enabled_document_types;
this.form.item_document_label = this.collection.item_document_label;
this.form.item_thumbnail_label = this.collection.item_thumbnail_label;
this.form.item_enable_thumbnail = this.collection.item_enable_thumbnail;
this.form.item_attachment_label = this.collection.item_attachment_label;
this.form.item_enable_attachments = this.collection.item_enable_attachments;
this.form.item_enable_metadata_focus_mode = this.collection.item_enable_metadata_focus_mode;
this.form.item_enable_metadata_required_filter = this.collection.item_enable_metadata_required_filter;
this.form.item_enable_metadata_searchbar = this.collection.item_enable_metadata_searchbar;
this.form.item_enable_metadata_collapses = this.collection.item_enable_metadata_collapses;
// Generates CoverPage from current cover_page_id info // Generates CoverPage from current cover_page_id info
if (this.form.cover_page_id != undefined && this.form.cover_page_id != '') { if (this.form.cover_page_id != undefined && this.form.cover_page_id != '') {
@ -954,7 +1188,17 @@ export default {
submission_default_status: this.form.submission_default_status, submission_default_status: this.form.submission_default_status,
submission_use_recaptcha: this.form.submission_use_recaptcha, submission_use_recaptcha: this.form.submission_use_recaptcha,
allow_comments: this.form.allow_comments, allow_comments: this.form.allow_comments,
hide_items_thumbnail_on_lists: this.form.hide_items_thumbnail_on_lists hide_items_thumbnail_on_lists: this.form.hide_items_thumbnail_on_lists,
item_enabled_document_types: this.form.item_enabled_document_types,
item_document_label: this.form.item_document_label,
item_thumbnail_label: this.form.item_thumbnail_label,
item_enable_thumbnail: this.form.item_enable_thumbnail,
item_attachment_label: this.form.item_attachment_label,
item_enable_attachments: this.form.item_enable_attachments,
item_enable_metadata_focus_mode: this.form.item_enable_metadata_focus_mode,
item_enable_metadata_required_filter: this.form.item_enable_metadata_required_filter,
item_enable_metadata_searchbar: this.form.item_enable_metadata_searchbar,
item_enable_metadata_collapses: this.form.item_enable_metadata_collapses
}; };
this.fillExtraFormData(data); this.fillExtraFormData(data);
@ -983,6 +1227,16 @@ export default {
this.form.submission_default_status = this.collection.submission_default_status; this.form.submission_default_status = this.collection.submission_default_status;
this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha; this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha;
this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists; this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists;
this.form.item_enabled_document_types = this.collection.item_enabled_document_types;
this.form.item_document_label = this.collection.item_document_label;
this.form.item_thumbnail_label = this.collection.item_thumbnail_label;
this.form.item_enable_thumbnail = this.collection.item_enable_thumbnail;
this.form.item_attachment_label = this.collection.item_attachment_label;
this.form.item_enable_attachments = this.collection.item_enable_attachments;
this.form.item_enable_metadata_focus_mode = this.collection.item_enable_metadata_focus_mode;
this.form.item_enable_metadata_required_filter = this.collection.item_enable_metadata_required_filter;
this.form.item_enable_metadata_searchbar = this.collection.item_enable_metadata_searchbar;
this.form.item_enable_metadata_collapses = this.collection.item_enable_metadata_collapses;
this.isLoading = false; this.isLoading = false;
this.formErrorMessage = ''; this.formErrorMessage = '';
@ -1043,6 +1297,16 @@ export default {
this.form.submission_default_status = this.collection.submission_default_status; this.form.submission_default_status = this.collection.submission_default_status;
this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha; this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha;
this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists; this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists;
this.form.item_enabled_document_types = this.collection.item_enabled_document_types;
this.form.item_document_label = this.collection.item_document_label;
this.form.item_thumbnail_label = this.collection.item_thumbnail_label;
this.form.item_enable_thumbnail = this.collection.item_enable_thumbnail;
this.form.item_attachment_label = this.collection.item_attachment_label;
this.form.item_enable_attachments = this.collection.item_enable_attachments;
this.form.item_enable_metadata_focus_mode = this.collection.item_enable_metadata_focus_mode;
this.form.item_enable_metadata_required_filter = this.collection.item_enable_metadata_required_filter;
this.form.item_enable_metadata_searchbar = this.collection.item_enable_metadata_searchbar;
this.form.item_enable_metadata_collapses = this.collection.item_enable_metadata_collapses;
// Pre-fill status with publish to incentivate it // Pre-fill status with publish to incentivate it
this.form.status = 'publish'; this.form.status = 'publish';
@ -1327,6 +1591,72 @@ export default {
color: var(--tainacan-white) !important; color: var(--tainacan-white) !important;
} }
} }
.collection-form-section {
margin: 1.5em 0 0.5em -0.5em;
position: relative;
cursor: pointer;
.icon {
background: var(--tainacan-background-color);
z-index: 1;
position: relative;
}
strong {
background: var(--tainacan-background-color);
color: var(--tainacan-gray4);
font-size: 0.875em;
z-index: 1;
position: relative;
padding-right: 12px;
}
hr {
position: absolute;
top: -0.75em;
width: calc(100% - 42px);
height: 1px;
background-color: var(--tainacan-gray2);
margin-left: 42px;
transition: background-color 0.2s ease, height 0.2s ease;
}
&:hover {
.icon,
strong {
color: var(--tainacan-secondary);
}
hr {
background-color: var(--tainacan-primary );
height: 2px;
}
}
}
.options-columns {
margin-left: 0.25rem;
padding-left: 1.25em;
padding-right: 0.25em;
padding-bottom: 1.25em;border-left: 1px solid var(--tainacan-gray2);
& .field,
&>div {
break-inside: avoid;
}
&>div:not(.field) {
-moz-column-count: 2;
-moz-column-gap: 0;
-moz-column-rule: 1px solid var(--tainacan-gray1);
-webkit-column-count: 2;
-webkit-column-gap: 0;
-webkit-column-rule: 1px solid var(--tainacan-gray1);
column-count: 2;
column-gap: 4em;
column-rule: 1px solid var(--tainacan-gray1);
margin-bottom: 1.125rem;
}
}
.header-field { .header-field {
padding-top: 1px; padding-top: 1px;
@ -1440,7 +1770,7 @@ export default {
} }
.status-radios { .status-radios {
display: flex; display: flex;
margin: 5px 0;
.control-lable { .control-lable {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1472,7 +1802,7 @@ export default {
} }
.item-submission-options { .item-submission-options {
padding-left: 1em; padding-left: 1em;
padding-top: 1.25em; padding-top: 1.0em;
margin-top: -1.5em; margin-top: -1.5em;
border-left: 1px solid var(--tainacan-gray2); border-left: 1px solid var(--tainacan-gray2);
} }

View File

@ -8,7 +8,7 @@
<span class="icon has-text-gray4"> <span class="icon has-text-gray4">
<i class="tainacan-icon tainacan-icon-attachments"/> <i class="tainacan-icon tainacan-icon-attachments"/>
</span> </span>
{{ $i18n.get('label_attachments') }}&nbsp; {{ collection && collection.item_attachment_label ? collection.item_attachment_label : $i18n.get('label_attachments') }}&nbsp;
<span <span
v-if="totalAttachments" v-if="totalAttachments"
class="has-text-gray has-text-weight-normal" class="has-text-gray has-text-weight-normal"
@ -17,7 +17,7 @@
</span> </span>
</label> </label>
<help-button <help-button
:title="$i18n.get('label_attachments')" :title="collection && collection.item_attachment_label ? collection.item_attachment_label : $i18n.get('label_attachments')"
:message="$i18n.get('info_edit_attachments')"/> :message="$i18n.get('info_edit_attachments')"/>
<button <button
style="float: right; font-size: 0.875em; margin: 2px 5px;" style="float: right; font-size: 0.875em; margin: 2px 5px;"
@ -28,7 +28,7 @@
<span class="icon"> <span class="icon">
<i class="tainacan-icon tainacan-icon-edit"/> <i class="tainacan-icon tainacan-icon-edit"/>
</span> </span>
{{ $i18n.get('label_add_or_update_attachments') }} {{ $i18n.getWithVariables('label_add_or_update_%s', [ collection && collection.item_attachment_label ? collection.item_attachment_label : $i18n.get('label_attachments') ]) }}
</button> </button>
</div> </div>
<div <div
@ -38,6 +38,7 @@
<attachments-list <attachments-list
:item="item" :item="item"
:form="form" :form="form"
:collection="collection"
:is-editable="true" :is-editable="true"
:should-load-attachments="shouldLoadAttachments" :should-load-attachments="shouldLoadAttachments"
@onDeleteAttachment="($event) => $emit('onDeleteAttachment', $event)"/> @onDeleteAttachment="($event) => $emit('onDeleteAttachment', $event)"/>
@ -55,6 +56,7 @@ export default {
props: { props: {
item: Object, item: Object,
form: Object, form: Object,
collection: Object,
totalAttachments: Number, totalAttachments: Number,
isLoading: Boolean, isLoading: Boolean,
shouldLoadAttachments: Boolean shouldLoadAttachments: Boolean

View File

@ -1,21 +1,17 @@
<template> <template>
<div> <div v-if="!$adminOptions.hideItemEditionDocument && ( !$adminOptions.hideItemEditionDocumentFileInput && !$adminOptions.hideItemEditionDocumentTextInput && !$adminOptions.hideItemEditionDocumentUrlInput )">
<div <div class="section-label">
v-if="!$adminOptions.hideItemEditionDocument"
class="section-label">
<label> <label>
<span class="icon has-text-gray4"> <span class="icon has-text-gray4">
<i :class="'tainacan-icon tainacan-icon-' + ( (!form.document_type || form.document_type == 'empty' ) ? 'item' : (form.document_type == 'attachment' ? 'attachments' : form.document_type))"/> <i :class="'tainacan-icon tainacan-icon-' + ( (!form.document_type || form.document_type == 'empty' ) ? 'item' : (form.document_type == 'attachment' ? 'attachments' : form.document_type))"/>
</span> </span>
{{ form.document != undefined && form.document != null && form.document != '' ? $i18n.get('label_document') : $i18n.get('label_document_empty') }} {{ collection && collection.item_document_label ? collection.item_document_label : ( (form.document != undefined && form.document != null && form.document != '') ? $i18n.get('label_document') : $i18n.get('label_document_empty') ) }}
</label> </label>
<help-button <help-button
:title="$i18n.getHelperTitle('items', 'document')" :title="collection && collection.item_document_label ? collection.item_document_label : $i18n.getHelperTitle('items', 'document')"
:message="$i18n.getHelperMessage('items', 'document')"/> :message="$i18n.getHelperMessage('items', 'document')"/>
</div> </div>
<div <div class="section-box document-field">
v-if="!$adminOptions.hideItemEditionDocument"
class="section-box document-field">
<div <div
v-if="form.document != undefined && form.document != null && v-if="form.document != undefined && form.document != null &&
form.document_type != undefined && form.document_type != null && form.document_type != undefined && form.document_type != null &&
@ -63,7 +59,7 @@
<ul <ul
v-else v-else
class="document-field-placeholder"> class="document-field-placeholder">
<li v-if="!$adminOptions.hideItemEditionDocumentFileInput"> <li v-if="!$adminOptions.hideItemEditionDocumentFileInput && (collection && collection.item_enabled_document_types && collection.item_enabled_document_types['attachment'] && collection.item_enabled_document_types['attachment']['enabled'] === 'yes')">
<button <button
type="button" type="button"
@click.prevent="($event) => $emit('onSetFileDocument', $event)"> @click.prevent="($event) => $emit('onSetFileDocument', $event)">
@ -73,7 +69,7 @@
</button> </button>
<p>{{ $i18n.get('label_file') }}</p> <p>{{ $i18n.get('label_file') }}</p>
</li> </li>
<li v-if="!$adminOptions.hideItemEditionDocumentTextInput"> <li v-if="!$adminOptions.hideItemEditionDocumentTextInput && (collection && collection.item_enabled_document_types && collection.item_enabled_document_types['text'] && collection.item_enabled_document_types['text']['enabled'] === 'yes')">
<button <button
type="button" type="button"
@click.prevent="$emit('onSetTextDocument')"> @click.prevent="$emit('onSetTextDocument')">
@ -83,7 +79,7 @@
</button> </button>
<p>{{ $i18n.get('label_text') }}</p> <p>{{ $i18n.get('label_text') }}</p>
</li> </li>
<li v-if="!$adminOptions.hideItemEditionDocumentUrlInput"> <li v-if="!$adminOptions.hideItemEditionDocumentUrlInput && (collection && collection.item_enabled_document_types && collection.item_enabled_document_types['url'] && collection.item_enabled_document_types['url']['enabled'] === 'yes')">
<button <button
type="button" type="button"
@click.prevent="$emit('onSetURLDocument')"> @click.prevent="$emit('onSetURLDocument')">
@ -102,7 +98,8 @@
export default { export default {
props: { props: {
item: Object, item: Object,
form: Object form: Object,
collection: Object
} }
} }
</script> </script>

View File

@ -142,19 +142,19 @@
<span>{{ $i18n.get('label_all_metadata') }}</span> <span>{{ $i18n.get('label_all_metadata') }}</span>
</button> </button>
<button <button
v-if="!$adminOptions.hideItemEditionDocument" v-if="shouldDisplayItemEditionDocument || shouldDisplayItemEditionThumbnail"
@click="activeTab = 'document'; isMobileSubheaderOpen = false;"> @click="activeTab = 'document'; isMobileSubheaderOpen = false;">
<span><i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-item" /></span> <span><i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-item" /></span>
<span>{{ $i18n.get('label_document_and_thumbnail') }}</span> <span>{{ $i18n.get('label_document_and_thumbnail') }}</span>
</button> </button>
<button <button
v-if="!$adminOptions.hideItemEditionAttachments" v-if="shouldDisplayItemEditionAttachments"
@click="activeTab = 'attachments'; isMobileSubheaderOpen = false;"> @click="activeTab = 'attachments'; isMobileSubheaderOpen = false;">
<span><i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-attachments" /></span> <span><i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-attachments" /></span>
<span>{{ $i18n.get('label_all_attachments') }}</span> <span>{{ $i18n.get('label_all_attachments') }}</span>
</button> </button>
<button <button
v-if="!$adminOptions.hideItemEditionRequiredOnlySwitch" v-if="!$adminOptions.hideItemEditionRequiredOnlySwitch && (collection && collection.item_enable_metadata_required_filter === 'yes')"
@click="showOnlyRequiredMetadata = true; isMobileSubheaderOpen = false;"> @click="showOnlyRequiredMetadata = true; isMobileSubheaderOpen = false;">
<span><i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-metadata" /></span> <span><i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-metadata" /></span>
<span>{{ $i18n.get('label_only_required_metadata') }}</span> <span>{{ $i18n.get('label_only_required_metadata') }}</span>
@ -177,8 +177,8 @@
<div <div
class="column main-column" class="column main-column"
:class=" :class="
(( (!$adminOptions.hideItemEditionDocument || !$adminOptions.hideItemEditionThumbnail) && !$adminOptions.itemEditionDocumentInsideTabs) || (( (shouldDisplayItemEditionDocument || shouldDisplayItemEditionThumbnail) && !$adminOptions.itemEditionDocumentInsideTabs) ||
(!$adminOptions.hideItemEditionAttachments && !$adminOptions.itemEditionAttachmentsInsideTabs)) ? 'is-7' : 'is-12'"> (shouldDisplayItemEditionAttachments && !$adminOptions.itemEditionAttachmentsInsideTabs)) ? 'is-7' : 'is-12'">
<!-- Hook for extra Form options --> <!-- Hook for extra Form options -->
<template v-if="hasBeginRightForm"> <template v-if="hasBeginRightForm">
@ -287,7 +287,7 @@
class="header-item metadata-navigation" class="header-item metadata-navigation"
:style="$adminOptions.hideItemEditionCollapses ? 'padding-left: 0.35em !important;' : ''"> :style="$adminOptions.hideItemEditionCollapses ? 'padding-left: 0.35em !important;' : ''">
<b-button <b-button
v-if="!$adminOptions.hideItemEditionFocusMode && !isMetadataNavigation && !showOnlyRequiredMetadata && !metadataNameFilterString" v-if="!$adminOptions.hideItemEditionFocusMode && (collection && collection.item_enable_metadata_focus_mode === 'yes') && !isMetadataNavigation && !showOnlyRequiredMetadata && !metadataNameFilterString"
@click="isMetadataNavigation = true; setMetadatumFocus({ index: 0, scrollIntoView: true });" @click="isMetadataNavigation = true; setMetadatumFocus({ index: 0, scrollIntoView: true });"
class="collapse-all has-text-secondary" class="collapse-all has-text-secondary"
size="is-small"> size="is-small">
@ -340,7 +340,7 @@
</span> </span>
<b-switch <b-switch
v-if="!isMetadataNavigation && !$adminOptions.hideItemEditionRequiredOnlySwitch && itemMetadata && itemMetadata.length > 3" v-if="!isMetadataNavigation && !$adminOptions.hideItemEditionRequiredOnlySwitch && (collection && collection.item_enable_metadata_required_filter === 'yes') && itemMetadata && itemMetadata.length > 3"
id="tainacan-switch-required-metadata" id="tainacan-switch-required-metadata"
:style="'font-size: 0.625em;' + (isMobileScreen ? 'margin-right: 2rem;' : '')" :style="'font-size: 0.625em;' + (isMobileScreen ? 'margin-right: 2rem;' : '')"
size="is-small" size="is-small"
@ -349,7 +349,7 @@
</b-switch> </b-switch>
<b-field <b-field
v-if="!isMetadataNavigation && itemMetadata && itemMetadata.length > 5" v-if="!isMetadataNavigation && (collection && collection.item_enable_metadata_searchbar === 'yes') && itemMetadata && itemMetadata.length > 5"
class="header-item metadata-name-search"> class="header-item metadata-name-search">
<b-input <b-input
v-if="!isMobileScreen || openMetadataNameFilter" v-if="!isMobileScreen || openMetadataNameFilter"
@ -433,7 +433,7 @@
:item-metadatum="itemMetadatum" :item-metadatum="itemMetadatum"
:metadata-name-filter-string="metadataNameFilterString" :metadata-name-filter-string="metadataNameFilterString"
:is-collapsed="metadataCollapses[index]" :is-collapsed="metadataCollapses[index]"
:hide-collapses="$adminOptions.hideItemEditionCollapses || isMetadataNavigation" :hide-collapses="$adminOptions.hideItemEditionCollapses || isMetadataNavigation || (collection && collection.item_enable_metadata_collapses === 'no')"
:hide-metadata-types="hideMetadataTypes" :hide-metadata-types="hideMetadataTypes"
:hide-help-buttons="false" :hide-help-buttons="false"
:help-info-bellow-label="false" :help-info-bellow-label="false"
@ -495,6 +495,7 @@
<item-document-edition-form <item-document-edition-form
:item="item" :item="item"
:form="form" :form="form"
:collection="collection"
@onSetDocument="setDocument" @onSetDocument="setDocument"
@onRemoveDocument="removeDocument" @onRemoveDocument="removeDocument"
@onSetFileDocument="setFileDocument" @onSetFileDocument="setFileDocument"
@ -503,6 +504,7 @@
<item-thumbnail-edition-form <item-thumbnail-edition-form
:item="item" :item="item"
:form="form" :form="form"
:collection="collection"
:is-loading="isLoading" :is-loading="isLoading"
@onDeleteThumbnail="deleteThumbnail" @onDeleteThumbnail="deleteThumbnail"
@onUpdateThumbnailAlt="($event) => onUpdateThumbnailAlt($event)" @onUpdateThumbnailAlt="($event) => onUpdateThumbnailAlt($event)"
@ -511,7 +513,7 @@
<!-- Attachments on mobile modal --> <!-- Attachments on mobile modal -->
<div <div
v-if="activeTab === 'attachments' && $adminOptions.itemEditionAttachmentsInsideTabs" v-if="activeTab === 'attachments' && shouldDisplayItemEditionAttachments && $adminOptions.itemEditionAttachmentsInsideTabs"
class="tab-item" class="tab-item"
role="tabpanel" role="tabpanel"
aria-labelledby="attachments-tab-label" aria-labelledby="attachments-tab-label"
@ -519,6 +521,7 @@
<item-attachments-edition-form <item-attachments-edition-form
:item="item" :item="item"
:form="form" :form="form"
:collection="collection"
:is-loading="isLoading" :is-loading="isLoading"
:total-attachments="totalAttachments" :total-attachments="totalAttachments"
:should-load-attachments="shouldLoadAttachments" :should-load-attachments="shouldLoadAttachments"
@ -532,8 +535,8 @@
</div> </div>
<div <div
v-if="( (!$adminOptions.hideItemEditionDocument || !$adminOptions.hideItemEditionThumbnail) && !$adminOptions.itemEditionDocumentInsideTabs) || v-if="( (shouldDisplayItemEditionDocument || shouldDisplayItemEditionThumbnail) && !$adminOptions.itemEditionDocumentInsideTabs) ||
(!$adminOptions.hideItemEditionAttachments && !$adminOptions.itemEditionAttachmentsInsideTabs)" (shouldDisplayItemEditionAttachments && !$adminOptions.itemEditionAttachmentsInsideTabs)"
class="column is-5"> class="column is-5">
<div <div
@ -550,33 +553,37 @@
<!-- Document -------------------------------- --> <!-- Document -------------------------------- -->
<item-document-edition-form <item-document-edition-form
v-if="!$adminOptions.itemEditionDocumentInsideTabs" v-if="shouldDisplayItemEditionDocument && !$adminOptions.itemEditionDocumentInsideTabs"
:item="item" :item="item"
:form="form" :form="form"
:collection="collection"
@onSetDocument="setDocument" @onSetDocument="setDocument"
@onRemoveDocument="removeDocument" @onRemoveDocument="removeDocument"
@onSetFileDocument="setFileDocument" @onSetFileDocument="setFileDocument"
@onSetTextDocument="setTextDocument" @onSetTextDocument="setTextDocument"
@onSetURLDocument="setURLDocument" /> @onSetURLDocument="setURLDocument" />
<hr>
<hr v-if="shouldDisplayItemEditionDocument && shouldDisplayItemEditionThumbnail">
<!-- Thumbnail -------------------------------- --> <!-- Thumbnail -------------------------------- -->
<item-thumbnail-edition-form <item-thumbnail-edition-form
v-if="!$adminOptions.itemEditionDocumentInsideTabs" v-if="shouldDisplayItemEditionThumbnail && !$adminOptions.itemEditionDocumentInsideTabs"
:item="item" :item="item"
:form="form" :form="form"
:collection="collection"
:is-loading="isLoading" :is-loading="isLoading"
@onDeleteThumbnail="deleteThumbnail" @onDeleteThumbnail="deleteThumbnail"
@onUpdateThumbnailAlt="($event) => onUpdateThumbnailAlt($event)" @onUpdateThumbnailAlt="($event) => onUpdateThumbnailAlt($event)"
@openThumbnailMediaFrame="thumbnailMediaFrame.openFrame($event)" /> @openThumbnailMediaFrame="thumbnailMediaFrame.openFrame($event)" />
<hr v-if="!$adminOptions.itemEditionAttachmentsInsideTabs || hasEndLeftForm"> <hr v-if="(shouldDisplayItemEditionAttachments && !$adminOptions.itemEditionAttachmentsInsideTabs) || hasEndLeftForm">
<!-- Attachments --> <!-- Attachments -->
<item-attachments-edition-form <item-attachments-edition-form
v-if="!$adminOptions.itemEditionAttachmentsInsideTabs" v-if="shouldDisplayItemEditionAttachments && !$adminOptions.itemEditionAttachmentsInsideTabs"
:item="item" :item="item"
:form="form" :form="form"
:collection="collection"
:is-loading="isLoading" :is-loading="isLoading"
:total-attachments="totalAttachments" :total-attachments="totalAttachments"
:should-load-attachments="shouldLoadAttachments" :should-load-attachments="shouldLoadAttachments"
@ -874,18 +881,18 @@ export default {
name: this.$i18n.get('metadata'), name: this.$i18n.get('metadata'),
total: this.itemMetadata.length total: this.itemMetadata.length
}]; }];
if ( this.$adminOptions.itemEditionDocumentInsideTabs && (!this.$adminOptions.hideItemEditionDocument || !this.$adminOptions.hideItemEditionThumbnail) ) { if ( this.$adminOptions.itemEditionDocumentInsideTabs && (this.shouldDisplayItemEditionDocument || this.shouldDisplayItemEditionThumbnail) ) {
pageTabs.push({ pageTabs.push({
slug: 'document', slug: 'document',
icon: 'item', icon: 'item',
name: this.$i18n.get('label_document') name: this.collection && this.collection.item_document_label ? this.collection.item_document_label : this.$i18n.get('label_document')
}); });
} }
if ( this.$adminOptions.itemEditionAttachmentsInsideTabs && !this.$adminOptions.hideItemEditionAttachments ) { if ( this.$adminOptions.itemEditionAttachmentsInsideTabs && this.shouldDisplayItemEditionAttachments ) {
pageTabs.push({ pageTabs.push({
slug: 'attachments', slug: 'attachments',
icon: 'attachments', icon: 'attachments',
name: this.$i18n.get('label_attachments'), name: this.collection && this.collection.item_attachment_label ? this.collection.item_attachment_label : this.$i18n.get('label_attachments'),
total: this.totalAttachments total: this.totalAttachments
}); });
} }
@ -903,6 +910,21 @@ export default {
if (!this.isMetadataNavigation || !this.itemMetadata[this.focusedMetadatum]) if (!this.isMetadataNavigation || !this.itemMetadata[this.focusedMetadatum])
return false; return false;
return this.itemMetadata[this.focusedMetadatum].metadatum && this.itemMetadata[this.focusedMetadatum].metadatum.metadata_type === 'Tainacan\\Metadata_Types\\Compound'; return this.itemMetadata[this.focusedMetadatum].metadatum && this.itemMetadata[this.focusedMetadatum].metadatum.metadata_type === 'Tainacan\\Metadata_Types\\Compound';
},
shouldDisplayItemEditionDocument() {
return !this.$adminOptions.hideItemEditionDocument &&
( this.collection && this.collection.item_enabled_document_types && (
( this.collection.item_enabled_document_types['attachment'] && this.collection.item_enabled_document_types['attachment']['enabled'] === 'yes' ) ||
( this.collection.item_enabled_document_types['text'] && this.collection.item_enabled_document_types['text']['enabled'] === 'yes' ) ||
( this.collection.item_enabled_document_types['url'] && this.collection.item_enabled_document_types['url']['enabled'] === 'yes' )
)
);
},
shouldDisplayItemEditionThumbnail() {
return !this.$adminOptions.hideItemEditionThumbnail && (this.collection && this.collection.item_enable_thumbnail === 'yes');
},
shouldDisplayItemEditionAttachments() {
return !this.$adminOptions.hideItemEditionAttachments && (this.collection && this.collection.item_enable_attachments === 'yes');
} }
}, },
watch: { watch: {

View File

@ -7,10 +7,10 @@
<span class="icon has-text-gray4"> <span class="icon has-text-gray4">
<i class="tainacan-icon tainacan-icon-image"/> <i class="tainacan-icon tainacan-icon-image"/>
</span> </span>
{{ $i18n.get('label_thumbnail') }} {{ collection && collection.item_thumbnail_label ? collection.item_thumbnail_label : $i18n.get('label_thumbnail') }}
</label> </label>
<help-button <help-button
:title="$i18n.getHelperTitle('items', '_thumbnail_id')" :title="collection && collection.item_thumbnail_label ? collection.item_thumbnail_label: $i18n.getHelperTitle('items', '_thumbnail_id')"
:message="$i18n.getHelperMessage('items', '_thumbnail_id')"/> :message="$i18n.getHelperMessage('items', '_thumbnail_id')"/>
</div> </div>
@ -104,6 +104,7 @@ export default {
}, },
props: { props: {
item: Object, item: Object,
collection: Object,
form: Object form: Object
}, },
methods: { methods: {

View File

@ -436,6 +436,18 @@
height: 1px; height: 1px;
background-color: var(--tainacan-gray2); background-color: var(--tainacan-gray2);
margin-left: 42px; margin-left: 42px;
transition: background-color 0.2s ease, height 0.2s ease;
}
&:hover {
.icon,
strong {
color: var(--tainacan-secondary);
}
hr {
background-color: var(--tainacan-primary);
height: 2px;
}
} }
} }

View File

@ -610,6 +610,18 @@
height: 1px; height: 1px;
background-color: var(--tainacan-gray2); background-color: var(--tainacan-gray2);
margin-left: 42px; margin-left: 42px;
transition: background-color 0.2s ease, height 0.2s ease;
}
&:hover {
.icon,
strong {
color: var(--tainacan-secondary);
}
hr {
background-color: var(--tainacan-primary);
height: 2px;
}
} }
} }

View File

@ -233,7 +233,9 @@
originalForm: Object, originalForm: Object,
taxonomyId: '', taxonomyId: '',
isHierarchical: Boolean, isHierarchical: Boolean,
isTermInsertionFlow: false isTermInsertionFlow: false,
metadatumId: [String, Number],
itemId: [String, Number]
}, },
data() { data() {
return { return {
@ -308,7 +310,9 @@
this.isLoading = true; this.isLoading = true;
this.sendChildTerm({ this.sendChildTerm({
taxonomyId: this.taxonomyId, taxonomyId: this.taxonomyId,
term: data term: data,
metadatumId: this.metadatumId,
itemId: this.itemId
}) })
.then((term) => { .then((term) => {
this.$emit('onEditionFinished', {term: term, hasChangedParent: this.hasChangedParent, initialParent: this.initialParentId }); this.$emit('onEditionFinished', {term: term, hasChangedParent: this.hasChangedParent, initialParent: this.initialParentId });
@ -342,7 +346,9 @@
this.isLoading = true; this.isLoading = true;
this.updateTerm({ this.updateTerm({
taxonomyId: this.taxonomyId, taxonomyId: this.taxonomyId,
term: data term: data,
metadatumId: this.metadatumId,
itemId: this.itemId
}) })
.then((term) => { .then((term) => {
this.formErrors = {}; this.formErrors = {};

View File

@ -18,7 +18,7 @@
<span <span
v-if="form.document == attachment.id" v-if="form.document == attachment.id"
class="file-attachment-document-tag"> class="file-attachment-document-tag">
{{ $i18n.get('label_document') }} {{ collection && collection.item_document_label ? collection.item_document_label : $i18n.get('label_document') }}
</span> </span>
<file-item <file-item
:show-name="true" :show-name="true"
@ -52,7 +52,7 @@
<i class="tainacan-icon tainacan-icon-30px tainacan-icon-attachments"/> <i class="tainacan-icon tainacan-icon-30px tainacan-icon-attachments"/>
</span> </span>
</p> </p>
<p>{{ $i18n.get('info_no_attachments_on_item_yet') }}</p> <p>{{ $i18n.getWithVariables('info_no_%s_on_item_yet', [ collection && collection.item_attachment_label ? collection.item_attachment_label : $i18n.get('label_attachments') ]) }}</p>
</div> </div>
</section> </section>
</div> </div>
@ -63,7 +63,7 @@
v-if="attachments.length > 0"> v-if="attachments.length > 0">
<div class="shown-items"> <div class="shown-items">
{{ {{
$i18n.get('info_showing_attachments') + ' ' + $i18n.getWithVariables('info_showing_%s', [ collection && collection.item_attachment_label ? collection.item_attachment_label : $i18n.get('label_attachments') ]) + ' ' +
(attachmentsPerPage * (attachmentsPage - 1) + 1) + (attachmentsPerPage * (attachmentsPage - 1) + 1) +
$i18n.get('info_to') + $i18n.get('info_to') +
getLastAttachmentsNumber() + getLastAttachmentsNumber() +
@ -99,6 +99,7 @@
props: { props: {
item: Object, item: Object,
form: Object, form: Object,
collection: Object,
shouldLoadAttachments: Boolean, shouldLoadAttachments: Boolean,
isEditable: Boolean, isEditable: Boolean,
}, },

View File

@ -277,7 +277,7 @@
popperClass: ['tainacan-tooltip', 'tooltip'] popperClass: ['tainacan-tooltip', 'tooltip']
}" }"
class="icon"> class="icon">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-openurl"/> <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span> </span>
</a> </a>
</li> </li>

View File

@ -349,6 +349,24 @@
class="tainacan-icon tainacan-icon-1-25em"/> class="tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
id="button-open-external"
:aria-label="$i18n.getFrom('collections','view_item')"
@click.stop=""
target="_blank"
:href="collection.url">
<span
v-tooltip="{
content: $i18n.get('label_view_collection_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', 'tainacan-repository-tooltip'],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -303,6 +303,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('items','view_item')"
@click.stop=""
target="_blank"
:href="item.url">
<span
v-tooltip="{
content: $i18n.get('label_item_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', isRepositoryLevel ? 'tainacan-repository-tooltip' : ''],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
</div> </div>
@ -448,6 +467,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('items','view_item')"
@click.stop=""
target="_blank"
:href="item.url">
<span
v-tooltip="{
content: $i18n.get('label_item_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', isRepositoryLevel ? 'tainacan-repository-tooltip' : ''],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
</div> </div>
</li> </li>
@ -579,6 +617,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('items','view_item')"
@click.stop=""
target="_blank"
:href="item.url">
<span
v-tooltip="{
content: $i18n.get('label_item_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', isRepositoryLevel ? 'tainacan-repository-tooltip' : ''],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
<!-- Remaining metadata --> <!-- Remaining metadata -->
@ -802,6 +859,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('items','view_item')"
@click.stop=""
target="_blank"
:href="item.url">
<span
v-tooltip="{
content: $i18n.get('label_item_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', isRepositoryLevel ? 'tainacan-repository-tooltip' : ''],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
<!-- Remaining metadata --> <!-- Remaining metadata -->
@ -1149,6 +1225,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('items','view_item')"
@click.stop=""
target="_blank"
:href="item.url">
<span
v-tooltip="{
content: $i18n.get('label_item_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', isRepositoryLevel ? 'tainacan-repository-tooltip' : ''],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
</td> </td>
</tr> </tr>
@ -1304,6 +1399,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('items','view_item')"
@click.stop=""
target="_blank"
:href="item.url">
<span
v-tooltip="{
content: $i18n.get('label_item_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', isRepositoryLevel ? 'tainacan-repository-tooltip' : ''],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
<!-- Remaining metadata --> <!-- Remaining metadata -->
@ -1779,6 +1893,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('items','view_item')"
@click.stop=""
target="_blank"
:href="item.url">
<span
v-tooltip="{
content: $i18n.get('label_item_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', isRepositoryLevel ? 'tainacan-repository-tooltip' : ''],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
<!-- Remaining metadata --> <!-- Remaining metadata -->

View File

@ -235,6 +235,25 @@
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/> class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
</span> </span>
</a> </a>
<a
v-if="!isOnTrash"
id="button-open-external"
:aria-label="$i18n.getFrom('taxonomies','view_item')"
@click.stop=""
target="_blank"
:href="themeTaxonomiesURL + taxonomy.slug">
<span
v-tooltip="{
content: $i18n.get('label_taxonomy_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', 'tainacan-repository-tooltip'],
placement: 'auto',
html: true
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
</td> </td>
</tr> </tr>
@ -263,7 +282,8 @@
selected: [], selected: [],
allOnPageSelected: false, allOnPageSelected: false,
isSelecting: false, isSelecting: false,
adminUrl: tainacan_plugin.admin_url adminUrl: tainacan_plugin.admin_url,
themeTaxonomiesURL: tainacan_plugin.theme_taxonomy_list_url
} }
}, },
computed: { computed: {

View File

@ -136,9 +136,23 @@
placement: 'bottom' placement: 'bottom'
}" }"
class="icon"> class="icon">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-delete"/> <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-delete"/>
</span> </span>
</button> </button>
<a
target="_blank"
:href="term.url">
<span
v-tooltip="{
content: $i18n.get('label_term_page_on_website'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip', 'tainacan-repository-tooltip'],
placement: 'bottom'
}"
class="icon">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span>
</a>
</div> </div>
</label> </label>
<button <button

View File

@ -119,6 +119,21 @@
:message="$i18n.getHelperMessage('tainacan-relationship', 'accept_draft_items')"/> :message="$i18n.getHelperMessage('tainacan-relationship', 'accept_draft_items')"/>
</b-field> </b-field>
<b-field
:addons="false"
:label="$i18n.getHelperTitle('tainacan-relationship', 'accept_only_items_authored_by_current_user')">
&nbsp;
<b-switch
size="is-small"
v-model="modelAcceptOnlyItemsAuthoredByCurrentUser"
@input="emitValues()"
true-value="yes"
false-value="no" />
<help-button
:title="$i18n.getHelperTitle('tainacan-relationship', 'accept_only_items_authored_by_current_user')"
:message="$i18n.getHelperMessage('tainacan-relationship', 'accept_only_items_authored_by_current_user')"/>
</b-field>
</section> </section>
</template> </template>
@ -148,6 +163,7 @@
collectionMessage: '', collectionMessage: '',
displayRelatedItemMetadata: [], displayRelatedItemMetadata: [],
modelAcceptDraftItems: 'no', modelAcceptDraftItems: 'no',
modelAcceptOnlyItemsAuthoredByCurrentUser: 'no',
isMetaqueryRelationshipEnabled: tainacan_plugin && tainacan_plugin.tainacan_enable_relationship_metaquery == true ? tainacan_plugin.tainacan_enable_relationship_metaquery : false isMetaqueryRelationshipEnabled: tainacan_plugin && tainacan_plugin.tainacan_enable_relationship_metaquery == true ? tainacan_plugin.tainacan_enable_relationship_metaquery : false
} }
}, },
@ -172,6 +188,7 @@
this.modelSearch = ''; this.modelSearch = '';
this.modelDisplayInRelatedItems = 'no'; this.modelDisplayInRelatedItems = 'no';
this.modelAcceptDraftItems = 'no'; this.modelAcceptDraftItems = 'no';
this.modelAcceptOnlyItemsAuthoredByCurrentUser = 'no';
this.emitValues(); this.emitValues();
} }
}, },
@ -193,6 +210,7 @@
this.displayRelatedItemMetadata = this.value && this.value.display_related_item_metadata && Array.isArray(this.value.display_related_item_metadata) ? this.value.display_related_item_metadata : []; this.displayRelatedItemMetadata = this.value && this.value.display_related_item_metadata && Array.isArray(this.value.display_related_item_metadata) ? this.value.display_related_item_metadata : [];
this.modelDisplayInRelatedItems = this.value && this.value.display_in_related_items ? this.value.display_in_related_items : 'no'; this.modelDisplayInRelatedItems = this.value && this.value.display_in_related_items ? this.value.display_in_related_items : 'no';
this.modelAcceptDraftItems = this.value && this.value.accept_draft_items ? this.value.accept_draft_items : 'no'; this.modelAcceptDraftItems = this.value && this.value.accept_draft_items ? this.value.accept_draft_items : 'no';
this.modelAcceptOnlyItemsAuthoredByCurrentUser = this.value && this.value.accept_only_items_authored_by_current_user ? this.value.accept_only_items_authored_by_current_user : 'no';
}, },
methods: { methods: {
setErrorsAttributes( type, message ){ setErrorsAttributes( type, message ){
@ -283,7 +301,8 @@
search: this.modelSearch, search: this.modelSearch,
display_in_related_items: this.modelDisplayInRelatedItems, display_in_related_items: this.modelDisplayInRelatedItems,
display_related_item_metadata: this.displayRelatedItemMetadata, display_related_item_metadata: this.displayRelatedItemMetadata,
accept_draft_items: this.modelAcceptDraftItems accept_draft_items: this.modelAcceptDraftItems,
accept_only_items_authored_by_current_user: this.modelAcceptOnlyItemsAuthoredByCurrentUser
}); });
} }
} }

View File

@ -56,7 +56,7 @@
<template <template
v-if="!isLoading" v-if="!isLoading"
slot="empty"> slot="empty">
{{ $i18n.get('info_no_item_found') }} {{ isAcceptingOnlyItemsAuthoredByCurrentUser ? $i18n.get('info_no_item_authored_by_you_found') : $i18n.get('info_no_item_found') }}
</template> </template>
<template <template
v-if="currentUserCanEditItems && (!$adminOptions.itemEditionMode || $adminOptions.allowItemEditionModalInsideModal)" v-if="currentUserCanEditItems && (!$adminOptions.itemEditionMode || $adminOptions.allowItemEditionModalInsideModal)"
@ -209,6 +209,12 @@
this.itemMetadatum.metadatum && this.itemMetadatum.metadatum &&
this.itemMetadatum.metadatum.metadata_type_options && this.itemMetadatum.metadatum.metadata_type_options &&
this.itemMetadatum.metadatum.metadata_type_options.accept_draft_items === 'yes'; this.itemMetadatum.metadatum.metadata_type_options.accept_draft_items === 'yes';
},
isAcceptingOnlyItemsAuthoredByCurrentUser() {
return this.itemMetadatum &&
this.itemMetadatum.metadatum &&
this.itemMetadatum.metadatum.metadata_type_options &&
this.itemMetadatum.metadatum.metadata_type_options.accept_only_items_authored_by_current_user === 'yes';
} }
}, },
watch: { watch: {
@ -230,6 +236,7 @@
query['order'] = 'asc'; query['order'] = 'asc';
query['fetch_only'] = 'title,document_mimetype,thumbnail'; query['fetch_only'] = 'title,document_mimetype,thumbnail';
query['fetch_only_meta'] = this.isDisplayingRelatedItemMetadata ? (this.itemMetadatum.metadatum.metadata_type_options.display_related_item_metadata.filter(metadatumId => metadatumId !== 'thumbnail') + '') : (this.itemMetadatum.metadatum.metadata_type_options.search ? this.itemMetadatum.metadatum.metadata_type_options.search : ''); query['fetch_only_meta'] = this.isDisplayingRelatedItemMetadata ? (this.itemMetadatum.metadatum.metadata_type_options.display_related_item_metadata.filter(metadatumId => metadatumId !== 'thumbnail') + '') : (this.itemMetadatum.metadatum.metadata_type_options.search ? this.itemMetadatum.metadatum.metadata_type_options.search : '');
if ( this.isAcceptingDraftItems ) if ( this.isAcceptingDraftItems )
query['status'] = ['publish','private','draft']; query['status'] = ['publish','private','draft'];
@ -397,6 +404,9 @@
if (this.isAcceptingDraftItems) if (this.isAcceptingDraftItems)
query['status'] = ['publish','private','draft']; query['status'] = ['publish','private','draft'];
if ( this.isAcceptingOnlyItemsAuthoredByCurrentUser )
query['authorid'] = tainacan_plugin.user_data.ID;
if (this.selected.length > 0) if (this.selected.length > 0)
query['exclude'] = this.selected.map((item) => item.value); query['exclude'] = this.selected.map((item) => item.value);

View File

@ -71,6 +71,10 @@ class Relationship extends Metadata_Type {
'accept_draft_items' => [ 'accept_draft_items' => [
'title' => __( 'List and accept draft items on the relation', 'tainacan' ), 'title' => __( 'List and accept draft items on the relation', 'tainacan' ),
'description' => __( 'Include draft items as possible options to the relationship metadata.', 'tainacan' ), 'description' => __( 'Include draft items as possible options to the relationship metadata.', 'tainacan' ),
],
'accept_only_items_authored_by_current_user' => [
'title' => __( 'Bind items only by current author', 'tainacan' ),
'description' => __( 'Accept stabelishing the replationship only with items authored by the current user editing the item.', 'tainacan' ),
] ]
]; ];
} }
@ -121,6 +125,7 @@ class Relationship extends Metadata_Type {
case 'display_in_related_items': case 'display_in_related_items':
case 'accept_draft_items': case 'accept_draft_items':
case 'accept_only_items_authored_by_current_user':
if ($option_value == 'yes') if ($option_value == 'yes')
$readable_option_value = __('Yes', 'tainacan'); $readable_option_value = __('Yes', 'tainacan');
else if ($option_value == 'no') else if ($option_value == 'no')
@ -177,13 +182,19 @@ class Relationship extends Metadata_Type {
// empty is ok // empty is ok
if ( !empty($this->get_option('display_in_related_items')) && !in_array($this->get_option('display_in_related_items'), ['yes', 'no']) ) { if ( !empty($this->get_option('display_in_related_items')) && !in_array($this->get_option('display_in_related_items'), ['yes', 'no']) ) {
return [ return [
'display_in_related_items' => __('Display in related items must be a option yes or no','tainacan') 'display_in_related_items' => __('Display in related items must be an option yes or no','tainacan')
]; ];
} }
// empty is ok // empty is ok
if ( !empty($this->get_option('accept_draft_items')) && !in_array($this->get_option('accept_draft_items'), ['yes', 'no']) ) { if ( !empty($this->get_option('accept_draft_items')) && !in_array($this->get_option('accept_draft_items'), ['yes', 'no']) ) {
return [ return [
'accept_draft_items' => __('Accept draft items must be a option yes or no','tainacan') 'accept_draft_items' => __('Accept draft items must be an option yes or no','tainacan')
];
}
// empty is ok
if ( !empty($this->get_option('accept_only_items_authored_by_current_user')) && !in_array($this->get_option('accept_only_items_authored_by_current_user'), ['yes', 'no']) ) {
return [
'accept_only_items_authored_by_current_user' => __('Bind items only by current author must be an option yes or no','tainacan')
]; ];
} }

View File

@ -59,6 +59,8 @@
custom-class="tainacan-modal" custom-class="tainacan-modal"
:close-button-aria-label="$i18n.get('close')"> :close-button-aria-label="$i18n.get('close')">
<term-edition-form <term-edition-form
:metadatum-id="itemMetadatum.metadatum.id"
:item-id="itemMetadatum.item.id"
:is-hierarchical="isHierarchical" :is-hierarchical="isHierarchical"
:taxonomy-id="taxonomyId" :taxonomy-id="taxonomyId"
:original-form="{ id: 'new', name: newTermName ? newTermName : '' }" :original-form="{ id: 'new', name: newTermName ? newTermName : '' }"
@ -71,6 +73,8 @@
<!-- Term creation panel, used on item submission block for a simpler term creation --> <!-- Term creation panel, used on item submission block for a simpler term creation -->
<transition name="filter-item"> <transition name="filter-item">
<term-creation-panel <term-creation-panel
:metadatum-id="itemMetadatum.metadatum.id"
:item-id="itemMetadatum.item.id"
:is-hierarchical="isHierarchical" :is-hierarchical="isHierarchical"
v-if="isTermCreationPanelOpen" v-if="isTermCreationPanelOpen"
:taxonomy-id="taxonomyId" :taxonomy-id="taxonomyId"
@ -162,7 +166,7 @@
this.taxonomyId = metadata_type_options.taxonomy_id; this.taxonomyId = metadata_type_options.taxonomy_id;
this.taxonomy = metadata_type_options.taxonomy; this.taxonomy = metadata_type_options.taxonomy;
this.allowNewFromOptions = this.allowNew === false ? false : metadata_type_options.allow_new_terms == 'yes'; this.allowNewFromOptions = this.allowNew === false ? false : metadata_type_options.allow_new_terms == 'yes' && this.$userCaps.hasCapability('tnc_rep_edit_taxonomies');
this.getTermsId(); this.getTermsId();
}, },

View File

@ -72,7 +72,7 @@
class="button" class="button"
id="view-collection-button"> id="view-collection-button">
<span class="icon"> <span class="icon">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-openurl"/> <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span> </span>
<span class="is-hidden-mobile">{{ $i18n.get('label_view_collection_on_website') }}</span> <span class="is-hidden-mobile">{{ $i18n.get('label_view_collection_on_website') }}</span>
</a> </a>
@ -85,7 +85,7 @@
class="button" class="button"
id="view-repository-button--taxonomies"> id="view-repository-button--taxonomies">
<span class="icon"> <span class="icon">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-openurl"/> <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span> </span>
<span class="is-hidden-mobile">{{ $i18n.get('label_view_taxonomies_on_website') }}</span> <span class="is-hidden-mobile">{{ $i18n.get('label_view_taxonomies_on_website') }}</span>
</a> </a>
@ -98,7 +98,7 @@
class="button" class="button"
id="view-repository-button"> id="view-repository-button">
<span class="icon"> <span class="icon">
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-openurl"/> <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-openurl"/>
</span> </span>
<span class="is-hidden-mobile">{{ $i18n.get('label_view_collections_on_website') }}</span> <span class="is-hidden-mobile">{{ $i18n.get('label_view_collections_on_website') }}</span>
</a> </a>

View File

@ -273,7 +273,7 @@
<section <section
v-if="!isLoadingFilters && v-if="!isLoadingFilters &&
!((filters.length >= 0 && isRepositoryLevel) || filters.length > 0)" !((filters.length >= 0 && isRepositoryLevel) || filters.length > 0)"
class="is-grouped-centered section"> class="is-grouped-centered">
<div class="content has-text-gray has-text-centered"> <div class="content has-text-gray has-text-centered">
<p> <p>
<span class="icon is-large"> <span class="icon is-large">

View File

@ -648,7 +648,7 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
* hideItemEditionMetadataTypes * hideItemEditionMetadataTypes
* allowItemEditionModalInsideModal // Not recommended! * allowItemEditionModalInsideModal // Not recommended!
* itemEditionDocumentInsideTabs * itemEditionDocumentInsideTabs
* itemEditionAttachmentInsideTabs * itemEditionAttachmentsInsideTabs
* hideBulkEditionPageTitle * hideBulkEditionPageTitle

View File

@ -236,7 +236,8 @@ export const fetchCollection = ({ commit, }, id) => {
export const fetchCollectionBasics = ({ commit }, {collectionId, isContextEdit }) => { export const fetchCollectionBasics = ({ commit }, {collectionId, isContextEdit }) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let endpoint = '/collections/' + collectionId + '?fetch_only=name,url,status,allow_comments,hide_items_thumbnail_on_lists'; let endpoint = '/collections/' + collectionId + '?fetch_only=name,url,status,allow_comments,hide_items_thumbnail_on_lists,item_enabled_document_types,item_document_label,item_thumbnail_label,item_enable_thumbnail,item_attachment_label,item_enable_attachments,item_enable_metadata_focus_mode,item_enable_metadata_required_filter,item_enable_metadata_searchbar,item_enable_metadata_collapses';
if (isContextEdit) if (isContextEdit)
endpoint += '&context=edit'; endpoint += '&context=edit';

View File

@ -159,7 +159,14 @@ export const fetchTerms = ({}, {taxonomyId, fetchOnly, search, all, order, offse
}); });
}; };
export const sendChildTerm = ({ commit }, { taxonomyId, term }) => { export const sendChildTerm = ({ commit }, { taxonomyId, term, itemId, metadatumId }) => {
if ( itemId != undefined )
term['item_id'] = itemId;
if ( metadatumId != undefined )
term['metadatum_id'] = metadatumId;
return new Promise(( resolve, reject ) => { return new Promise(( resolve, reject ) => {
axios.tainacan.post(`/taxonomy/${taxonomyId}/terms/`, term) axios.tainacan.post(`/taxonomy/${taxonomyId}/terms/`, term)
.then( res => { .then( res => {
@ -172,7 +179,14 @@ export const sendChildTerm = ({ commit }, { taxonomyId, term }) => {
}); });
}; };
export const updateTerm = ({}, { taxonomyId, term }) => { export const updateTerm = ({}, { taxonomyId, term, itemId, metadatumId }) => {
if ( itemId != undefined )
term['item_id'] = itemId;
if ( metadatumId != undefined )
term['metadatum_id'] = metadatumId;
return new Promise(( resolve, reject ) => { return new Promise(( resolve, reject ) => {
axios.tainacan.patch(`/taxonomy/${taxonomyId}/terms/${term.id}`, term) axios.tainacan.patch(`/taxonomy/${taxonomyId}/terms/${term.id}`, term)
.then( res => { .then( res => {

View File

@ -36,7 +36,7 @@
<div <div
class="column" class="column"
:class="!$adminOptions.hideItemSingleDocument || !$adminOptions.hideItemSingleThumbnail ? 'is-7' : 'is-12'"> :class="shouldDisplayItemSingleDocument || shouldDisplayItemSingleThumbnail ? 'is-7' : 'is-12'">
<!-- Hook for extra Form options --> <!-- Hook for extra Form options -->
<template v-if="hasBeginRightForm"> <template v-if="hasBeginRightForm">
@ -179,7 +179,7 @@
</div> </div>
<div <div
v-if="!$adminOptions.hideItemSingleDocument || !$adminOptions.hideItemSingleThumbnail" v-if="shouldDisplayItemSingleDocument || shouldDisplayItemSingleThumbnail"
class="column is-5"> class="column is-5">
<div class="sticky-container"> <div class="sticky-container">
@ -193,17 +193,17 @@
<!-- Document -------------------------------- --> <!-- Document -------------------------------- -->
<div <div
v-if="!$adminOptions.hideItemSingleDocument" v-if="shouldDisplayItemSingleDocument"
class="section-label"> class="section-label">
<label> <label>
<span class="icon has-text-gray4 tainacan-icon-1-125em"> <span class="icon has-text-gray4 tainacan-icon-1-125em">
<i :class="'tainacan-icon tainacan-icon-' + ( (!item.document_type || item.document_type == 'empty' ) ? 'item' : (item.document_type == 'attachment' ? 'attachments' : item.document_type))"/> <i :class="'tainacan-icon tainacan-icon-' + ( (!item.document_type || item.document_type == 'empty' ) ? 'item' : (item.document_type == 'attachment' ? 'attachments' : item.document_type))"/>
</span> </span>
{{ item.document != undefined && item.document != null && item.document != '' ? $i18n.get('label_document') : $i18n.get('label_document_empty') }} {{ collection && collection.item_document_label ? collection.item_document_label : ( (item.document != undefined && item.document != null && item.document != '') ? $i18n.get('label_document') : $i18n.get('label_document_empty') ) }}
</label> </label>
</div> </div>
<div <div
v-if="!$adminOptions.hideItemSingleDocument" v-if="shouldDisplayItemSingleDocument"
class="section-box document-field"> class="section-box document-field">
<div <div
v-if="item.document !== undefined && item.document !== null && v-if="item.document !== undefined && item.document !== null &&
@ -216,20 +216,19 @@
<p>{{ $i18n.get('info_no_document_to_item') }}</p> <p>{{ $i18n.get('info_no_document_to_item') }}</p>
</div> </div>
</div> </div>
<!-- Thumbnail -------------------------------- --> <!-- Thumbnail -------------------------------- -->
<div <div
v-if="!$adminOptions.hideItemSingleThumbnail" v-if="shouldDisplayItemSingleThumbnail"
class="section-label"> class="section-label">
<label> <label>
<span class="icon has-text-gray4"> <span class="icon has-text-gray4">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-image"/> <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-image"/>
</span> </span>
{{ $i18n.get('label_thumbnail') }} {{ collection && collection.item_thumbnail_label ? collection.item_thumbnail_label : $i18n.get('label_thumbnail') }}
</label> </label>
</div> </div>
<div <div
v-if="!$adminOptions.hideItemSingleThumbnail" v-if="shouldDisplayItemSingleThumbnail"
class="section-box section-thumbnail"> class="section-box section-thumbnail">
<div class="thumbnail-field"> <div class="thumbnail-field">
<file-item <file-item
@ -270,14 +269,14 @@
<!-- Attachments -------------------------------- --> <!-- Attachments -------------------------------- -->
<div <div
v-if="!$adminOptions.hideItemSingleAttachments" v-if="shouldDisplayItemSingleAttachments"
class="section-label"> class="section-label">
<label slot="header"> <label slot="header">
<span class="icon has-text-gray4"> <span class="icon has-text-gray4">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-attachments"/> <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-attachments"/>
</span> </span>
<span> <span>
{{ $i18n.get('label_attachments') }}&nbsp; {{ collection && collection.item_attachment_label ? collection.item_attachment_label : $i18n.get('label_attachments') }}&nbsp;
<span <span
v-if="totalAttachments" v-if="totalAttachments"
class="has-text-gray has-text-weight-normal"> class="has-text-gray has-text-weight-normal">
@ -287,11 +286,12 @@
</label> </label>
</div> </div>
<div <div
v-if="item != undefined && item.id != undefined && !isLoading && !$adminOptions.hideItemSingleAttachments" v-if="item != undefined && item.id != undefined && !isLoading && shouldDisplayItemSingleAttachments"
class="section-box section-attachments"> class="section-box section-attachments">
<attachments-list <attachments-list
:item="item" :item="item"
:form="item" /> :form="item"
:collection="collection" />
</div> </div>
<!-- Hook for extra Form options --> <!-- Hook for extra Form options -->
@ -305,7 +305,6 @@
</div> </div>
</div> </div>
</div> </div>
<footer class="footer"> <footer class="footer">
@ -537,6 +536,21 @@
} }
return pageTabs; return pageTabs;
}, },
shouldDisplayItemSingleDocument() {
return !this.$adminOptions.hideItemSingleDocument &&
( this.collection && this.collection.item_enabled_document_types && (
( this.collection.item_enabled_document_types['attachment'] && this.collection.item_enabled_document_types['attachment']['enabled'] === 'yes' ) ||
( this.collection.item_enabled_document_types['text'] && this.collection.item_enabled_document_types['text']['enabled'] === 'yes' ) ||
( this.collection.item_enabled_document_types['url'] && this.collection.item_enabled_document_types['url']['enabled'] === 'yes' )
)
);
},
shouldDisplayItemSingleThumbnail() {
return !this.$adminOptions.hideItemSingleThumbnail && (this.collection && this.collection.item_enable_thumbnail === 'yes');
},
shouldDisplayItemSingleAttachments() {
return !this.$adminOptions.hideItemSingleAttachments && (this.collection && this.collection.item_enable_attachments === 'yes');
}
}, },
created() { created() {
// Obtains item and collection ID // Obtains item and collection ID

View File

@ -304,14 +304,14 @@
position: -webkit-sticky !important; position: -webkit-sticky !important;
right: 0px; right: 0px;
top: auto; top: auto;
width: 80px; width: 100px;
.actions-container { .actions-container {
display: flex; display: flex;
position: relative; position: relative;
padding: 0; padding: 0;
height: 100%; height: 100%;
width: 80px; width: 100px;
z-index: 9; z-index: 9;
background-color: var(--tainacan-white); background-color: var(--tainacan-white);
float: right; float: right;

View File

@ -131,7 +131,7 @@
} }
.metadata-title { .metadata-title {
flex-shrink: 0; flex-shrink: 0;
padding: 0.6em 5em 0.5em 2.75em; padding: 0.6em 7em 0.5em 2.75em;
min-height: 40px; min-height: 40px;
position: relative; position: relative;
font-size: 1em !important; font-size: 1em !important;

View File

@ -102,7 +102,7 @@
} }
.metadata-title { .metadata-title {
flex-shrink: 0; flex-shrink: 0;
padding: 0.5em 4.75em 0.5em 2.75em; padding: 0.5em 7em 0.5em 2.75em;
min-height: 40px; min-height: 40px;
position: relative; position: relative;
font-size: 1em !important; font-size: 1em !important;

View File

@ -110,7 +110,7 @@
} }
.metadata-title { .metadata-title {
flex-shrink: 0; flex-shrink: 0;
padding: 0.5em 4.75em 0.5em 2.75em; padding: 0.5em 7em 0.5em 2.75em;
font-size: 1.0em !important; font-size: 1.0em !important;
min-height: 40px; min-height: 40px;
position: relative; position: relative;

View File

@ -297,12 +297,21 @@ class Admin {
$cur_user = wp_get_current_user(); $cur_user = wp_get_current_user();
$user_caps = array(); $user_caps = array();
$prefs = array(); $prefs = array();
$user_data = array();
if ( $cur_user instanceof \WP_User ) { if ( $cur_user instanceof \WP_User ) {
$tainacan_caps = \tainacan_roles()->get_repository_caps_slugs(); $tainacan_caps = \tainacan_roles()->get_repository_caps_slugs();
foreach ($tainacan_caps as $tcap) { foreach ($tainacan_caps as $tcap) {
$user_caps[$tcap] = current_user_can( $tcap ); $user_caps[$tcap] = current_user_can( $tcap );
} }
$prefs = get_user_meta( $cur_user->ID, 'tainacan_prefs', true ); $prefs = get_user_meta( $cur_user->ID, 'tainacan_prefs', true );
if ( $cur_user->data && isset($cur_user->data->user_email) && isset($cur_user->data->display_name) ) {
$user_data = array(
'ID' => $cur_user->ID,
'email' => $cur_user->data->user_email,
'display_name' => $cur_user->data->display_name
);
}
} }
$settings = [ $settings = [
@ -314,6 +323,7 @@ class Admin {
'i18n' => $tainacan_admin_i18n, 'i18n' => $tainacan_admin_i18n,
'user_caps' => $user_caps, 'user_caps' => $user_caps,
'user_prefs' => $prefs, 'user_prefs' => $prefs,
'user_data' => $user_data,
'base_url' => $TAINACAN_BASE_URL, 'base_url' => $TAINACAN_BASE_URL,
'plugin_dir_url' => plugin_dir_url( __DIR__ ), 'plugin_dir_url' => plugin_dir_url( __DIR__ ),
'admin_url' => admin_url(), 'admin_url' => admin_url(),

View File

@ -220,7 +220,9 @@
{{ $i18n.getHelperMessage('items', '_thumbnail_id') }} {{ $i18n.getHelperMessage('items', '_thumbnail_id') }}
</p> </p>
</div> </div>
<div class="section-toggle"> <div
v-if="!hideFileModalButton || !hideTextModalButton || !hideLinkModalButton"
class="section-toggle">
<p>{{ showThumbnailInput ? $i18n.get('info_thumbnail_custom') : $i18n.get('info_thumbnail_default_from_document') }}</p> <p>{{ showThumbnailInput ? $i18n.get('info_thumbnail_custom') : $i18n.get('info_thumbnail_default_from_document') }}</p>
<div class="field has-addons"> <div class="field has-addons">
<b-switch <b-switch
@ -232,7 +234,7 @@
</div> </div>
</div> </div>
<div <div
v-if="!isLoading && showThumbnailInput" v-if="!isLoading && showThumbnailInput || (hideFileModalButton && hideTextModalButton && hideLinkModalButton)"
class="section-box section-thumbnail" class="section-box section-thumbnail"
id="tainacan-item-metadatum_id-thumbnail"> id="tainacan-item-metadatum_id-thumbnail">
<b-upload <b-upload

View File

@ -284,7 +284,7 @@ function tainacan_blocks_get_category_icon_script() {
wp_enqueue_script( wp_enqueue_script(
'tainacan-blocks-register-category-icon', 'tainacan-blocks-register-category-icon',
$TAINACAN_BASE_URL . '/assets/js/tainacan_blocks_category_icon.js', $TAINACAN_BASE_URL . '/assets/js/tainacan_blocks_category_icon.js',
array('wp-blocks'), array('wp-blocks', 'wp-element'),
$TAINACAN_VERSION $TAINACAN_VERSION
); );
} }

View File

@ -321,6 +321,8 @@ return apply_filters( 'tainacan-i18n', [
'label_select_all_terms' => __( 'Select all taxonomy terms', 'tainacan' ), 'label_select_all_terms' => __( 'Select all taxonomy terms', 'tainacan' ),
'label_all_terms_selected' => __( 'All terms selected', 'tainacan' ), 'label_all_terms_selected' => __( 'All terms selected', 'tainacan' ),
'label_add_or_update_attachments' => __( 'Add or update attachments', 'tainacan' ), 'label_add_or_update_attachments' => __( 'Add or update attachments', 'tainacan' ),
/* translators: by default this the plural of attachments */
'label_add_or_update_%s' => __( 'Add or update %s', 'tainacan' ),
'label_blank_collection' => __( 'Blank collection', 'tainacan' ), 'label_blank_collection' => __( 'Blank collection', 'tainacan' ),
/* translators: the metadata scheme https://dublincore.org/ */ /* translators: the metadata scheme https://dublincore.org/ */
'label_dublin_core' => __( 'Dublin Core', 'tainacan' ), 'label_dublin_core' => __( 'Dublin Core', 'tainacan' ),
@ -703,6 +705,10 @@ return apply_filters( 'tainacan-i18n', [
'label_multiple_terms' => __( 'Multiple terms', 'tainacan' ), 'label_multiple_terms' => __( 'Multiple terms', 'tainacan' ),
'label_multiple' => __( 'Multiple', 'tainacan' ), 'label_multiple' => __( 'Multiple', 'tainacan' ),
'label_separator' => __( 'Separator', 'tainacan' ), 'label_separator' => __( 'Separator', 'tainacan' ),
'label_items_list_options' => __( 'Items list options', 'tainacan' ),
'label_item_edition_form_options' => __( 'Item edition form options', 'tainacan' ),
'label_item_submission_options' => __( 'Item submission options', 'tainacan' ),
'label_metadata_related_features' => __( 'Metadata related features', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders // Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ), 'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),
@ -839,6 +845,7 @@ return apply_filters( 'tainacan-i18n', [
'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ), 'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ),
'info_no_item_found_filter' => __( 'No item was found here with these filters.', 'tainacan' ), 'info_no_item_found_filter' => __( 'No item was found here with these filters.', 'tainacan' ),
'info_no_item_found' => __( 'No item was found.', 'tainacan' ), 'info_no_item_found' => __( 'No item was found.', 'tainacan' ),
'info_no_item_authored_by_you_found' => __( 'No item authored by you was found.', 'tainacan' ),
'info_item_not_saved' => __( 'Warning: Item not saved.', 'tainacan' ), 'info_item_not_saved' => __( 'Warning: Item not saved.', 'tainacan' ),
'info_no_associated_role' => __( 'No associated role.', 'tainacan' ), 'info_no_associated_role' => __( 'No associated role.', 'tainacan' ),
'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ), 'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ),
@ -868,6 +875,8 @@ return apply_filters( 'tainacan-i18n', [
/* translators: This is displayed before sentences like "Showing items 2 to 8 of 12 */ /* translators: This is displayed before sentences like "Showing items 2 to 8 of 12 */
'info_showing_items' => __( 'Showing items ', 'tainacan' ), 'info_showing_items' => __( 'Showing items ', 'tainacan' ),
'info_showing_attachments' => __( 'Showing attachments ', 'tainacan' ), 'info_showing_attachments' => __( 'Showing attachments ', 'tainacan' ),
/* translators: This is displayed before sentences like "Showing attachments 2 to 8 of 12 */
'info_showing_%s' => __( 'Showing %s ', 'tainacan' ),
'info_showing_collections' => __( 'Showing collections ', 'tainacan' ), 'info_showing_collections' => __( 'Showing collections ', 'tainacan' ),
'info_showing_taxonomies' => __( 'Showing taxonomies ', 'tainacan' ), 'info_showing_taxonomies' => __( 'Showing taxonomies ', 'tainacan' ),
'info_showing_activities' => __( 'Showing activities ', 'tainacan' ), 'info_showing_activities' => __( 'Showing activities ', 'tainacan' ),
@ -907,6 +916,8 @@ return apply_filters( 'tainacan-i18n', [
'info_help_term_description' => __( 'The description of the Term.', 'tainacan' ), 'info_help_term_description' => __( 'The description of the Term.', 'tainacan' ),
'info_help_parent_term' => __( 'The parent term', 'tainacan' ), 'info_help_parent_term' => __( 'The parent term', 'tainacan' ),
'info_no_attachments_on_item_yet' => __( 'The are no attachments on this item so far.', 'tainacan' ), 'info_no_attachments_on_item_yet' => __( 'The are no attachments on this item so far.', 'tainacan' ),
/* translators: This is displayed to indicate that there are no attachments yet. The attachments label can be tweked by user. */
'info_no_%s_on_item_yet' => __( 'The are no %s on this item so far.', 'tainacan' ),
'info_repository_metadata_inheritance' => __( 'Repository Metadata will be inherited by all collections.', 'tainacan' ), 'info_repository_metadata_inheritance' => __( 'Repository Metadata will be inherited by all collections.', 'tainacan' ),
'info_repository_filters_inheritance' => __( 'Repository Filters will be inherited by all collections.', 'tainacan' ), 'info_repository_filters_inheritance' => __( 'Repository Filters will be inherited by all collections.', 'tainacan' ),
'info_create_filters' => __( 'Click or Drag and Drop Metadata here for creating a new Filter.', 'tainacan' ), 'info_create_filters' => __( 'Click or Drag and Drop Metadata here for creating a new Filter.', 'tainacan' ),