spelling and terminology fixes
This commit is contained in:
parent
1fdb4f6c5a
commit
a7c6c185ee
|
@ -552,7 +552,7 @@ class Roles {
|
|||
|
||||
if( in_array($requested_cap, [
|
||||
$this->meta_caps->read_private_posts,
|
||||
$this->filters_caps->read_private_posts]
|
||||
$this->filters_caps->read_private_posts]
|
||||
) && (
|
||||
$user->has_cap('manage_tainacan') ||
|
||||
$user->has_cap('manage_tainacan_collection_all')
|
||||
|
@ -575,8 +575,8 @@ class Roles {
|
|||
|
||||
$check_all_collections_cap = false;
|
||||
$has_all_collections_cap = false;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* We are only interested in checks for a specific collection.
|
||||
* $args[2] will be set if this came from a meta cap of a specific collection ( e.g. current_user_can('tnc_rep_edit_collection', 3) ).
|
||||
|
@ -584,7 +584,7 @@ class Roles {
|
|||
if ( isset( $args[2] ) && is_numeric( $args[2] ) ) {
|
||||
$col_id = $args[2];
|
||||
/**
|
||||
* Or we extract the collectino id from the capability itself. Example: tnc_col_3_delete_items
|
||||
* Or we extract the collection id from the capability itself. Example: tnc_col_3_delete_items
|
||||
*/
|
||||
} else {
|
||||
$col_id = preg_replace('/[a-z_]+(\d+)[a-z_]+?$/', '$1', $cap );
|
||||
|
@ -598,7 +598,7 @@ class Roles {
|
|||
continue;
|
||||
}
|
||||
|
||||
// In case of a tnc_col_* capability check,
|
||||
// In case of a tnc_col_* capability check,
|
||||
// Let's see if the user has the respective tnc_col_all_* capability
|
||||
if ( $check_all_collections_cap ) {
|
||||
$all_collections_cap = preg_replace('/([a-z_]+)(\d+)([a-z_]+?)$/', '${1}all${3}', $cap );
|
||||
|
|
|
@ -241,7 +241,7 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
return false;
|
||||
}
|
||||
|
||||
$this->add_log( sprintf( __('Bulk edit has process the item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
$this->add_log( sprintf( __('Bulk edit has processed the item ID: "%d"', 'tainacan'), $item->get_id() ) );
|
||||
$add_steps = $this->$method($item);
|
||||
if ( is_int($add_steps) ) {
|
||||
$count = $count + $add_steps;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
({{ itemMetadatum.metadatum.metadata_type_object.name }})
|
||||
</span>
|
||||
<help-button
|
||||
v-if="!$parent.hideHelpButtons && !$parent.helpInfoBellowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description"
|
||||
v-if="!$parent.hideHelpButtons && !$parent.helpInfoBelowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description"
|
||||
:title="itemMetadatum.metadatum.name"
|
||||
:message="itemMetadatum.metadatum.description"/>
|
||||
</span>
|
||||
|
@ -43,7 +43,7 @@
|
|||
v-if="isTextInputComponent">
|
||||
<p
|
||||
class="metadatum-description-help-info"
|
||||
v-if="!$parent.hideHelpButtons && $parent.helpInfoBellowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description">
|
||||
v-if="!$parent.hideHelpButtons && $parent.helpInfoBelowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description">
|
||||
{{ itemMetadatum.metadatum.description }}
|
||||
</p>
|
||||
<component
|
||||
|
@ -99,7 +99,7 @@
|
|||
v-if="!isTextInputComponent">
|
||||
<p
|
||||
class="metadatum-description-help-info"
|
||||
v-if="!$parent.hideHelpButtons && $parent.helpInfoBellowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description">
|
||||
v-if="!$parent.hideHelpButtons && $parent.helpInfoBelowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description">
|
||||
{{ itemMetadatum.metadatum.description }}
|
||||
</p>
|
||||
<component
|
||||
|
|
|
@ -14,8 +14,8 @@ import 'swiper/css/swiper.min.css';
|
|||
|
||||
export default function ({ attributes, setAttributes, className, isSelected, clientId }) {
|
||||
let {
|
||||
collections,
|
||||
content,
|
||||
collections,
|
||||
content,
|
||||
isModalOpen,
|
||||
itemsRequestSource,
|
||||
selectedCollections,
|
||||
|
@ -36,7 +36,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
|
||||
// Gets blocks props from hook
|
||||
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
|
||||
|
||||
|
||||
// Obtains block's client id to render it on save function
|
||||
setAttributes({ blockId: clientId });
|
||||
|
||||
|
@ -45,18 +45,18 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
maxCollectionsPerScreen = 6;
|
||||
setAttributes({ maxCollectionsPerScreen: maxCollectionsPerScreen });
|
||||
}
|
||||
if (cropImagesToSquare === undefined) {
|
||||
cropImagesToSquare = true;
|
||||
if (cropImagesToSquare === undefined) {
|
||||
cropImagesToSquare = true;
|
||||
setAttributes({ cropImagesToSquare: cropImagesToSquare });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const thumbHelper = ThumbnailHelperFunctions();
|
||||
|
||||
function prepareItem(collection, collectionItems) {
|
||||
return (
|
||||
<li
|
||||
<li
|
||||
key={ collection.id }
|
||||
className={ 'collection-list-item ' + (!showCollectionThumbnail ? 'collection-list-item-grid ' : '') + (maxCollectionsPerScreen ? ' max-collections-per-screen-' + maxCollectionsPerScreen : '') }>
|
||||
className={ 'collection-list-item ' + (!showCollectionThumbnail ? 'collection-list-item-grid ' : '') + (maxCollectionsPerScreen ? ' max-collections-per-screen-' + maxCollectionsPerScreen : '') }>
|
||||
{ tainacan_blocks.wp_version < '5.4' ?
|
||||
<IconButton
|
||||
onClick={ () => removeItemOfId(collection.id) }
|
||||
|
@ -68,35 +68,35 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
icon="no-alt"
|
||||
label={__('Remove', 'tainacan')}/>
|
||||
}
|
||||
<a
|
||||
<a
|
||||
id={ isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id }
|
||||
href={ collection.url }>
|
||||
{ !showCollectionThumbnail ?
|
||||
{ !showCollectionThumbnail ?
|
||||
<div class="collection-items-grid">
|
||||
<img
|
||||
<img
|
||||
src={ collectionItems[0] ? thumbHelper.getSrc(collectionItems[0]['thumbnail'], 'tainacan-medium', collectionItems[0]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
srcSet={ collectionItems[0] ? thumbHelper.getSrcSet(collectionItems[0]['thumbnail'], 'tainacan-medium', collectionItems[0]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
alt={ collectionItems[0] && collectionItems[0].thumbnail_alt ? collectionItems[0].thumbnail_alt : (collectionItems[0] && collectionItems[0].name ? collectionItems[0].name : __( 'Thumbnail', 'tainacan' )) } />
|
||||
<img
|
||||
<img
|
||||
src={ collectionItems[1] ? thumbHelper.getSrc(collectionItems[1]['thumbnail'], 'tainacan-medium', collectionItems[1]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
srcSet={ collectionItems[1] ? thumbHelper.getSrcSet(collectionItems[1]['thumbnail'], 'tainacan-medium', collectionItems[1]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
alt={ collectionItems[1] && collectionItems[1].thumbnail_alt ? collectionItems[1].thumbnail_alt : (collectionItems[1] && collectionItems[1].name ? collectionItems[1].name : __( 'Thumbnail', 'tainacan' )) } />
|
||||
<img
|
||||
<img
|
||||
src={ collectionItems[2] ? thumbHelper.getSrc(collectionItems[2]['thumbnail'], 'tainacan-medium', collectionItems[2]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
srcSet={ collectionItems[2] ? thumbHelper.getSrcSet(collectionItems[2]['thumbnail'], 'tainacan-medium', collectionItems[2]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
alt={ collectionItems[2] && collectionItems[2].thumbnail_alt ? collectionItems[2].thumbnail_alt : (collectionItems[2] && collectionItems[2].name ? collectionItems[2].name : __( 'Thumbnail', 'tainacan' )) } />
|
||||
</div>
|
||||
:
|
||||
<img
|
||||
src={
|
||||
collection.thumbnail && collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0] && collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0]
|
||||
src={
|
||||
collection.thumbnail && collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0] && collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0]
|
||||
?
|
||||
collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0]
|
||||
collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0]
|
||||
:
|
||||
(collection.thumbnail && collection.thumbnail['thumbnail'][0] && collection.thumbnail['thumbnail'][0]
|
||||
?
|
||||
collection.thumbnail['thumbnail'][0]
|
||||
:
|
||||
?
|
||||
collection.thumbnail['thumbnail'][0]
|
||||
:
|
||||
`${tainacan_blocks.base_url}/assets/images/placeholder_square.png`)
|
||||
}
|
||||
alt={ collection.name ? collection.name : __( 'Thumbnail', 'tainacan' ) }/>
|
||||
|
@ -126,7 +126,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
.then(response => {
|
||||
|
||||
if (showCollectionThumbnail) {
|
||||
for (let collection of response.data) {
|
||||
for (let collection of response.data) {
|
||||
collections.push(prepareItem(collection));
|
||||
}
|
||||
setAttributes({
|
||||
|
@ -137,12 +137,12 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
});
|
||||
} else {
|
||||
let promises = [];
|
||||
for (let collection of response.data) {
|
||||
for (let collection of response.data) {
|
||||
promises.push(
|
||||
tainacan.get('/collection/' + collection.id + '/items?perpage=3&fetch_only=name,url,thumbnail')
|
||||
.then(response => { return({ collection: collection, collectionItems: response.data.items }) })
|
||||
.catch((error) => console.log(error))
|
||||
);
|
||||
);
|
||||
}
|
||||
axios.all(promises).then((results) => {
|
||||
for (let result of results) {
|
||||
|
@ -154,14 +154,14 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
isLoading: false,
|
||||
itemsRequestSource: itemsRequestSource
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openCarouselModal() {
|
||||
isModalOpen = true;
|
||||
setAttributes( {
|
||||
setAttributes( {
|
||||
isModalOpen: isModalOpen
|
||||
} );
|
||||
}
|
||||
|
@ -175,11 +175,11 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
let existingSelectedItemIndex = selectedCollections.findIndex((existingSelectedItem) => existingSelectedItem.id == itemId);
|
||||
if (existingSelectedItemIndex >= 0)
|
||||
selectedCollections.splice(existingSelectedItemIndex, 1);
|
||||
|
||||
setAttributes({
|
||||
|
||||
setAttributes({
|
||||
selectedCollections: selectedCollections,
|
||||
collections: collections,
|
||||
content: <div></div>
|
||||
content: <div></div>
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
if(content && content.length && content[0].type)
|
||||
setContent();
|
||||
|
||||
return content == 'preview' ?
|
||||
return content == 'preview' ?
|
||||
<div className={className}>
|
||||
<img
|
||||
width="100%"
|
||||
|
@ -198,7 +198,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
|
||||
{ collections.length ?
|
||||
<BlockControls>
|
||||
{
|
||||
{
|
||||
TainacanBlocksCompatToolbar({
|
||||
label: __('Add more collections', 'tainacan'),
|
||||
icon: <svg
|
||||
|
@ -229,7 +229,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
onClick={ () => {
|
||||
showCollectionThumbnail = false;
|
||||
setAttributes({ showCollectionThumbnail: showCollectionThumbnail });
|
||||
setContent();
|
||||
setContent();
|
||||
}
|
||||
}
|
||||
className={'collection-carousel-view-mode-grid' + (showCollectionThumbnail ? '' : ' is-active')}>
|
||||
|
@ -244,13 +244,13 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
onClick={ () => {
|
||||
showCollectionThumbnail = true;
|
||||
setAttributes({ showCollectionThumbnail: showCollectionThumbnail });
|
||||
setContent();
|
||||
setContent();
|
||||
}
|
||||
}
|
||||
className={'collection-carousel-view-mode-thumbnail' + (showCollectionThumbnail ? ' is-active' : '')}>
|
||||
<div />
|
||||
<label>{ __('Thumbnail', 'tainacan') }</label>
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
</BaseControl>
|
||||
<RangeControl
|
||||
|
@ -260,12 +260,12 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
onChange={ ( aMaxCollectionsPerScreen ) => {
|
||||
maxCollectionsPerScreen = aMaxCollectionsPerScreen;
|
||||
setAttributes( { maxCollectionsPerScreen: aMaxCollectionsPerScreen } );
|
||||
setContent();
|
||||
setContent();
|
||||
}}
|
||||
min={ 1 }
|
||||
max={ 9 }
|
||||
/>
|
||||
{ showCollectionThumbnail ?
|
||||
{ showCollectionThumbnail ?
|
||||
<ToggleControl
|
||||
label={__('Crop Images', 'tainacan')}
|
||||
help={ cropImagesToSquare && maxCollectionsPerScreen > 4 ? __('Do not use square cropeed version of the collection thumbnail.', 'tainacan') : __('Toggle to use square cropped version of the collection thumbnail.', 'tainacan') }
|
||||
|
@ -274,7 +274,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
cropImagesToSquare = isChecked;
|
||||
setAttributes({ cropImagesToSquare: cropImagesToSquare });
|
||||
setContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
: null }
|
||||
|
@ -296,7 +296,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
hideName = isChecked;
|
||||
setAttributes({ hideName: hideName });
|
||||
setContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
<ToggleControl
|
||||
|
@ -306,7 +306,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
onChange={ ( isChecked ) => {
|
||||
loopSlides = isChecked;
|
||||
setAttributes({ loopSlides: loopSlides });
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
<ToggleControl
|
||||
|
@ -316,17 +316,17 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
onChange={ ( isChecked ) => {
|
||||
autoPlay = isChecked;
|
||||
setAttributes({ autoPlay: autoPlay });
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
{
|
||||
autoPlay ?
|
||||
{
|
||||
autoPlay ?
|
||||
<RangeControl
|
||||
label={__('Seconds before translating to next', 'tainacan')}
|
||||
label={__('Seconds before transitioning to next', 'tainacan')}
|
||||
value={ autoPlaySpeed ? autoPlaySpeed : 3 }
|
||||
onChange={ ( aAutoPlaySpeed ) => {
|
||||
autoPlaySpeed = aAutoPlaySpeed;
|
||||
setAttributes( { autoPlaySpeed: aAutoPlaySpeed } )
|
||||
setAttributes( { autoPlaySpeed: aAutoPlaySpeed } )
|
||||
}}
|
||||
min={ 1 }
|
||||
max={ 5 }
|
||||
|
@ -341,9 +341,9 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
{ label: __('Left', 'tainacan'), value: 'left' },
|
||||
{ label: __('Right', 'tainacan'), value: 'right' }
|
||||
] }
|
||||
onChange={ ( aPosition ) => {
|
||||
onChange={ ( aPosition ) => {
|
||||
arrowsPosition = aPosition;
|
||||
setAttributes({ arrowsPosition: arrowsPosition });
|
||||
setAttributes({ arrowsPosition: arrowsPosition });
|
||||
}}/>
|
||||
<SelectControl
|
||||
label={__('Arrows icon style', 'tainacan')}
|
||||
|
@ -352,9 +352,9 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
{ label: __('Default', 'tainacan'), value: 'type-1' },
|
||||
{ label: __('Alternative', 'tainacan'), value: 'type-2' }
|
||||
] }
|
||||
onChange={ ( aStyle ) => {
|
||||
onChange={ ( aStyle ) => {
|
||||
arrowsStyle = aStyle;
|
||||
setAttributes({ arrowsStyle: arrowsStyle });
|
||||
setAttributes({ arrowsStyle: arrowsStyle });
|
||||
}}/>
|
||||
<ToggleControl
|
||||
label={__('Large arrows', 'tainacan')}
|
||||
|
@ -363,7 +363,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
onChange={ ( isChecked ) => {
|
||||
largeArrows = isChecked;
|
||||
setAttributes({ largeArrows: largeArrows });
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
<RangeControl
|
||||
|
@ -380,24 +380,24 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
</InspectorControls>
|
||||
</div>
|
||||
|
||||
{ isSelected ?
|
||||
{ isSelected ?
|
||||
(
|
||||
<div>
|
||||
{ isModalOpen ?
|
||||
{ isModalOpen ?
|
||||
<CarouselCollectionsModal
|
||||
selectedCollectionsObject={ selectedCollections }
|
||||
onApplySelection={ (aSelectionOfCollections) => {
|
||||
selectedCollections = aSelectionOfCollections;
|
||||
selectedCollections = aSelectionOfCollections;
|
||||
setAttributes({
|
||||
selectedCollections: aSelectionOfCollections,
|
||||
isModalOpen: false
|
||||
});
|
||||
setContent();
|
||||
}}
|
||||
onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/>
|
||||
onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/>
|
||||
: null
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
|
@ -426,29 +426,29 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
type="button"
|
||||
onClick={ () => openCarouselModal() }>
|
||||
{__('Select Collections', 'tainacan')}
|
||||
</Button>
|
||||
</Button>
|
||||
</Placeholder>
|
||||
) : null
|
||||
}
|
||||
|
||||
{ isLoading ?
|
||||
|
||||
{ isLoading ?
|
||||
<div class="spinner-container">
|
||||
<Spinner />
|
||||
</div> :
|
||||
<div>
|
||||
{ isSelected && collections.length ?
|
||||
{ isSelected && collections.length ?
|
||||
<div class="preview-warning">{__('Warning: this is just a demonstration. To see the carousel in action, either preview or publish your post.', 'tainacan')}</div>
|
||||
: null
|
||||
}
|
||||
{ collections.length ? (
|
||||
{ collections.length ? (
|
||||
<div
|
||||
className={'collections-list-edit-container ' + (arrowsPosition ? 'has-arrows-' + arrowsPosition : '') + (largeArrows ? ' has-large-arrows' : '') }
|
||||
style={{
|
||||
'--spaceBetweenCollections': !isNaN(spaceBetweenCollections) ? (spaceBetweenCollections + 'px') : '32px',
|
||||
'--spaceAroundCarousel': !isNaN(spaceAroundCarousel) ? (spaceAroundCarousel + 'px') : '50px'
|
||||
}}>
|
||||
<button
|
||||
class="swiper-button-prev"
|
||||
<button
|
||||
class="swiper-button-prev"
|
||||
slot="button-prev"
|
||||
style={{ cursor: 'not-allowed' }}>
|
||||
<svg
|
||||
|
@ -469,8 +469,8 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
<ul className={'collections-list-edit'}>
|
||||
{ collections }
|
||||
</ul>
|
||||
<button
|
||||
class="swiper-button-next"
|
||||
<button
|
||||
class="swiper-button-next"
|
||||
slot="button-next"
|
||||
style={{ cursor: 'not-allowed' }}>
|
||||
<svg
|
||||
|
@ -495,4 +495,4 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -14,8 +14,8 @@ import 'swiper/css/swiper.min.css';
|
|||
|
||||
export default function({ attributes, setAttributes, className, isSelected, clientId }){
|
||||
let {
|
||||
terms,
|
||||
content,
|
||||
terms,
|
||||
content,
|
||||
isModalOpen,
|
||||
itemsRequestSource,
|
||||
selectedTerms,
|
||||
|
@ -39,7 +39,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
|
||||
// Obtains block's client id to render it on save function
|
||||
setAttributes({ blockId: clientId });
|
||||
|
||||
|
||||
// Sets some defaults that were not working
|
||||
if (maxTermsPerScreen === undefined) {
|
||||
maxTermsPerScreen = 6;
|
||||
|
@ -50,9 +50,9 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
|
||||
function prepareItem(term, termItems) {
|
||||
return (
|
||||
<li
|
||||
<li
|
||||
key={ term.id }
|
||||
className={ 'term-list-item ' + (!showTermThumbnail ? 'term-list-item-grid ' : '') + (maxTermsPerScreen ? ' max-terms-per-screen-' + maxTermsPerScreen : '') }>
|
||||
className={ 'term-list-item ' + (!showTermThumbnail ? 'term-list-item-grid ' : '') + (maxTermsPerScreen ? ' max-terms-per-screen-' + maxTermsPerScreen : '') }>
|
||||
{ tainacan_blocks.wp_version < '5.4' ?
|
||||
<IconButton
|
||||
onClick={ () => removeItemOfId(term.id) }
|
||||
|
@ -64,20 +64,20 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
icon="no-alt"
|
||||
label={__('Remove', 'tainacan')}/>
|
||||
}
|
||||
<a
|
||||
<a
|
||||
id={ isNaN(term.id) ? term.id : 'term-id-' + term.id }
|
||||
href={ term.url }>
|
||||
{ !showTermThumbnail ?
|
||||
{ !showTermThumbnail ?
|
||||
<div class="term-items-grid">
|
||||
<img
|
||||
<img
|
||||
src={ termItems[0] ? thumbHelper.getSrc(termItems[0]['thumbnail'], 'tainacan-medium', termItems[0]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
srcSet={ termItems[0] ? thumbHelper.getSrcSet(termItems[0]['thumbnail'], 'tainacan-medium', termItems[0]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
alt={ termItems[0] && termItems[0].thumbnail_alt ? termItems[0].thumbnail_alt : (termItems[0] && termItems[0].name ? termItems[0].name : __( 'Thumbnail', 'tainacan' )) } />
|
||||
<img
|
||||
<img
|
||||
src={ termItems[1] ? thumbHelper.getSrc(termItems[1]['thumbnail'], 'tainacan-medium', termItems[1]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
srcSet={ termItems[1] ? thumbHelper.getSrcSet(termItems[1]['thumbnail'], 'tainacan-medium', termItems[1]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
alt={ termItems[1] && termItems[1].thumbnail_alt ? termItems[1].thumbnail_alt : (termItems[1] && termItems[1].name ? termItems[1].name : __( 'Thumbnail', 'tainacan' )) } />
|
||||
<img
|
||||
<img
|
||||
src={ termItems[2] ? thumbHelper.getSrc(termItems[2]['thumbnail'], 'tainacan-medium', termItems[2]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
srcSet={ termItems[2] ? thumbHelper.getSrcSet(termItems[2]['thumbnail'], 'tainacan-medium', termItems[2]['document_mimetype']) :`${tainacan_blocks.base_url}/assets/images/placeholder_square.png` }
|
||||
alt={ termItems[2] && termItems[2].thumbnail_alt ? termItems[2].thumbnail_alt : (termItems[2] && termItems[2].name ? termItems[2].name : __( 'Thumbnail', 'tainacan' )) } />
|
||||
|
@ -112,7 +112,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
.then(response => {
|
||||
|
||||
if (showTermThumbnail) {
|
||||
for (let term of response.data) {
|
||||
for (let term of response.data) {
|
||||
terms.push(prepareItem(term));
|
||||
}
|
||||
setAttributes({
|
||||
|
@ -123,12 +123,12 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
});
|
||||
} else {
|
||||
let promises = [];
|
||||
for (let term of response.data) {
|
||||
for (let term of response.data) {
|
||||
promises.push(
|
||||
tainacan.get('/items/?perpage=3&fetch_only=name,url,thumbnail&taxquery[0][taxonomy]=tnc_tax_' + taxonomyId + '&taxquery[0][terms][0]=' + term.id + '&taxquery[0][compare]=IN')
|
||||
.then(response => { return({ term: term, termItems: response.data.items }) })
|
||||
.catch((error) => console.log(error))
|
||||
);
|
||||
);
|
||||
}
|
||||
axios.all(promises).then((results) => {
|
||||
for (let result of results) {
|
||||
|
@ -140,14 +140,14 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
isLoading: false,
|
||||
itemsRequestSource: itemsRequestSource
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openCarouselModal() {
|
||||
isModalOpen = true;
|
||||
setAttributes( {
|
||||
setAttributes( {
|
||||
isModalOpen: isModalOpen
|
||||
} );
|
||||
}
|
||||
|
@ -161,11 +161,11 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
let existingSelectedItemIndex = selectedTerms.findIndex((existingSelectedItem) => existingSelectedItem.id == itemId);
|
||||
if (existingSelectedItemIndex >= 0)
|
||||
selectedTerms.splice(existingSelectedItemIndex, 1);
|
||||
|
||||
setAttributes({
|
||||
|
||||
setAttributes({
|
||||
selectedTerms: selectedTerms,
|
||||
terms: terms,
|
||||
content: <div></div>
|
||||
content: <div></div>
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
if(content && content.length && content[0].type)
|
||||
setContent();
|
||||
|
||||
return content == 'preview' ?
|
||||
return content == 'preview' ?
|
||||
<div className={className}>
|
||||
<img
|
||||
width="100%"
|
||||
|
@ -215,7 +215,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
onClick={ () => {
|
||||
showTermThumbnail = false;
|
||||
setAttributes({ showTermThumbnail: showTermThumbnail });
|
||||
setContent();
|
||||
setContent();
|
||||
}
|
||||
}
|
||||
className={'term-carousel-view-mode-grid' + (showTermThumbnail ? '' : ' is-active')}>
|
||||
|
@ -230,13 +230,13 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
onClick={ () => {
|
||||
showTermThumbnail = true;
|
||||
setAttributes({ showTermThumbnail: showTermThumbnail });
|
||||
setContent();
|
||||
setContent();
|
||||
}
|
||||
}
|
||||
className={'term-carousel-view-mode-thumbnail' + (showTermThumbnail ? ' is-active' : '')}>
|
||||
<div />
|
||||
<label>{ __('Thumbnail', 'tainacan') }</label>
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
</BaseControl>
|
||||
<RangeControl
|
||||
|
@ -246,7 +246,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
onChange={ ( aMaxTermsPerScreen ) => {
|
||||
maxTermsPerScreen = aMaxTermsPerScreen;
|
||||
setAttributes( { maxTermsPerScreen: aMaxTermsPerScreen } );
|
||||
setContent();
|
||||
setContent();
|
||||
}}
|
||||
min={ 1 }
|
||||
max={ 9 }
|
||||
|
@ -269,7 +269,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
hideName = isChecked;
|
||||
setAttributes({ hideName: hideName });
|
||||
setContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
<ToggleControl
|
||||
|
@ -279,7 +279,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
onChange={ ( isChecked ) => {
|
||||
loopSlides = isChecked;
|
||||
setAttributes({ loopSlides: loopSlides });
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
<ToggleControl
|
||||
|
@ -289,17 +289,17 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
onChange={ ( isChecked ) => {
|
||||
autoPlay = isChecked;
|
||||
setAttributes({ autoPlay: autoPlay });
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
{
|
||||
autoPlay ?
|
||||
{
|
||||
autoPlay ?
|
||||
<RangeControl
|
||||
label={__('Seconds before translating to next', 'tainacan')}
|
||||
label={__('Seconds before transitioning to next', 'tainacan')}
|
||||
value={ autoPlaySpeed ? autoPlaySpeed : 3 }
|
||||
onChange={ ( aAutoPlaySpeed ) => {
|
||||
autoPlaySpeed = aAutoPlaySpeed;
|
||||
setAttributes( { autoPlaySpeed: aAutoPlaySpeed } )
|
||||
setAttributes( { autoPlaySpeed: aAutoPlaySpeed } )
|
||||
}}
|
||||
min={ 1 }
|
||||
max={ 5 }
|
||||
|
@ -314,10 +314,10 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
{ label: __('Left', 'tainacan'), value: 'left' },
|
||||
{ label: __('Right', 'tainacan'), value: 'right' }
|
||||
] }
|
||||
onChange={ ( aPosition ) => {
|
||||
onChange={ ( aPosition ) => {
|
||||
arrowsPosition = aPosition;
|
||||
|
||||
setAttributes({ arrowsPosition: arrowsPosition });
|
||||
setAttributes({ arrowsPosition: arrowsPosition });
|
||||
}}/>
|
||||
<SelectControl
|
||||
label={__('Arrows icon style', 'tainacan')}
|
||||
|
@ -326,9 +326,9 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
{ label: __('Default', 'tainacan'), value: 'type-1' },
|
||||
{ label: __('Alternative', 'tainacan'), value: 'type-2' }
|
||||
] }
|
||||
onChange={ ( aStyle ) => {
|
||||
onChange={ ( aStyle ) => {
|
||||
arrowsStyle = aStyle;
|
||||
setAttributes({ arrowsStyle: arrowsStyle });
|
||||
setAttributes({ arrowsStyle: arrowsStyle });
|
||||
}}/>
|
||||
<ToggleControl
|
||||
label={__('Large arrows', 'tainacan')}
|
||||
|
@ -337,7 +337,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
onChange={ ( isChecked ) => {
|
||||
largeArrows = isChecked;
|
||||
setAttributes({ largeArrows: largeArrows });
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
<RangeControl
|
||||
|
@ -354,31 +354,31 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
</InspectorControls>
|
||||
</div>
|
||||
|
||||
{ isSelected ?
|
||||
{ isSelected ?
|
||||
(
|
||||
<div>
|
||||
{ isModalOpen ?
|
||||
{ isModalOpen ?
|
||||
<TermsModal
|
||||
replaceTermId={ false } // The Terms modal adds `term-id-` string to terms ids. Here we dont' need it
|
||||
existingTaxonomyId={ taxonomyId }
|
||||
selectedTermsObject={ selectedTerms }
|
||||
existingTaxonomyId={ taxonomyId }
|
||||
selectedTermsObject={ selectedTerms }
|
||||
onSelectTaxonomy={ (selectedTaxonomyId) => {
|
||||
taxonomyId = selectedTaxonomyId;
|
||||
setAttributes({ taxonomyId: taxonomyId });
|
||||
}}
|
||||
onApplySelection={ (aSelectionOfTerms) =>{
|
||||
selectedTerms = aSelectionOfTerms;
|
||||
|
||||
|
||||
setAttributes({
|
||||
selectedTerms: selectedTerms,
|
||||
isModalOpen: false
|
||||
});
|
||||
setContent();
|
||||
}}
|
||||
onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/>
|
||||
onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/>
|
||||
: null
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
|
@ -407,29 +407,29 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
type="button"
|
||||
onClick={ () => openCarouselModal() }>
|
||||
{__('Select Terms', 'tainacan')}
|
||||
</Button>
|
||||
</Button>
|
||||
</Placeholder>
|
||||
) : null
|
||||
}
|
||||
|
||||
{ isLoading ?
|
||||
|
||||
{ isLoading ?
|
||||
<div class="spinner-container">
|
||||
<Spinner />
|
||||
</div> :
|
||||
<div>
|
||||
{ isSelected && terms.length ?
|
||||
{ isSelected && terms.length ?
|
||||
<div class="preview-warning">{__('Warning: this is just a demonstration. To see the carousel in action, either preview or publish your post.', 'tainacan')}</div>
|
||||
: null
|
||||
}
|
||||
{ terms.length ? (
|
||||
{ terms.length ? (
|
||||
<div
|
||||
className={'terms-list-edit-container ' + (arrowsPosition ? 'has-arrows-' + arrowsPosition : '') + (largeArrows ? ' has-large-arrows' : '') }
|
||||
style={{
|
||||
'--spaceBetweenTerms': !isNaN(spaceBetweenTerms) ? (spaceBetweenTerms + 'px') : '32px',
|
||||
'--spaceAroundCarousel': !isNaN(spaceAroundCarousel) ? (spaceAroundCarousel + 'px') : '50px'
|
||||
}}>
|
||||
<button
|
||||
class="swiper-button-prev"
|
||||
<button
|
||||
class="swiper-button-prev"
|
||||
slot="button-prev"
|
||||
style={{ cursor: 'not-allowed' }}>
|
||||
<svg
|
||||
|
@ -444,14 +444,14 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
}
|
||||
<path
|
||||
d="M0 0h24v24H0z"
|
||||
fill="none"/>
|
||||
fill="none"/>
|
||||
</svg>
|
||||
</button>
|
||||
<ul className={'terms-list-edit'}>
|
||||
{ terms }
|
||||
</ul>
|
||||
<button
|
||||
class="swiper-button-next"
|
||||
<button
|
||||
class="swiper-button-next"
|
||||
slot="button-next"
|
||||
style={{ cursor: 'not-allowed' }}>
|
||||
<svg
|
||||
|
@ -466,7 +466,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
}
|
||||
<path
|
||||
d="M0 0h24v24H0z"
|
||||
fill="none"/>
|
||||
fill="none"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -476,4 +476,4 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
"type": "String",
|
||||
"default": "Go to the item page"
|
||||
},
|
||||
"helpInfoBellowLabel": {
|
||||
"helpInfoBelowLabel": {
|
||||
"type": "Boolean",
|
||||
"default": false
|
||||
},
|
||||
|
|
|
@ -128,7 +128,7 @@ export default [
|
|||
"type": "String",
|
||||
"default": "Go to the item page"
|
||||
},
|
||||
"helpInfoBellowLabel": {
|
||||
"helpInfoBelowLabel": {
|
||||
"type": "Boolean",
|
||||
"default": false
|
||||
}
|
||||
|
@ -168,10 +168,10 @@ export default [
|
|||
sentFormMessage,
|
||||
showItemLinkButton,
|
||||
itemLinkButtonLabel,
|
||||
helpInfoBellowLabel
|
||||
helpInfoBelowLabel
|
||||
} = attributes;
|
||||
|
||||
return <div
|
||||
|
||||
return <div
|
||||
style={{
|
||||
'font-size': baseFontSize + 'px',
|
||||
'--tainacan-base-font-size': baseFontSize + 'px',
|
||||
|
@ -185,7 +185,7 @@ export default [
|
|||
'--tainacan-secondary': secondaryColor
|
||||
}}
|
||||
className={ className }>
|
||||
<div
|
||||
<div
|
||||
id="tainacan-item-submission-form"
|
||||
data-module="item-submission-form"
|
||||
collection-id={ collectionId }
|
||||
|
@ -207,7 +207,7 @@ export default [
|
|||
metadata-section-label={ metadataSectionLabel }
|
||||
show-item-link-button={ showItemLinkButton ? showItemLinkButton.toString() : 'false' }
|
||||
item-link-button-label={ itemLinkButtonLabel ? itemLinkButtonLabel : __( 'Go to the item page', 'tainacan' ) }
|
||||
help-info-bellow-label={ helpInfoBellowLabel ? helpInfoBellowLabel.toString() : 'false' } >
|
||||
help-info-bellow-label={ helpInfoBelowLabel ? helpInfoBelowLabel.toString() : 'false' } >
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ export default [
|
|||
type: String,
|
||||
default: __( 'Go to the item page', 'tainacan' )
|
||||
},
|
||||
helpInfoBellowLabel: {
|
||||
helpInfoBelowLabel: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
@ -379,10 +379,10 @@ export default [
|
|||
sentFormMessage,
|
||||
showItemLinkButton,
|
||||
itemLinkButtonLabel,
|
||||
helpInfoBellowLabel
|
||||
helpInfoBelowLabel
|
||||
} = attributes;
|
||||
|
||||
return <div
|
||||
|
||||
return <div
|
||||
style={{
|
||||
'font-size': baseFontSize + 'px',
|
||||
'--tainacan-base-font-size': baseFontSize + 'px',
|
||||
|
@ -396,7 +396,7 @@ export default [
|
|||
'--tainacan-secondary': secondaryColor
|
||||
}}
|
||||
className={ className }>
|
||||
<div
|
||||
<div
|
||||
id="tainacan-item-submission-form"
|
||||
collection-id={ collectionId }
|
||||
hide-file-modal-button={ hideFileModalButton.toString() }
|
||||
|
@ -417,12 +417,12 @@ export default [
|
|||
metadata-section-label={ metadataSectionLabel }
|
||||
show-item-link-button={ showItemLinkButton ? showItemLinkButton.toString() : 'false' }
|
||||
item-link-button-label={ itemLinkButtonLabel ? itemLinkButtonLabel : __( 'Go to the item page', 'tainacan' ) }
|
||||
help-info-bellow-label={ helpInfoBellowLabel ? helpInfoBellowLabel.toString() : 'false' } >
|
||||
help-info-bellow-label={ helpInfoBelowLabel ? helpInfoBelowLabel.toString() : 'false' } >
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
},
|
||||
/* Depecrated on Tainacan 0.18.3, due to the introduction of helpInfoBellowLabel */
|
||||
/* Depecrated on Tainacan 0.18.3, due to the introduction of helpInfoBelowLabel */
|
||||
{
|
||||
attributes: {
|
||||
collectionId: {
|
||||
|
@ -586,8 +586,8 @@ export default [
|
|||
showItemLinkButton,
|
||||
itemLinkButtonLabel
|
||||
} = attributes;
|
||||
|
||||
return <div
|
||||
|
||||
return <div
|
||||
style={{
|
||||
'font-size': baseFontSize + 'px',
|
||||
'--tainacan-base-font-size': baseFontSize + 'px',
|
||||
|
@ -601,7 +601,7 @@ export default [
|
|||
'--tainacan-secondary': secondaryColor
|
||||
}}
|
||||
className={ className }>
|
||||
<div
|
||||
<div
|
||||
id="tainacan-item-submission-form"
|
||||
collection-id={ collectionId }
|
||||
hide-file-modal-button={ hideFileModalButton.toString() }
|
||||
|
@ -780,8 +780,8 @@ export default [
|
|||
sentFormHeading,
|
||||
sentFormMessage,
|
||||
} = attributes;
|
||||
|
||||
return <div
|
||||
|
||||
return <div
|
||||
style={{
|
||||
'font-size': baseFontSize + 'px',
|
||||
'--tainacan-base-font-size': baseFontSize + 'px',
|
||||
|
@ -795,7 +795,7 @@ export default [
|
|||
'--tainacan-secondary': secondaryColor
|
||||
}}
|
||||
className={ className }>
|
||||
<div
|
||||
<div
|
||||
id="tainacan-item-submission-form"
|
||||
collection-id={ collectionId }
|
||||
hide-file-modal-button={ hideFileModalButton.toString() }
|
||||
|
@ -818,4 +818,4 @@ export default [
|
|||
</div>
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
|
@ -54,7 +54,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
metadataSectionLabel,
|
||||
showItemLinkButton,
|
||||
itemLinkButtonLabel,
|
||||
helpInfoBellowLabel,
|
||||
helpInfoBelowLabel,
|
||||
showTermsAgreementCheckbox,
|
||||
termsAgreementMessage
|
||||
} = attributes;
|
||||
|
@ -356,11 +356,11 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
|
||||
<ToggleControl
|
||||
label={__('Help info below label', 'tainacan')}
|
||||
help={ helpInfoBellowLabel ? __('Show the help info below the label instead of hidden in the "?" icon on the help tooltip.', 'tainacan') : __('Do not show the help info below the label, keep it on the "?" icon toolip.', 'tainacan')}
|
||||
checked={ helpInfoBellowLabel }
|
||||
help={ helpInfoBelowLabel ? __('Show the help info below the label instead of hidden in the "?" icon on the help tooltip.', 'tainacan') : __('Do not show the help info below the label, keep it on the "?" icon toolip.', 'tainacan')}
|
||||
checked={ helpInfoBelowLabel }
|
||||
onChange={ ( isChecked ) => {
|
||||
helpInfoBellowLabel = isChecked;
|
||||
setAttributes({ helpInfoBellowLabel: isChecked });
|
||||
helpInfoBelowLabel = isChecked;
|
||||
setAttributes({ helpInfoBelowLabel: isChecked });
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
@ -570,8 +570,8 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
<div>
|
||||
{ documentSectionLabel ?
|
||||
<span>
|
||||
<span style={{ display: 'flex', alignItems: 'baseline', marginBottom: '5px' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
|
||||
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
<span style={{ display: 'flex', alignItems: 'baseline', marginBottom: '5px' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBelowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
|
||||
{ (!hideHelpButtons && helpInfoBelowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
</span>
|
||||
: null }
|
||||
{ [ hideFileModalButton, hideTextModalButton, hideLinkModalButton ].filter((option) => { return option == false }).length > 1 ?
|
||||
|
@ -601,8 +601,8 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||
{ !thumbnailSectionLabel ?
|
||||
<span>
|
||||
<span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
|
||||
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
<span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBelowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
|
||||
{ (!hideHelpButtons && helpInfoBelowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
</span>
|
||||
: null }
|
||||
<div class="fake-switch"><span class="fake-icon"></span><span class="fake-text"></span></div>
|
||||
|
@ -629,8 +629,8 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
showAllowCommentsSection ?
|
||||
(
|
||||
<div>
|
||||
<span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
|
||||
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
<span style={{ display: 'flex', alignItems: 'baseline' }}><span class="fake-text section-label"></span>{ !hideHelpButtons && !helpInfoBelowLabel ? <span class="fake-text fake-help-button"></span> : null }</span>
|
||||
{ (!hideHelpButtons && helpInfoBelowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
<div class="fake-switch"><span class="fake-icon"></span><span class="fake-text"></span></div>
|
||||
</div>
|
||||
) : null }
|
||||
|
@ -647,8 +647,8 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
|
|||
<div class={ 'fake-metadata' + (!hideCollapses ? ' has-collapse' : '') }>
|
||||
{ !hideCollapses ? <span class="fake-collapse-arrow"></span> : null }
|
||||
<span style={{ lineHeight: '0em' }}>
|
||||
<span class="fake-text"></span>{ !hideMetadataTypes ? <span class="fake-text fake-text-info"></span> : null }{ !hideHelpButtons && !helpInfoBellowLabel ? <span class="fake-text fake-help-button"></span> : null }
|
||||
{ (!hideHelpButtons && helpInfoBellowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
<span class="fake-text"></span>{ !hideMetadataTypes ? <span class="fake-text fake-text-info"></span> : null }{ !hideHelpButtons && !helpInfoBelowLabel ? <span class="fake-text fake-help-button"></span> : null }
|
||||
{ (!hideHelpButtons && helpInfoBelowLabel) ? <div><span class="fake-text fake-text-help-description"></span></div> : null }
|
||||
</span>
|
||||
<span class="fake-input"></span>
|
||||
</div>
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
class="section-label">
|
||||
<label>{{ documentSectionLabel }}</label>
|
||||
<help-button
|
||||
v-if="!hideHelpButtons && !helpInfoBellowLabel && $i18n.getHelperMessage('items', 'document')"
|
||||
v-if="!hideHelpButtons && !helpInfoBelowLabel && $i18n.getHelperMessage('items', 'document')"
|
||||
:title="$i18n.getHelperTitle('items', 'document')"
|
||||
:message="$i18n.getHelperMessage('items', 'document')"/>
|
||||
<p
|
||||
class="metadatum-description-help-info"
|
||||
v-if="!hideHelpButtons && helpInfoBellowLabel && $i18n.getHelperMessage('items', 'document')">
|
||||
v-if="!hideHelpButtons && helpInfoBelowLabel && $i18n.getHelperMessage('items', 'document')">
|
||||
{{ $i18n.getHelperMessage('items', 'document') }}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -195,12 +195,12 @@
|
|||
class="section-label">
|
||||
<label>{{ thumbnailSectionLabel }}</label>
|
||||
<help-button
|
||||
v-if="!hideHelpButtons && !helpInfoBellowLabel && $i18n.getHelperMessage('items', '_thumbnail_id')"
|
||||
v-if="!hideHelpButtons && !helpInfoBelowLabel && $i18n.getHelperMessage('items', '_thumbnail_id')"
|
||||
:title="$i18n.getHelperTitle('items', '_thumbnail_id')"
|
||||
:message="$i18n.getHelperMessage('items', '_thumbnail_id')"/>
|
||||
<p
|
||||
class="metadatum-description-help-info"
|
||||
v-if="!hideHelpButtons && helpInfoBellowLabel && $i18n.getHelperMessage('items', '_thumbnail_id')">
|
||||
v-if="!hideHelpButtons && helpInfoBelowLabel && $i18n.getHelperMessage('items', '_thumbnail_id')">
|
||||
{{ $i18n.getHelperMessage('items', '_thumbnail_id') }}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -338,12 +338,12 @@
|
|||
<div class="section-label">
|
||||
<label>{{ $i18n.get('label_comments') }}</label>
|
||||
<help-button
|
||||
v-if="!hideHelpButtons && !helpInfoBellowLabel && $i18n.getHelperMessage('items', 'comment_status')"
|
||||
v-if="!hideHelpButtons && !helpInfoBelowLabel && $i18n.getHelperMessage('items', 'comment_status')"
|
||||
:title="$i18n.getHelperTitle('items', 'comment_status')"
|
||||
:message="$i18n.getHelperMessage('items', 'comment_status')"/>
|
||||
<p
|
||||
class="metadatum-description-help-info"
|
||||
v-if="!hideHelpButtons && helpInfoBellowLabel && $i18n.getHelperMessage('items', 'comment_status')">
|
||||
v-if="!hideHelpButtons && helpInfoBelowLabel && $i18n.getHelperMessage('items', 'comment_status')">
|
||||
{{ $i18n.getHelperMessage('items', 'comment_status') }}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -543,7 +543,7 @@ export default {
|
|||
metadataSectionLabel: String,
|
||||
showItemLinkButton: Boolean,
|
||||
itemLinkButtonLabel: String,
|
||||
helpInfoBellowLabel: Boolean,
|
||||
helpInfoBelowLabel: Boolean,
|
||||
showTermsAgreementCheckbox: Boolean,
|
||||
termsAgreementMessage: String
|
||||
},
|
||||
|
|
|
@ -30,7 +30,7 @@ export default function({ attributes, className }) {
|
|||
sentFormMessage,
|
||||
showItemLinkButton,
|
||||
itemLinkButtonLabel,
|
||||
helpInfoBellowLabel,
|
||||
helpInfoBelowLabel,
|
||||
showTermsAgreementCheckbox,
|
||||
termsAgreementMessage
|
||||
} = attributes;
|
||||
|
@ -77,7 +77,7 @@ export default function({ attributes, className }) {
|
|||
show-terms-agreement-checkbox={ showTermsAgreementCheckbox ? showTermsAgreementCheckbox.toString() : 'false' }
|
||||
terms-agreement-message={ termsAgreementMessageHTML }
|
||||
item-link-button-label={ itemLinkButtonLabel ? itemLinkButtonLabel : __( 'Go to the item page', 'tainacan' ) }
|
||||
help-info-bellow-label={ helpInfoBellowLabel ? helpInfoBellowLabel.toString() : 'false' } >
|
||||
help-info-bellow-label={ helpInfoBelowLabel ? helpInfoBelowLabel.toString() : 'false' } >
|
||||
</div>
|
||||
</div>
|
||||
};
|
|
@ -111,7 +111,7 @@ export default (element) => {
|
|||
metadataSectionLabel: '',
|
||||
showItemLinkButton: false,
|
||||
itemLinkButtonLabel: '',
|
||||
helpInfoBellowLabel: false,
|
||||
helpInfoBelowLabel: false,
|
||||
showItemLinkButton: false,
|
||||
termsAgreementMessage: ''
|
||||
},
|
||||
|
@ -140,7 +140,7 @@ export default (element) => {
|
|||
if (this.$el.attributes['hide-metadata-types'] != undefined)
|
||||
this.hideMetadataTypes = this.isParameterTrue('hide-metadata-types');
|
||||
if (this.$el.attributes['help-info-bellow-label'] != undefined)
|
||||
this.helpInfoBellowLabel = this.isParameterTrue('help-info-bellow-label');
|
||||
this.helpInfoBelowLabel = this.isParameterTrue('help-info-bellow-label');
|
||||
|
||||
// Form sections labels
|
||||
if (this.$el.attributes['document-section-label'] != undefined)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
:metadata-section-label="$root.metadataSectionLabel"
|
||||
:show-item-link-button="$root.showItemLinkButton"
|
||||
:item-link-button-label="$root.itemLinkButtonLabel"
|
||||
:help-info-bellow-label="$root.helpInfoBellowLabel ? $root.helpInfoBellowLabel : false"
|
||||
:help-info-bellow-label="$root.helpInfoBelowLabel ? $root.helpInfoBelowLabel : false"
|
||||
:show-terms-agreement-checkbox="$root.showTermsAgreementCheckbox ? $root.showTermsAgreementCheckbox : false"
|
||||
:terms-agreement-message="$root.termsAgreementMessage"
|
||||
/>
|
||||
|
|
|
@ -831,7 +831,7 @@ return apply_filters( 'tainacan-i18n', [
|
|||
'info_no_options_available_filtering' => __( 'No options for this filtering.', 'tainacan' ),
|
||||
'info_no_options_found' => __( 'No options found.', 'tainacan' ),
|
||||
'info_all_files_uploaded' => __( 'All files uploaded.', 'tainacan' ),
|
||||
'info_there_are_%s_items_being_edited' => __( 'There are %s items being edited;', 'tainacan' ),
|
||||
'info_there_are_%s_items_being_edited' => __( 'There are %s items being edited.', 'tainacan' ),
|
||||
'info_there_is_one_item_being_edited' => __( 'There is one item being edited.', 'tainacan' ),
|
||||
'info_no_preview_found' => __( 'No preview was found.', 'tainacan' ),
|
||||
'info_leaving_bulk_edit' => __( 'You are leaving the bulk edit now.', 'tainacan' ),
|
||||
|
@ -880,7 +880,7 @@ return apply_filters( 'tainacan-i18n', [
|
|||
'info_slides_hide_controls' => __( 'to hide the controls and focus on the document', 'tainacan' ),
|
||||
'info_slides_start_transition' => __( 'to start or pause automatic transition every 3s', 'tainacan' ),
|
||||
'info_slides_exit' => __( 'to leave the fullscreen slides view mode', 'tainacan' ),
|
||||
'info_slides_help_end' => __( 'At any moment, you can also check the item metadata list by clicking on the metadata icon (%1$s) or go directly to the item page, where you will have all its details, by clicking on the eye icon (%2$s).', 'tainacan' ),
|
||||
'info_slides_help_end' => __( 'At any moment, you can also check the item metadata list by clicking on the metadata icon (%1$s) or go directly to the item page, where you will have all its details, by clicking on the eye icon (%2$s).', 'tainacan' ),
|
||||
'info_thumbnail_custom' => __( 'Upload the desired image for the thumbnail', 'tainacan'),
|
||||
'info_thumbnail_default_from_document' => __( 'A thumbnail will be automatically generated from the submitted document file', 'tainacan'),
|
||||
'info_submission_processing' => __( 'Please wait while the submission is being processed', 'tainacan'),
|
||||
|
|
Loading…
Reference in New Issue