Merge branch 'release/0.20.6'

This commit is contained in:
vnmedeiros 2023-12-06 15:40:15 -03:00
commit 76770ef19e
12 changed files with 103 additions and 99 deletions

View File

@ -245,7 +245,7 @@ class REST_Facets_Controller extends REST_Controller {
],
'parent' => [
'type' => 'string',
'description' => __( 'Parent term id, if coming from a Taxonomy metadata type tha has hierarchy.', 'tainacan' ),
'description' => __( 'Parent term id, if coming from a Taxonomy metadata type that has hierarchy.', 'tainacan' ),
],
'total_items' => [
'type' => 'integer',

View File

@ -285,7 +285,7 @@ class Metadata_Sections extends Repository {
// Add public states.
$statuses = get_post_stati( array( 'public' => true ) );
$read_private_cap = 'tnc_col_' . $parent_id . '_read_private_metadata_section';
$read_private_cap = 'tnc_col_' . $parent_id . '_read_private_metasection';
if ( current_user_can($read_private_cap) ) {
$statuses = array_merge( $statuses, get_post_stati( array( 'private' => true ) ) );
}

View File

@ -295,9 +295,12 @@ class Taxonomies extends Repository {
$id = $taxonomy_id;
if ( ! empty( $id ) && is_numeric( $id ) && is_numeric($collection_id) ) {
$tax = $this->fetch( (int) $id );
$tax->add_collection_id( $collection_id );
if ( $tax->validate() ) {
$this->insert( $tax );
if ( $tax instanceof Entities\Taxonomy ) {
$tax->add_collection_id( $collection_id );
if ( $tax->validate() )
$this->insert( $tax );
}
}
$this->update_taxonomy_registry_for_collection($taxonomy_id, $collection_id);
@ -307,9 +310,12 @@ class Taxonomies extends Repository {
$id = $taxonomy_id;
if ( ! empty( $id ) && is_numeric( $id ) && is_numeric($collection_id) ) {
$tax = $this->fetch( (int) $id );
$tax->remove_collection_id( $collection_id );
if ( $tax->validate() ) {
$this->insert( $tax );
if ( $tax instanceof Entities\Taxonomy ) {
$tax->remove_collection_id( $collection_id );
if ( $tax->validate() )
$this->insert( $tax );
}
}
$this->update_taxonomy_registry_for_collection($taxonomy_id, $collection_id);

View File

@ -4,7 +4,7 @@ Tags: museums, libraries, archives, GLAM, collections, repository
Requires at least: 5.9
Tested up to: 6.4
Requires PHP: 7.0
Stable tag: 0.20.5
Stable tag: 0.20.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -15,7 +15,7 @@ Tainacan is an open-source, powerful and flexible digital repository platform fo
[Tainacan](https://tainacan.org/) is an [open-source](https://github.com/tainacan/tainacan), powerful and flexible digital repository platform for WordPress. Manage and publish your digital collections just as easily as you post to your blog, having all the tools of a professional repository platform. It can be used for the creation of a digital collection, a digital library or a digital repository for your institutional or personal collection.
Tainacan aims to facilitate the activities of organizing, documenting, disseminating and displaying digital objects based on simple and accessible principles of digital curation. The plugin integrates with the Wordpress block engine, making it easy to reuse objects for different and varied uses.
Tainacan aims to facilitate the activities of organizing, documenting, disseminating and displaying digital objects based on simple and accessible principles of digital curation. The plugin integrates with the WordPress block engine, making it easy to reuse objects for different and varied uses.
@ -27,9 +27,9 @@ Tainacan aims to facilitate the activities of organizing, documenting, dissemina
* "Manage Taxonomies": Manage vocabularies that can be used across all your collections.
* "Themes": The Tainacan plugin has its own default theme, which helps you to showcase your collections in a beautiful and effective manner. But it can also work with any WordPress theme, so interface developers can easily add Tainacan specific features to an existing theme.
* "Themes": The Tainacan plugin has its own default theme, which helps you to showcase your collections beautifully and effectively. But it can also work with any WordPress theme, so interface developers can easily add Tainacan-specific features to an existing theme.
* "API and Interoperability": Tainacan implements a RESTful API (read and write) to allow other applications to interact with your repository. That way, you can expose your collection in different formats, such as JSON, JsonLD, OAI-PMH and others. If your collection has a specific set of metadata, you can map this metadata to match the patterns you want to use.
* "API and Interoperability": Tainacan implements a RESTful API (read and write) to allow other applications to interact with your repository. That way, you can expose your collection in different formats, such as JSON, CSV, HTML and others. If your collection has a specific set of metadata, you can map this metadata to match the patterns you want to use.
* "Gutenberg blocks": Tell stories with your collections. Tainacan offers you several Gutenberg blocks so you can present your collections to the public in many different ways!
@ -53,9 +53,9 @@ Back to the "Items" screen, click "Add new" to create a new item.
= Manage and browse your collection =
Through this admin interface you can manage your collection and browse its item using the faceted search interface or advanced search interface.
Through this admin interface, you can manage your collection and browse its items using the faceted search interface or advanced search interface.
If you want to visit your collections in the public side of your site, using your current theme, visit http://your-site/collections and you will get the list of your collections.
If you want to visit your collections on the public side of your site, using your current theme, visit http://your-site/collections and you will get the list of your collections.
= Set up Taxonomies =
@ -65,7 +65,7 @@ You can also have metadata as taxonomies, which you can configure with a set of
Edit your menu and links directly to your collections. Click "Screen options" at the top of the Edit Menu page and enable "Collections".
If you want to add a link to the list of collections, click "View all" tab on the Collections box on the left, and then add the first item named "Collections" to the menu.
If you want to add a link to the list of collections, click the "View all" tab on the Collections box on the left, and then add the first item named "Collections" to the menu.
= Faceted search in your theme =
@ -75,7 +75,7 @@ To have a fully-featured faceted search in your theme, you can either make it co
Upload the files to the plugins directory and activate it. You can also install and activate directly from the admin panel.
If you have Imagick installed in your server, Tainacan will be able to automatically generate a thumbnail from your PDF files. This is desired but not required.
If you have Imagick installed on your server, Tainacan will be able to automatically generate a thumbnail from your PDF files. This is desired but not required.
== Find out more ==
@ -91,7 +91,7 @@ If you have Imagick installed in your server, Tainacan will be able to automatic
4. Add items described by your metadata
5. Set up your item as a file, link or text and attach many types of documents
6. Browse your collections with a faceted search interface
7. Navigate through rich filtering interface
7. Navigate through the rich filtering interface
8. Explore more with Advanced Search
9. Set up Taxonomies to be used across your repository
10. Bulk edit as many items as you need quickly

View File

@ -5,17 +5,17 @@ Plugin URI: https://tainacan.org/
Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform.
Author: Tainacan.org
Author URI: https://tainacan.org/
Version: 0.20.5
Version: 0.20.6
Requires at least: 5.9
Tested up to: 6.4
Requires PHP: 7.0
Stable tag: 0.20.5
Stable tag: 0.20.6
Text Domain: tainacan
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
const TAINACAN_VERSION = '0.20.5';
const TAINACAN_VERSION = '0.20.6';
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
$TAINACAN_BASE_URL = plugins_url('', __FILE__);

View File

@ -264,7 +264,7 @@
this.selected.push(newSelected);
}
},
width: 'calc(100% - (4 * var(--tainacan-one-column)))',
width: 'max(768px, calc(100% - (4 * var(--tainacan-one-column))))',
trapFocus: true,
customClass: 'tainacan-modal',
closeButtonAriaLabel: this.$i18n.get('close')

View File

@ -263,7 +263,7 @@ class Compound extends Metadata_Type {
if ($meta instanceof Item_Metadata_Entity && !empty($meta->get_value_as_html())) {
ob_start();
?>
<div class="tainacan-metadatum metadata-type-<?php echo $meta->get_metadatum()->get_metadata_type_object()->get_slug() ?>">
<div class="tainacan-metadatum metadata-type-<?php echo $meta->get_metadatum()->get_metadata_type_object()->get_slug(); ?> metadata-slug-<?php echo $meta->get_metadatum()->get_slug(); ?>">
<h4 class="label">
<?php echo esc_html($meta->get_metadatum()->get_name()); ?>
</h4>

View File

@ -45,11 +45,10 @@
&nbsp;{{ $i18n.get('label_create_new_term') }}
</a>
</div>
<template v-if="allowNew && itemMetadatum.item">
<template v-if="allowNewFromOptions && itemMetadatum.item">
<!-- Term creation modal, used on admin for a complete term creation -->
<b-modal
v-model="isTermCreationModalOpen"
:active.sync="isTermCreationModalOpen"
:width="768"
trap-focus
aria-role="dialog"
@ -255,7 +254,7 @@
},
openTermCreationModal(newTerm) {
this.newTermName = newTerm.name;
if (this.isOnItemSubmissionForm)
this.isTermCreationPanelOpen = true;
else

View File

@ -9,6 +9,7 @@
v-for="(searchCriterion, index) in searchCriteria"
:key="index + '-' + searchCriterion.index + '-' + searchCriterion.type"
grouped
group-multiline
class="tainacan-form">
<!-- Metadata (Search criteria) -->
@ -97,7 +98,7 @@
</b-field>
<!-- Inputs -->
<b-field class="column is-half">
<b-field class="column is-half is-10-mobile">
<template v-if="searchCriterion.type == 'metaquery' && advancedSearchQuery.metaquery[searchCriterion.index]">
<b-input
v-if="getAdvancedSearchQueryCriterionMetadataType(searchCriterion.index) == 'int' || getAdvancedSearchQueryCriterionMetadataType(searchCriterion.index) == 'float'"
@ -646,52 +647,58 @@
border: 1px solid var(--tainacan-input-border-color);
border-radius: 1px;
transition: height 0.2s ease;
}
.tnc-advanced-search-container {
position: relative;
padding: 1.25em;
border-radius: var(--tainacan-dropdownmenu-border-radius, 0px);
.tnc-advanced-search-container {
position: relative;
padding: 1.25em;
border-radius: var(--tainacan-dropdownmenu-border-radius, 0px);
h3 {
font-size: 1em !important;
padding-top: 0 !important;
color: var(--tainacan-heading-color) !important;
margin-bottom: 1em !important;
}
.tainacan-form {
margin-bottom: 0.125em !important;
}
.column {
padding: 0;
}
.control {
font-size: 1em;
margin-bottom: 0px !important;
h3 {
font-size: 1em !important;
padding-top: 0 !important;
color: var(--tainacan-heading-color) !important;
margin-bottom: 1em !important;
}
.tainacan-form {
margin-bottom: 0.125em !important;
}
.column {
padding: 0;
}
.control {
font-size: 1em;
margin-bottom: 0px !important;
.select{
width: 100% !important;
select{
.select{
width: 100% !important;
select{
width: 100% !important;
}
}
}
}
.add-link-advanced-search a {
font-size: 0.8125em;
display: inline-flex;
align-items: center;
margin-right: 1em;
}
.add-link-advanced-search a {
font-size: 0.8125em;
display: inline-flex;
align-items: center;
margin-right: 1em;
}
.button-remove-criterion {
color: var(--tainacan-input-color);
background: transparent;
border: none;
border-radius: var(--tainacan-button-border-radius, 4px);
.button-remove-criterion {
color: var(--tainacan-input-color);
background: transparent;
border: none;
border-radius: var(--tainacan-button-border-radius, 4px);
}
}
@media screen and (max-width: 768px) {
border-left: none;
border-right: none;
.tnc-advanced-search-container {
padding-right: 0;
padding-left: 0;
}
.is-12>.columns {
flex-wrap: wrap;
}
@ -700,7 +707,6 @@
flex-basis: 100%;
}
}
}
</style>

View File

@ -794,7 +794,9 @@
if (newValue == false){
this.$eventBusSearch.$emit('closeAdvancedSearch');
this.futureSearchQuery = '';
this.isFiltersModalActive = true;
if ( !this.isMobileScreen )
this.isFiltersModalActive = !this.startWithFiltersHidden;
} else {
this.isFiltersModalActive = false;
}
@ -1308,10 +1310,13 @@
this.windowWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth);
this.isMobileScreen = this.windowWidth <= 768;
// The window size didn't changed (the resize event is triggered by scrolls on mobile)
// Also if we're on advanced search we should not open the filters
if (previousWindowWidth == this.windowWidth || this.openAdvancedSearch)
return;
if ( // We DO NOT want to open the filters due to this resize event IF:
(!previousMobileScreen && this.isMobileScreen) || // We're coming from a non-mobile screen to a mobile screen, or
(previousWindowWidth == this.windowWidth) || // The window size didn't changed (the resize event is triggered by scrolls on mobile), or
this.openAdvancedSearch // Advanced search is opened
!previousMobileScreen && this.isMobileScreen // We're coming from a non-mobile screen to a mobile screen
) {
this.isFiltersModalActive = false;
} else {
@ -1457,30 +1462,19 @@
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
cursor: pointer;
display: flex;
align-items: center;
transition: top 0.3s;
&:focus {
outline: none !important;
}
.icon {
margin-top: -1px;
}
@media screen and (max-width: 768px) {
max-width: 100%;
width: auto;
padding: 3px 6px 3px 0px;
height: 1.625em;
.icon {
position: relative;
top: -3px;
}
.text {
position: relative;
top: -2px;
}
}
}

View File

@ -4,6 +4,11 @@
@media screen and (max-width: 769px) {
justify-content: flex-end;
.tainacan-modal-content {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
}
}
.tainacan-modal .animation-content {

View File

@ -827,7 +827,9 @@
openAdvancedSearch(newValue){
if (newValue == false){
this.$eventBusSearch.$emit('closeAdvancedSearch');
this.isFiltersModalActive = !this.startWithFiltersHidden;
if ( !this.isMobileScreen )
this.isFiltersModalActive = !this.startWithFiltersHidden;
} else {
this.isFiltersModalActive = false;
}
@ -1425,15 +1427,18 @@
if (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) {
const previousMobileScreen = this.isMobileScreen;
const previousWindowWidth = this.windowWidth;
this.windowWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth);
this.isMobileScreen = this.windowWidth <= 768;
// The window size didn't changed (the resize event is triggered by scrolls on mobile)
// Also if we're on advanced search we should not open the filters
if (previousWindowWidth == this.windowWidth || this.openAdvancedSearch)
return;
if ( // We DO NOT want to open the filters due to this resize event IF:
(!previousMobileScreen && this.isMobileScreen) || // We're coming from a non-mobile screen to a mobile screen, or
(previousWindowWidth == this.windowWidth) || // The window size didn't changed (the resize event is triggered by scrolls on mobile), or
this.startWithFiltersHidden || // Filters should begin disabled, or
this.openAdvancedSearch // Advanced search is opened
this.startWithFiltersHidden // Filters should begin disabled
)
this.isFiltersModalActive = false;
else
@ -1525,29 +1530,18 @@
border-bottom-right-radius: 2px;
cursor: pointer;
transition: top 0.3s;
display: flex;
align-items: center;
&:focus {
outline: none !important;
}
.icon {
margin-top: -1px;
}
@media screen and (max-width: 768px) {
max-width: 100%;
width: auto;
padding: 3px 6px 3px 0px;
height: 1.625em;
.icon {
position: relative;
top: -3px;
}
.text {
position: relative;
top: -2px;
}
}
}