Merge branch 'develop' into feature/659

This commit is contained in:
mateuswetah 2022-01-28 17:33:10 -03:00
commit d68ffb56be
24 changed files with 87 additions and 35 deletions

View File

@ -133,6 +133,8 @@
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container a:hover {
color: inherit;
text-decoration: none; }
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide-duplicate img {
display: initial !important; }
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid a {
width: 100%;
display: block; }

File diff suppressed because one or more lines are too long

View File

@ -440,6 +440,8 @@
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-6, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-5, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-4, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-3, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-2, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-1 {
width: calc(100% - var(--spaceBetweenItems, 32px) );
min-width: calc(100% - var(--spaceBetweenItems, 32px) ); } }
.wp-block-tainacan-carousel-items-list .swiper-slide-duplicate img {
display: initial !important; }
.block-editor-block-list__block > .wp-block-tainacan-carousel-items-list {
max-width: calc(100% - 72px); }

File diff suppressed because one or more lines are too long

View File

@ -133,6 +133,8 @@
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container a:hover {
color: inherit;
text-decoration: none; }
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide-duplicate img {
display: initial !important; }
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid a {
width: 100%;
display: block; }

File diff suppressed because one or more lines are too long

View File

@ -884,7 +884,8 @@ a.pswp__share--download:hover {
align-items: center;
text-align: center;
padding: 44px;
margin-top: 22px; }
margin-top: 22px;
margin-bottom: 22px; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image > iframe:not(.wp-embedded-content) {
width: 90vw;
height: 90vh;
@ -903,6 +904,10 @@ a.pswp__share--download:hover {
background-image: url("../images/preloader.gif");
background-repeat: no-repeat;
background-position: center; }
.tainacan-photoswipe-layer .pswp__container .pswp__zoom-wrap {
display: flex;
justify-content: center;
align-items: center; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed {
width: 100%;
height: auto; }
@ -936,9 +941,12 @@ a.pswp__share--download:hover {
.tainacan-photoswipe-layer .pswp__container audio {
background: black;
min-height: 38px;
border-radius: 20px; }
border-radius: 20px;
min-width: 80%;
max-width: 80%; }
.tainacan-photoswipe-layer .pswp__container video {
min-height: 56px; }
min-height: 56px;
max-width: 80%; }
.tainacan-photoswipe-layer .pswp__top-bar .pswp__name {
color: white;
text-align: center;

File diff suppressed because one or more lines are too long

View File

@ -237,8 +237,8 @@ class REST_Controller extends \WP_REST_Controller {
} else {
foreach ( $query as $mapped_meta => $meta_v ) {
if(isset($request[$mapped][$meta_v])) {
$args[ $mapped_v ][ $meta_v ] = $request[ $mapped ][ $meta_v ];
if(isset($request[$mapped][$mapped_meta])) {
$args[ $mapped_v ][ $meta_v ] = $request[ $mapped ][ $mapped_meta ];
}
}
}

View File

@ -71,8 +71,8 @@ class Elastic_Press {
$array_must_nested = $el_must['bool']['must'];
for($j = 0; $j < count($array_must_nested); $j++ ) {
if ( isset ($array_must_nested[$j]['match_phrase'] ) ) {
$formatted_args['post_filter']['bool']['must'][$i]['bool']['must'][$j]['wildcard'] =
array_map( function($match) { return "*$match*"; } ,$array_must_nested[$j]['match_phrase']);
$formatted_args['post_filter']['bool']['must'][$i]['bool']['must'][$j]['match_phrase_prefix'] =
array_map( function($match) { return "$match"; } ,$array_must_nested[$j]['match_phrase']);
unset($formatted_args['post_filter']['bool']['must'][$i]['bool']['must'][$j]['match_phrase']);
}
}

View File

@ -143,7 +143,9 @@ class Embed {
$width = false;
$dom = new \DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML($html);
libxml_clear_errors();
// If we have a fixed aspect iframe, and it's a responsive embed content.
if ($dom) {

View File

@ -221,12 +221,13 @@ class Media {
function get_mime_content_type( $filename ){
if (function_exists( 'mime_content_type' )) {
return mime_content_type($filename);
} else {
} else if( function_exists( 'finfo_open' ) ) {
$finfo = finfo_open( FILEINFO_MIME_TYPE );
$mime_type = finfo_file( $finfo, $filename );
finfo_close( $finfo );
return $mime_type;
}
return '';
}
/**

View File

@ -353,7 +353,7 @@ class Items extends Repository {
$args = apply_filters( 'tainacan_fetch_args', $args, 'items' );
$should_filter = is_user_logged_in() && ! isset($args['post_status']) && sizeof($cpt) > 1;
$should_filter = is_user_logged_in() && sizeof($cpt) > 1;
if ( $should_filter ) {
add_filter('posts_where', [$this, '_filter_where'], 10, 2);
@ -407,6 +407,7 @@ class Items extends Repository {
global $wpdb;
$clauses = [];
$user_id = get_current_user_id();
$post_status = $wp_query->get( 'post_status' );
foreach ($this->fetching_from_collections as $collection) {
@ -415,24 +416,32 @@ class Items extends Repository {
$clause = '(';
$clause .= "{$wpdb->posts}.post_type = '{$collection->get_db_identifier()}' AND (";
$status_clause = [];
// public status
$public_states = get_post_stati( array( 'public' => true ) );
$status_clause = [];
foreach ( (array) $public_states as $state ) {
if( empty($post_status) || in_array($state, $post_status) )
$status_clause[] = "{$wpdb->posts}.post_status = '$state'";
}
$clause .= implode(' OR ', $status_clause);
// private statuses
$private_states = get_post_stati( array( 'private' => true ) );
foreach ( (array) $private_states as $state ) {
$clause .= current_user_can( $read_private_cap ) ? " OR {$wpdb->posts}.post_status = '$state'" : " OR {$wpdb->posts}.post_author = $user_id AND {$wpdb->posts}.post_status = '$state'";
if( empty($post_status) || in_array($state, $post_status) )
$status_clause[] = current_user_can( $read_private_cap ) ? " {$wpdb->posts}.post_status = '$state'" : " {$wpdb->posts}.post_author = $user_id AND {$wpdb->posts}.post_status = '$state'";
}
//draft
// $draft_states = get_post_stati( array( 'draft' => true ) );
$draft_states = ['draft'];
foreach ( $draft_states as $state ) {
if( !empty($post_status) && in_array($state, $post_status) )
$status_clause[] = current_user_can( $read_private_cap ) ? " {$wpdb->posts}.post_status = '$state'" : " {$wpdb->posts}.post_author = $user_id AND {$wpdb->posts}.post_status = '$state'";
}
$clause .= implode(' OR ', $status_clause);
$clause .= ')';
$clause .= ')';
$clauses[] = $clause;

View File

@ -2,9 +2,9 @@
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, vnmedeiros, tainacan, r-guimaraes, suelanesilva, ccaio, alanargomes, ateneagarcia123, rodrigo0freire, clarandreozzi
Tags: museums, libraries, archives, GLAM, collections, repository
Requires at least: 5.0
Tested up to: 5.8
Tested up to: 5.9
Requires PHP: 5.6
Stable tag: 0.18.7
Stable tag: 0.18.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

View File

@ -4,17 +4,17 @@ Plugin Name: Tainacan
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
Version: 0.18.7
Version: 0.18.8
Requires at least: 5.0
Tested up to: 5.8
Tested up to: 5.9
Requires PHP: 5.6
Stable tag: 0.18.7
Stable tag: 0.18.8
Text Domain: tainacan
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
const TAINACAN_VERSION = '0.18.7';
const TAINACAN_VERSION = '0.18.8';
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
$TAINACAN_BASE_URL = plugins_url('', __FILE__);

View File

@ -2046,6 +2046,7 @@ export default {
.document-field {
/deep/ iframe {
max-width: 100%;
max-height: 100%;
}
.document-buttons-row {
text-align: right;

View File

@ -44,7 +44,7 @@
<b-button
class="button is-secondary"
tag="router-link"
:to="$routerHelper.getCollectionItemsPath(collectionId, { metaquery: [{ key: relatedItemGroup.metadata_id, value: itemId, compare: 'IN' }] })">
:to="$routerHelper.getCollectionItemsPath(relatedItemGroup.collection_id, { metaquery: [{ key: relatedItemGroup.metadata_id, value: [itemId], compare: 'IN' }] })">
{{ $i18n.getWithVariables('label_view_all_%s_related_items', [relatedItemGroup.total_items]) }}
</b-button>
</div>

View File

@ -743,6 +743,7 @@
.document-field {
/deep/ iframe {
max-width: 100%;
max-height: 100%;
}
.document-buttons-row {
text-align: right;

View File

@ -157,6 +157,10 @@
text-decoration: none;
}
.swiper-slide-duplicate img {
display: initial !important;
}
.swiper-slide.collection-list-item-grid {
a {

View File

@ -586,6 +586,9 @@
}
}
}
.swiper-slide-duplicate img {
display: initial !important;
}
}
.block-editor-block-list__block>.wp-block-tainacan-carousel-items-list {
max-width: calc(100% - 72px);

View File

@ -157,6 +157,10 @@
text-decoration: none;
}
.swiper-slide-duplicate img {
display: initial !important;
}
.swiper-slide.term-list-item-grid {
a {

View File

@ -35,11 +35,13 @@ export default function({ attributes, setAttributes, className, isSelected }) {
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<Button
<button
onClick={ () => removeCollectionOfId(collection.id) }
icon="no-alt"
showTooltip={false}
label={__('Remove', 'tainacan')} />
type="button"
class="components-button has-icon"
aria-label={__('Remove', 'tainacan')}>
<span class="dashicon dashicons dashicons-no-alt" />
</button>
}
<a
id={ isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id }

View File

@ -375,6 +375,7 @@ $pswp__include-minimal-style: true !default;
text-align: center;
padding: 44px;
margin-top: 22px;
margin-bottom: 22px;
&>iframe:not(.wp-embedded-content) {
width: 90vw;
@ -398,6 +399,11 @@ $pswp__include-minimal-style: true !default;
background-repeat: no-repeat;
background-position: center;
}
.pswp__zoom-wrap {
display: flex;
justify-content: center;
align-items: center;
}
.tainacan-content-embed {
width: 100%;
@ -443,9 +449,12 @@ $pswp__include-minimal-style: true !default;
background: black;
min-height: 38px;
border-radius: 20px;
min-width: 80%;
max-width: 80%;
}
video {
min-height: 56px;
max-width: 80%;
}
}
.pswp__top-bar .pswp__name {

View File

@ -33,11 +33,13 @@ export default function({ attributes, setAttributes, className, isSelected }){
icon="no-alt"
label={__('Remove', 'tainacan')}/>
:
<Button
<button
onClick={ () => removeTermOfId(term.id) }
icon="no-alt"
showTooltip={false}
label={__('Remove', 'tainacan')}/>
type="button"
class="components-button has-icon"
aria-label={__('Remove', 'tainacan')}>
<span class="dashicon dashicons dashicons-no-alt" />
</button>
}
<a
id={ isNaN(term.id) ? term.id : 'term-id-' + term.id }