diff --git a/src/classes/class-tainacan-roles.php b/src/classes/class-tainacan-roles.php index dbe5d01e5..17a133e65 100644 --- a/src/classes/class-tainacan-roles.php +++ b/src/classes/class-tainacan-roles.php @@ -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 ); diff --git a/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php b/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php index 6836d28b8..66537013c 100644 --- a/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php +++ b/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php @@ -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; diff --git a/src/views/admin/components/metadata-types/tainacan-form-item.vue b/src/views/admin/components/metadata-types/tainacan-form-item.vue index 0be62bacb..54bbcd741 100644 --- a/src/views/admin/components/metadata-types/tainacan-form-item.vue +++ b/src/views/admin/components/metadata-types/tainacan-form-item.vue @@ -33,7 +33,7 @@ ({{ itemMetadatum.metadatum.metadata_type_object.name }}) @@ -43,7 +43,7 @@ v-if="isTextInputComponent">

+ v-if="!$parent.hideHelpButtons && $parent.helpInfoBelowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description"> {{ itemMetadatum.metadatum.description }}

+ v-if="!$parent.hideHelpButtons && $parent.helpInfoBelowLabel && itemMetadatum.metadatum && itemMetadatum.metadatum.description"> {{ itemMetadatum.metadatum.description }}

+ className={ 'collection-list-item ' + (!showCollectionThumbnail ? 'collection-list-item-grid ' : '') + (maxCollectionsPerScreen ? ' max-collections-per-screen-' + maxCollectionsPerScreen : '') }> { tainacan_blocks.wp_version < '5.4' ? removeItemOfId(collection.id) } @@ -68,35 +68,35 @@ export default function ({ attributes, setAttributes, className, isSelected, cli icon="no-alt" label={__('Remove', 'tainacan')}/> } - - { !showCollectionThumbnail ? + { !showCollectionThumbnail ?
- { - { - {
: 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:
+ content:
}); } @@ -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' ?
- { + { TainacanBlocksCompatToolbar({ label: __('Add more collections', 'tainacan'), icon: { 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' : '')}>
- +
{ maxCollectionsPerScreen = aMaxCollectionsPerScreen; setAttributes( { maxCollectionsPerScreen: aMaxCollectionsPerScreen } ); - setContent(); + setContent(); }} min={ 1 } max={ 9 } /> - { showCollectionThumbnail ? + { showCollectionThumbnail ? 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(); - } + } } /> { loopSlides = isChecked; setAttributes({ loopSlides: loopSlides }); - } + } } /> { autoPlay = isChecked; setAttributes({ autoPlay: autoPlay }); - } + } } /> - { - autoPlay ? + { + autoPlay ? { 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 }); }}/> { + onChange={ ( aStyle ) => { arrowsStyle = aStyle; - setAttributes({ arrowsStyle: arrowsStyle }); + setAttributes({ arrowsStyle: arrowsStyle }); }}/> { largeArrows = isChecked; setAttributes({ largeArrows: largeArrows }); - } + } } />
- { isSelected ? + { isSelected ? (
- { isModalOpen ? + { isModalOpen ? { - selectedCollections = aSelectionOfCollections; + selectedCollections = aSelectionOfCollections; setAttributes({ selectedCollections: aSelectionOfCollections, isModalOpen: false }); setContent(); }} - onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> + onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> : null } - +
) : null } @@ -426,29 +426,29 @@ export default function ({ attributes, setAttributes, className, isSelected, cli type="button" onClick={ () => openCarouselModal() }> {__('Select Collections', 'tainacan')} - + ) : null } - - { isLoading ? + + { isLoading ?
:
- { isSelected && collections.length ? + { isSelected && collections.length ?
{__('Warning: this is just a demonstration. To see the carousel in action, either preview or publish your post.', 'tainacan')}
: null } - { collections.length ? ( + { collections.length ? (
- +
{ 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(); - } + } } /> { loopSlides = isChecked; setAttributes({ loopSlides: loopSlides }); - } + } } /> { autoPlay = isChecked; setAttributes({ autoPlay: autoPlay }); - } + } } /> - { - autoPlay ? + { + autoPlay ? { 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 }); }}/> { + onChange={ ( aStyle ) => { arrowsStyle = aStyle; - setAttributes({ arrowsStyle: arrowsStyle }); + setAttributes({ arrowsStyle: arrowsStyle }); }}/> { largeArrows = isChecked; setAttributes({ largeArrows: largeArrows }); - } + } } />
- { isSelected ? + { isSelected ? (
- { isModalOpen ? + { isModalOpen ? { taxonomyId = selectedTaxonomyId; setAttributes({ taxonomyId: taxonomyId }); }} onApplySelection={ (aSelectionOfTerms) =>{ selectedTerms = aSelectionOfTerms; - + setAttributes({ selectedTerms: selectedTerms, isModalOpen: false }); setContent(); }} - onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> + onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> : null } - +
) : null } @@ -407,29 +407,29 @@ export default function({ attributes, setAttributes, className, isSelected, clie type="button" onClick={ () => openCarouselModal() }> {__('Select Terms', 'tainacan')} - + ) : null } - - { isLoading ? + + { isLoading ?
:
- { isSelected && terms.length ? + { isSelected && terms.length ?
{__('Warning: this is just a demonstration. To see the carousel in action, either preview or publish your post.', 'tainacan')}
: null } - { terms.length ? ( + { terms.length ? (
-
    { terms }
-
@@ -476,4 +476,4 @@ export default function({ attributes, setAttributes, className, isSelected, clie }
); -}; \ No newline at end of file +}; diff --git a/src/views/gutenberg-blocks/blocks/item-submission-form/block.json b/src/views/gutenberg-blocks/blocks/item-submission-form/block.json index f511f2d73..e19244993 100644 --- a/src/views/gutenberg-blocks/blocks/item-submission-form/block.json +++ b/src/views/gutenberg-blocks/blocks/item-submission-form/block.json @@ -135,7 +135,7 @@ "type": "String", "default": "Go to the item page" }, - "helpInfoBellowLabel": { + "helpInfoBelowLabel": { "type": "Boolean", "default": false }, diff --git a/src/views/gutenberg-blocks/blocks/item-submission-form/deprecated.js b/src/views/gutenberg-blocks/blocks/item-submission-form/deprecated.js index 052f1ec12..337832b35 100644 --- a/src/views/gutenberg-blocks/blocks/item-submission-form/deprecated.js +++ b/src/views/gutenberg-blocks/blocks/item-submission-form/deprecated.js @@ -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
-
+ help-info-bellow-label={ helpInfoBelowLabel ? helpInfoBelowLabel.toString() : 'false' } >
} @@ -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
-
+ help-info-bellow-label={ helpInfoBelowLabel ? helpInfoBelowLabel.toString() : 'false' } >
} }, - /* 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
-
-
} } -] \ No newline at end of file +] diff --git a/src/views/gutenberg-blocks/blocks/item-submission-form/edit.js b/src/views/gutenberg-blocks/blocks/item-submission-form/edit.js index 649722cb9..22bfed85b 100644 --- a/src/views/gutenberg-blocks/blocks/item-submission-form/edit.js +++ b/src/views/gutenberg-blocks/blocks/item-submission-form/edit.js @@ -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
}; \ No newline at end of file diff --git a/src/views/gutenberg-blocks/blocks/item-submission-form/theme.js b/src/views/gutenberg-blocks/blocks/item-submission-form/theme.js index bc7856c7e..cf71aef17 100644 --- a/src/views/gutenberg-blocks/blocks/item-submission-form/theme.js +++ b/src/views/gutenberg-blocks/blocks/item-submission-form/theme.js @@ -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) diff --git a/src/views/gutenberg-blocks/blocks/item-submission-form/theme.vue b/src/views/gutenberg-blocks/blocks/item-submission-form/theme.vue index 6f88e7337..dc9b99e15 100644 --- a/src/views/gutenberg-blocks/blocks/item-submission-form/theme.vue +++ b/src/views/gutenberg-blocks/blocks/item-submission-form/theme.vue @@ -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" /> diff --git a/src/views/tainacan-i18n.php b/src/views/tainacan-i18n.php index 484417d37..6ea946046 100644 --- a/src/views/tainacan-i18n.php +++ b/src/views/tainacan-i18n.php @@ -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'),