commit
b9ad43bf24
|
@ -30,3 +30,5 @@ src/assets/css/tainacan-embeds.css.map
|
|||
demosaved.csv
|
||||
.DS_Store
|
||||
src/.DS_Store
|
||||
src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css
|
||||
src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css.map
|
||||
|
|
|
@ -140,10 +140,7 @@
|
|||
|
||||
<!-- Title -->
|
||||
<div
|
||||
:style="{
|
||||
'padding-left': !collectionId ? '0.5rem !important' : '2.75rem',
|
||||
'margin-left': !collectionId ? '0 !important' : '24px'
|
||||
}"
|
||||
:style="{ 'padding-left': !collectionId ? '0.5rem !important' : '2.75rem' }"
|
||||
class="metadata-title">
|
||||
<p
|
||||
v-tooltip="{
|
||||
|
|
|
@ -257,7 +257,6 @@ export default {
|
|||
a {
|
||||
margin-right: 2rem;
|
||||
display: inline-flex;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
|
|
|
@ -10,6 +10,28 @@
|
|||
animation-name: item-appear;
|
||||
animation-duration: 0.5s;
|
||||
|
||||
&>div {
|
||||
width: calc(100% + 25px) !important;
|
||||
|
||||
&>div>.tainacan-card:nth-child(3),
|
||||
&>div>.tainacan-card:nth-child(4),
|
||||
&>div>.tainacan-card:nth-child(5),
|
||||
&>div>.tainacan-card:nth-child(6),
|
||||
&>div>.tainacan-card:nth-child(7),
|
||||
&>div>.tainacan-card:nth-child(8),
|
||||
&>div>.tainacan-card:nth-child(9),
|
||||
&>div>.tainacan-card:nth-child(10) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
&>div>.tainacan-card:nth-child(3),
|
||||
&>div>.tainacan-card:nth-child(4) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tainacan-card {
|
||||
background-color: $gray1;
|
||||
padding: 0px;
|
||||
|
@ -93,13 +115,14 @@
|
|||
}
|
||||
.metadata-title {
|
||||
overflow: hidden;
|
||||
padding: 0.75rem 1rem;
|
||||
padding: 0.5rem 0.875rem;
|
||||
flex-basis: calc(100% - 96px);
|
||||
|
||||
p {
|
||||
color: black !important;
|
||||
font-size: 0.875rem !important;
|
||||
margin-bottom: 0;
|
||||
line-height: 1.125rem;
|
||||
}
|
||||
}
|
||||
&:hover .metadata-title {
|
||||
|
|
|
@ -91,16 +91,28 @@
|
|||
content: ',';
|
||||
color: $gray4;
|
||||
}
|
||||
.mdi::before {
|
||||
display: inline-block;
|
||||
font: normal normal normal 20px/1 "TainacanIcons";
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
vertical-align: middle;
|
||||
line-height: inherit;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
.mdi-chevron-left::before {
|
||||
content: "\F40A";
|
||||
font-size: 1.0625rem;
|
||||
transform: rotate(180deg);
|
||||
content: "arrowleft" !important;
|
||||
transform: none !important;
|
||||
}
|
||||
.mdi-chevron-right::before {
|
||||
content: "\F40A";
|
||||
font-size: 1.0625rem;
|
||||
content: "arrowright" !important;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
.mdi-24px::before {
|
||||
font-size: 24px !important;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.pagination-list { order: 2; }
|
||||
.pagination-next { order: 3; }
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
}
|
||||
}
|
||||
&:not(.is-loading)::after {
|
||||
content: "\F35D" !important;
|
||||
font: normal normal normal 24px/1 "Material Design Icons" !important;
|
||||
content: "arrowdown" !important;
|
||||
font: normal normal normal 20px/1 "TainacanIcons";
|
||||
border: none !important;
|
||||
transform: none !important;
|
||||
margin-top: -15px !important;
|
||||
|
|
|
@ -85,10 +85,7 @@
|
|||
|
||||
.metadata-title {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 6px;
|
||||
margin-top: 6px;
|
||||
margin-right: 6px;
|
||||
margin-left: 24px;
|
||||
margin: 6px;
|
||||
padding: 6px 1rem;
|
||||
min-height: 30px;
|
||||
cursor: pointer;
|
||||
|
@ -99,6 +96,7 @@
|
|||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-align: left;
|
||||
color: #454647;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,6 +142,9 @@ abstract class Background_Process extends \WP_Background_Process {
|
|||
$data = $batch->data;
|
||||
if ( ! empty( $data ) ) {
|
||||
global $wpdb;
|
||||
if (!isset($batch->output)) {
|
||||
$batch->output = '';
|
||||
}
|
||||
$wpdb->update(
|
||||
$this->table,
|
||||
[
|
||||
|
@ -263,6 +266,7 @@ abstract class Background_Process extends \WP_Background_Process {
|
|||
$batch = new \stdClass();
|
||||
$batch->key = $query->ID;
|
||||
$batch->data = maybe_unserialize( $query->data );
|
||||
$batch->status = $query->status;
|
||||
|
||||
if ($batch->status != 'running') {
|
||||
$this->open($batch->key);
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios'
|
||||
import { tainacan as axios, isCancel } from '../../../js/axios/axios'
|
||||
import { filter_type_mixin } from '../filter-types-mixin'
|
||||
// import qs from 'qs';
|
||||
|
||||
|
@ -120,7 +120,10 @@
|
|||
promise = this.getValuesPlainText( this.metadatum, query, this.isRepositoryLevel );
|
||||
|
||||
promise.request.catch( error => {
|
||||
this.$console.log('error select', error );
|
||||
if (isCancel(error))
|
||||
this.$console.log('Request canceled: ', error.message);
|
||||
else
|
||||
this.$console.error( error );
|
||||
});
|
||||
|
||||
// Search Request Token for cancelling
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
import { tainacan as axios, isCancel } from '../../../js/axios/axios';
|
||||
import { filter_type_mixin } from '../filter-types-mixin';
|
||||
import CheckboxRadioModal from '../../../admin/components/other/checkbox-radio-modal.vue';
|
||||
|
||||
|
@ -138,7 +138,10 @@
|
|||
this.selectedValues();
|
||||
})
|
||||
.catch( error => {
|
||||
this.$console.log('error select', error );
|
||||
if (isCancel(error))
|
||||
this.$console.log('Request canceled: ', error.message);
|
||||
else
|
||||
this.$console.error( error );
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
import { tainacan as axios, isCancel } from '../../../js/axios/axios';
|
||||
import { filter_type_mixin } from '../filter-types-mixin'
|
||||
|
||||
export default {
|
||||
|
@ -111,7 +111,10 @@
|
|||
.then(() => {
|
||||
})
|
||||
.catch( error => {
|
||||
this.$console.error('error select', error );
|
||||
if (isCancel(error))
|
||||
this.$console.log('Request canceled: ', error.message);
|
||||
else
|
||||
this.$console.error( error );
|
||||
});
|
||||
|
||||
// Search Request Token for cancelling
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
import { tainacan as axios, isCancel } from '../../../js/axios/axios';
|
||||
import { filter_type_mixin } from '../filter-types-mixin'
|
||||
import qs from 'qs';
|
||||
|
||||
|
@ -135,7 +135,10 @@
|
|||
|
||||
promise.request
|
||||
.catch( error => {
|
||||
this.$console.log('error select', error );
|
||||
if (isCancel(error))
|
||||
this.$console.log('Request canceled: ', error.message);
|
||||
else
|
||||
this.$console.error( error );
|
||||
});
|
||||
|
||||
// Search Request Token for cancelling
|
||||
|
|
|
@ -37,21 +37,6 @@
|
|||
this.$console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
if ( this.metadatum.metadatum.metadata_type_options &&
|
||||
this.metadatum.metadatum.metadata_type_options.search &&
|
||||
this.metadatum.metadatum.metadata_type_options.search.length > 0){
|
||||
axios.get('/collection/'+ collectionId +'/metadata?context=edit')
|
||||
.then( res => {
|
||||
for (let item of res.data) {
|
||||
if ( this.metadatum.metadatum.metadata_type_options.search.indexOf( item.id ) >= 0 )
|
||||
this.searchMetadata.push( item );
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
@ -61,7 +46,6 @@
|
|||
loading: false,
|
||||
collectionId: 0,
|
||||
inputValue: null,
|
||||
searchMetadata: [],
|
||||
queryObject: {},
|
||||
itemsFound: []
|
||||
}
|
||||
|
@ -101,9 +85,8 @@
|
|||
this.$emit('blur');
|
||||
},
|
||||
search: _.debounce(function(query) {
|
||||
if( this.selected.length > 0 && this.metadatum.metadatum.multiple === 'no'){
|
||||
if ( this.selected.length > 0 && this.metadatum.metadatum.multiple === 'no')
|
||||
return '';
|
||||
}
|
||||
|
||||
if (query !== '') {
|
||||
this.loading = true;
|
||||
|
@ -131,20 +114,23 @@
|
|||
this.options = [];
|
||||
}
|
||||
}, 500),
|
||||
mountQuery( search ){
|
||||
let query = []
|
||||
if ( this.searchMetadata.length > 0){
|
||||
mountQuery( search ) {
|
||||
let query = [];
|
||||
|
||||
if ( this.metadatum.metadatum.metadata_type_options &&
|
||||
this.metadatum.metadatum.metadata_type_options.search &&
|
||||
this.metadatum.metadatum.metadata_type_options.search.length > 0)
|
||||
{
|
||||
query['metaquery'] = [];
|
||||
const metaquery = query['metaquery'];
|
||||
metaquery['relation'] = 'OR'
|
||||
for ( let index in this.searchMetadata ){
|
||||
metaquery[index] = {
|
||||
key: this.searchMetadata[index].id,
|
||||
for ( let i = 0; i < this.metadatum.metadatum.metadata_type_options.search.length; i++ ){
|
||||
metaquery[i] = {
|
||||
key: this.metadatum.metadatum.metadata_type_options.search[i],
|
||||
value: search,
|
||||
compare: 'LIKE'
|
||||
}
|
||||
}
|
||||
|
||||
query['metaquery'] = metaquery;
|
||||
} else {
|
||||
query['search'] = search;
|
||||
|
|
|
@ -127,7 +127,7 @@ class Relationship extends Metadata_Type {
|
|||
|
||||
//$item = new \Tainacan\Entities\Item($item_id);
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
$item = $Tainacan_Items->fetch($item_id);
|
||||
$item = $Tainacan_Items->fetch( (int) $item_id);
|
||||
|
||||
|
||||
$count ++;
|
||||
|
|
|
@ -19,7 +19,7 @@ class Taxonomy extends Metadata_Type {
|
|||
$this->set_primitive_type('term');
|
||||
|
||||
$this->set_default_options([
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]);
|
||||
|
||||
$this->set_form_component('tainacan-form-taxonomy');
|
||||
|
@ -166,7 +166,7 @@ class Taxonomy extends Metadata_Type {
|
|||
|
||||
$valid = true;
|
||||
|
||||
if (false === $this->get_option('allow_new_terms')) {
|
||||
if ('no' === $this->get_option('allow_new_terms') || false === $this->get_option('allow_new_terms')) { //support legacy bug when it was saved as false
|
||||
$terms = $item_metadata->get_value();
|
||||
|
||||
if (false === $terms)
|
||||
|
|
|
@ -113,7 +113,7 @@ export default class CollectionsModal extends React.Component {
|
|||
if (this.state.collectionsPage <= 1)
|
||||
currentModalCollections = [];
|
||||
|
||||
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionsPage;
|
||||
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionsPage;
|
||||
|
||||
this.setState({
|
||||
isLoadingCollections: true,
|
||||
|
@ -159,7 +159,7 @@ export default class CollectionsModal extends React.Component {
|
|||
isLoadingCollections: true
|
||||
});
|
||||
|
||||
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage;
|
||||
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage;
|
||||
|
||||
if (name != undefined && name != '')
|
||||
endpoint += '&search=' + name;
|
||||
|
|
|
@ -17,6 +17,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
order: 'asc',
|
||||
showSearchBar: false,
|
||||
showCollectionHeader: false,
|
||||
showCollectionLabel: false,
|
||||
collectionBackgroundColor: '#454647',
|
||||
collectionTextColor: '#ffffff',
|
||||
tainacanApiRoot: '',
|
||||
|
@ -36,6 +37,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
order: this.order,
|
||||
showSearchBar: this.showSearchBar,
|
||||
showCollectionHeader: this.showCollectionHeader,
|
||||
showCollectionLabel: this.showCollectionLabel,
|
||||
collectionBackgroundColor: this.collectionBackgroundColor,
|
||||
collectionTextColor: this.collectionTextColor,
|
||||
tainacanApiRoot: this.tainacanApiRoot,
|
||||
|
@ -56,6 +58,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
this.order = this.$el.attributes['order'] != undefined ? this.$el.attributes['order'].value : undefined;
|
||||
this.showSearchBar = this.$el.attributes['show-search-bar'] != undefined ? this.$el.attributes['show-search-bar'].value == 'true' : false;
|
||||
this.showCollectionHeader = this.$el.attributes['show-collection-header'] != undefined ? this.$el.attributes['show-collection-header'].value == 'true' : false;
|
||||
this.showCollectionLabel = this.$el.attributes['show-collection-label'] != undefined ? this.$el.attributes['show-collection-label'].value == 'true' : false;
|
||||
this.collectionBackgroundColor = this.$el.attributes['collection-background-color'] != undefined ? this.$el.attributes['collection-background-color'].value : undefined;
|
||||
this.collectionTextColor = this.$el.attributes['collection-text-color'] != undefined ? this.$el.attributes['collection-text-color'].value : undefined;
|
||||
this.tainacanApiRoot = this.$el.attributes['tainacan-api-root'] != undefined ? this.$el.attributes['tainacan-api-root'].value : undefined;
|
||||
|
@ -64,9 +67,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
methods: {
|
||||
__(text, domain) {
|
||||
return wp.i18n.__(text, domain);
|
||||
},
|
||||
debounce() {
|
||||
return _.debounce;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -22,7 +22,12 @@
|
|||
((!collection || !collection.thumbnail || (!collection.thumbnail['tainacan-medium'] && !collection.thumbnail['medium'])) && (!collection || !collection.header_image) ? 'only-collection-name' : '')
|
||||
">
|
||||
<h3 :style="{ color: collectionTextColor ? collectionTextColor : '' }">
|
||||
<span class="label">{{ $root.__('Collection', 'tainacan') }}</span><br>
|
||||
<span
|
||||
v-if="showCollectionLabel"
|
||||
class="label">
|
||||
{{ $root.__('Collection', 'tainacan') }}
|
||||
<br>
|
||||
</span>
|
||||
{{ collection && collection.name ? collection.name : '' }}
|
||||
</h3>
|
||||
</div>
|
||||
|
@ -100,7 +105,7 @@
|
|||
</button>
|
||||
<input
|
||||
:value="searchString"
|
||||
@input="(value) => { $root.debounce(applySearchString(value), 300) } "
|
||||
@input="(value) => applySearchString(value)"
|
||||
type="text">
|
||||
<button
|
||||
class="previous-button"
|
||||
|
@ -207,6 +212,7 @@
|
|||
<script>
|
||||
import axios from 'axios';
|
||||
import qs from 'qs';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
export default {
|
||||
name: "DynamicItemsListTheme",
|
||||
|
@ -236,6 +242,7 @@ export default {
|
|||
order: String,
|
||||
showSearchBar: Boolean,
|
||||
showCollectionHeader: Boolean,
|
||||
showCollectionLabel: Boolean,
|
||||
collectionBackgroundColor: String,
|
||||
collectionTextColor: String,
|
||||
tainacanApiRoot: String,
|
||||
|
@ -243,16 +250,16 @@ export default {
|
|||
className: String
|
||||
},
|
||||
methods: {
|
||||
applySearchString(event) {
|
||||
applySearchString: debounce(function(event) {
|
||||
|
||||
this.paged = 1;
|
||||
let value = event.target.value;
|
||||
|
||||
if (this.searchString != value) {
|
||||
this.searchString = value;
|
||||
this.paged = 1;
|
||||
this.fetchItems();
|
||||
}
|
||||
},
|
||||
}, 500),
|
||||
fetchItems() {
|
||||
|
||||
this.items = [];
|
||||
|
@ -315,6 +322,7 @@ export default {
|
|||
|
||||
this.tainacanAxios.get(endpoint, { cancelToken: this.itemsRequestSource.token })
|
||||
.then(response => {
|
||||
|
||||
for (let item of response.data.items)
|
||||
this.items.push(item);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
display: flex;
|
||||
width: 100%;
|
||||
align-items: stretch;
|
||||
text-decoration: none;
|
||||
text-decoration: none !important;
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
@ -162,6 +162,7 @@
|
|||
|
||||
button {
|
||||
margin-right: 0.75rem;
|
||||
padding: 0 0.35rem;
|
||||
min-height: 28px;
|
||||
z-index: 2;
|
||||
border: none;
|
||||
|
|
|
@ -56,7 +56,7 @@ export default class DynamicItemsModal extends React.Component {
|
|||
if (this.state.collectionPage <= 1)
|
||||
someModalCollections = [];
|
||||
|
||||
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
|
||||
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
|
||||
|
||||
this.setState({
|
||||
isLoadingCollections: true,
|
||||
|
@ -121,7 +121,7 @@ export default class DynamicItemsModal extends React.Component {
|
|||
items: []
|
||||
});
|
||||
|
||||
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage;
|
||||
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage;
|
||||
if (name != undefined && name != '')
|
||||
endpoint += '&search=' + name;
|
||||
|
||||
|
|
|
@ -85,6 +85,10 @@ registerBlockType('tainacan/dynamic-items-list', {
|
|||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
showCollectionLabel: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
collection: {
|
||||
type: Object,
|
||||
value: undefined
|
||||
|
@ -132,6 +136,7 @@ registerBlockType('tainacan/dynamic-items-list', {
|
|||
isLoading,
|
||||
showSearchBar,
|
||||
showCollectionHeader,
|
||||
showCollectionLabel,
|
||||
isLoadingCollection,
|
||||
collection,
|
||||
collectionBackgroundColor,
|
||||
|
@ -348,7 +353,7 @@ registerBlockType('tainacan/dynamic-items-list', {
|
|||
>
|
||||
<ToggleControl
|
||||
label={__('Display header', 'tainacan')}
|
||||
help={ showCollectionHeader ? __('Toggle to show collection header', 'tainacan') : __('Do not show collection header', 'tainacan')}
|
||||
help={ !showCollectionHeader ? __('Toggle to show collection header', 'tainacan') : __('Do not show collection header', 'tainacan')}
|
||||
checked={ showCollectionHeader }
|
||||
onChange={ ( isChecked ) => {
|
||||
showCollectionHeader = isChecked;
|
||||
|
@ -359,6 +364,18 @@ registerBlockType('tainacan/dynamic-items-list', {
|
|||
/>
|
||||
{ showCollectionHeader ?
|
||||
<div style={{ margin: '6px' }}>
|
||||
|
||||
<ToggleControl
|
||||
label={__('Display "Collection" label', 'tainacan')}
|
||||
help={ !showCollectionLabel ? __('Toggle to show "Collection" label above header', 'tainacan') : __('Do not show "Collection" label', 'tainacan')}
|
||||
checked={ showCollectionLabel }
|
||||
onChange={ ( isChecked ) => {
|
||||
showCollectionLabel = isChecked;
|
||||
setAttributes({ showCollectionLabel: showCollectionLabel });
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
<BaseControl
|
||||
id="colorpicker"
|
||||
label={ __('Background color', 'tainacan')}>
|
||||
|
@ -542,7 +559,7 @@ registerBlockType('tainacan/dynamic-items-list', {
|
|||
((!collection || !collection.thumbnail || (!collection.thumbnail['tainacan-medium'] && !collection.thumbnail['medium'])) && (!collection || !collection.header_image) ? 'only-collection-name' : '')
|
||||
}>
|
||||
<h3 style={{ color: collectionTextColor ? collectionTextColor : '' }}>
|
||||
<span class="label">{ __('Collection', 'tainacan') }</span><br/>
|
||||
{ showCollectionLabel ? <span class="label">{ __('Collection', 'tainacan') }<br/></span> : null }
|
||||
{ collection && collection.name ? collection.name : '' }
|
||||
</h3>
|
||||
</div>
|
||||
|
@ -720,6 +737,7 @@ registerBlockType('tainacan/dynamic-items-list', {
|
|||
order,
|
||||
showSearchBar,
|
||||
showCollectionHeader,
|
||||
showCollectionLabel,
|
||||
collectionBackgroundColor,
|
||||
collectionTextColor
|
||||
} = attributes;
|
||||
|
@ -732,6 +750,7 @@ registerBlockType('tainacan/dynamic-items-list', {
|
|||
show-name={ '' + showName }
|
||||
show-search-bar={ '' + showSearchBar }
|
||||
show-collection-header={ '' + showCollectionHeader }
|
||||
show-collection-label={ '' + showCollectionLabel }
|
||||
layout={ layout }
|
||||
collection-background-color={ collectionBackgroundColor }
|
||||
collection-text-color={ collectionTextColor }
|
||||
|
|
|
@ -128,7 +128,7 @@ export default class ItemsModal extends React.Component {
|
|||
|
||||
let anItemsRequestSource = axios.CancelToken.source();
|
||||
|
||||
let endpoint = '/collection/'+ this.state.collectionId + '/items/?fetch_only=title,thumbnail&perpage=' + this.state.itemsPerPage;
|
||||
let endpoint = '/collection/'+ this.state.collectionId + '/items/?orderby=title&order=asc&fetch_only=title,thumbnail&perpage=' + this.state.itemsPerPage;
|
||||
|
||||
if (name != undefined && name != '')
|
||||
endpoint += '&search=' + name;
|
||||
|
@ -164,7 +164,7 @@ export default class ItemsModal extends React.Component {
|
|||
if (this.state.itemsPage <= 1)
|
||||
someModalItems = [];
|
||||
|
||||
let endpoint = '/collection/'+ collectionId + '/items/?fetch_only=title,thumbnail&perpage=' + this.state.itemsPerPage + '&paged=' + this.state.itemsPage;
|
||||
let endpoint = '/collection/'+ collectionId + '/items/?orderby=title&order=asc&fetch_only=title,thumbnail&perpage=' + this.state.itemsPerPage + '&paged=' + this.state.itemsPage;
|
||||
|
||||
this.setState({
|
||||
isLoadingItems: true,
|
||||
|
@ -208,7 +208,7 @@ export default class ItemsModal extends React.Component {
|
|||
if (this.state.collectionPage <= 1)
|
||||
someModalCollections = [];
|
||||
|
||||
let endpoint = '/collections/?perpage=' + this.state.itemsPerPage + '&paged=' + this.state.collectionPage;
|
||||
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.itemsPerPage + '&paged=' + this.state.collectionPage;
|
||||
|
||||
this.setState({
|
||||
isLoadingCollections: true,
|
||||
|
@ -272,7 +272,7 @@ export default class ItemsModal extends React.Component {
|
|||
items: []
|
||||
});
|
||||
|
||||
let endpoint = '/collections/?perpage=' + this.state.itemsPerPage;
|
||||
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.itemsPerPage;
|
||||
if (name != undefined && name != '')
|
||||
endpoint += '&search=' + name;
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ export default class TermsModal extends React.Component {
|
|||
|
||||
fetchTerms(name) {
|
||||
|
||||
let endpoint = '/taxonomy/'+ this.state.taxonomyId + '/terms/?hideempty=0&number=' + this.state.termsPerPage;
|
||||
let endpoint = '/taxonomy/'+ this.state.taxonomyId + '/terms/?order=asc&hideempty=0&number=' + this.state.termsPerPage;
|
||||
|
||||
if (name != undefined && name != '')
|
||||
endpoint += '&searchterm=' + name;
|
||||
|
@ -157,7 +157,7 @@ export default class TermsModal extends React.Component {
|
|||
if (offset <= 0)
|
||||
someModalTerms = [];
|
||||
|
||||
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?hideempty=0&number=' + this.state.termsPerPage + '&offset=' + offset;
|
||||
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?order=asc&hideempty=0&number=' + this.state.termsPerPage + '&offset=' + offset;
|
||||
|
||||
this.setState({
|
||||
isLoadingTerms: true,
|
||||
|
@ -200,7 +200,7 @@ export default class TermsModal extends React.Component {
|
|||
if (this.state.taxonomyPage <= 1)
|
||||
someModalTaxonomies = [];
|
||||
|
||||
let endpoint = '/taxonomies/?perpage=' + this.state.termsPerPage + '&paged=' + this.state.taxonomyPage;
|
||||
let endpoint = '/taxonomies/?orderby=title&order=asc&perpage=' + this.state.termsPerPage + '&paged=' + this.state.taxonomyPage;
|
||||
|
||||
this.setState({
|
||||
isLoadingTaxonomies: true,
|
||||
|
@ -259,7 +259,7 @@ export default class TermsModal extends React.Component {
|
|||
terms: []
|
||||
});
|
||||
|
||||
let endpoint = '/taxonomies/?perpage=' + this.state.termsPerPage;
|
||||
let endpoint = '/taxonomies/?orderby=title&order=asc&perpage=' + this.state.termsPerPage;
|
||||
if (name != undefined && name != '')
|
||||
endpoint += '&search=' + name;
|
||||
|
||||
|
|
|
@ -346,7 +346,10 @@ class Flickr_Importer extends Importer {
|
|||
|
||||
if ( isset( $item->tags ) && isset( $item->tags->tag ) && is_array( $item->tags->tag ) ) {
|
||||
foreach ( $item->tags->tag as $tag ) {
|
||||
$tags[] = $tag->raw;
|
||||
if (isset($tag->raw)) {
|
||||
$tags[] = $tag->raw;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -403,7 +406,7 @@ class Flickr_Importer extends Importer {
|
|||
}
|
||||
|
||||
$metadatum = new \Tainacan\Entities\Metadatum($metadatum_id);
|
||||
$processedItem[$raw_metadatum] = ($metadatum->is_multiple()) ? [$value] : $value;
|
||||
$processedItem[$raw_metadatum] = ( $metadatum->is_multiple() && !is_array($value) ) ? [$value] : $value;
|
||||
}
|
||||
|
||||
$this->add_transient( 'insertedId', $item->id );
|
||||
|
@ -484,7 +487,11 @@ class Flickr_Importer extends Importer {
|
|||
foreach( $collection['mapping'] as $metadatum_id => $header ){
|
||||
|
||||
if( !is_numeric($metadatum_id) ) {
|
||||
$metadatum = $this->create_new_metadata( $header, $collection['id']);
|
||||
$create_string = $header;
|
||||
if ($header == 'tags') {
|
||||
$create_string = 'Tags|taxonomy|multiple';
|
||||
}
|
||||
$metadatum = $this->create_new_metadata( $create_string, $collection['id']);
|
||||
|
||||
if( is_object($metadatum) ){
|
||||
unset($collection['mapping'][$metadatum_id]);
|
||||
|
|
|
@ -942,7 +942,7 @@ abstract class Importer {
|
|||
$newMetadatum->set_collection_id( (isset($collection_id)) ? $collection_id : 'default');
|
||||
$newMetadatum->set_status('publish');
|
||||
|
||||
if( strcmp($type, "Taxonomy") === 0 ){
|
||||
if( strcmp(strtolower($type), "taxonomy") === 0 ){
|
||||
$taxonomy = new Entities\Taxonomy();
|
||||
$taxonomy->set_name($name);
|
||||
$taxonomy->set_status('publish');
|
||||
|
@ -952,7 +952,7 @@ abstract class Importer {
|
|||
$inserted_tax = $taxonomy_repo->insert( $taxonomy );
|
||||
$newMetadatum->set_metadata_type_options([
|
||||
'taxonomy_id' => $inserted_tax->get_id(),
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'input_type' => 'tainacan-taxonomy-checkbox'
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -366,7 +366,7 @@ class Test_Importer extends Importer {
|
|||
'type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'options' => [
|
||||
'taxonomy_id' => $this->get_transient('tax_1_id'),
|
||||
'allow_new_terms' => true
|
||||
'allow_new_terms' => 'yes'
|
||||
]
|
||||
], $col1 );
|
||||
|
||||
|
@ -584,7 +584,7 @@ class Test_Importer extends Importer {
|
|||
$metadatum1 = $this->metadata_repo->fetch( $this->get_transient('tax_1_metadatum') );
|
||||
if ($metadatum1) {
|
||||
$options = $metadatum1->get_metadata_type_options();
|
||||
$options['allow_new_terms'] = false;
|
||||
$options['allow_new_terms'] = 'no';
|
||||
$metadatum1->set_metadata_type_options($options);
|
||||
if ($metadatum1->validate()) {
|
||||
$this->metadata_repo->insert($metadatum1);
|
||||
|
|
|
@ -77,9 +77,9 @@ export const fetchItems = ({ rootGetters, dispatch, commit }, { collectionId, is
|
|||
let viewModeObject = tainacan_plugin.registered_view_modes[postQueries.view_mode];
|
||||
|
||||
if (isOnTheme && viewModeObject != undefined && viewModeObject.type == 'template') {
|
||||
commit('setItemsListTemplate', items);
|
||||
commit('setItemsListTemplate', res.data.template);
|
||||
resolve({
|
||||
'itemsListTemplate': items,
|
||||
'itemsListTemplate': res.data.template,
|
||||
'total': res.headers['x-wp-total'],
|
||||
hasFiltered: hasFiltered,
|
||||
advancedSearchResults: advancedSearchResults,
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila
|
||||
Tags: museums, libraries, archives, GLAM, collections, repository
|
||||
Requires at least: 4.8
|
||||
Tested up to: 5.1.1
|
||||
Tested up to: 5.2
|
||||
Requires PHP: 5.6
|
||||
Stable tag: 0.8.1
|
||||
Stable tag: 0.9
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
@ -26,6 +26,8 @@ Tainacan is a powerful and flexible repository platform for WordPress. Manage an
|
|||
|
||||
* "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.
|
||||
|
||||
* "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!
|
||||
|
||||
== Getting Started ==
|
||||
|
||||
After installation, you will see a new menu item in your admin panel called "Tainacan". Click on it to open the Tainacan admin interface.
|
||||
|
@ -87,3 +89,6 @@ If you have Imagick installed in your server, Tainacan will be able to automatic
|
|||
9. Set up Taxonomies to be used across your repository
|
||||
10. Bulk edit as many items as you need quickly
|
||||
11. Expose your collection using Tainacan default theme
|
||||
12. Use Gutenberg blocks to display your collections in posts and pages
|
||||
13. Choose which items will be displayed in your block
|
||||
14. Items displayed using a Gutenberg block
|
||||
|
|
|
@ -4,13 +4,13 @@ Plugin Name: Tainacan
|
|||
Plugin URI: https://tainacan.org/
|
||||
Description: powerfull 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 respository platform.
|
||||
Author: Media Lab / UFG
|
||||
Version: 0.8.1
|
||||
Version: 0.9
|
||||
Text Domain: tainacan
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
|
||||
const TAINACAN_VERSION = '0.8.1';
|
||||
const TAINACAN_VERSION = '0.9';
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
$TAINACAN_BASE_URL = plugins_url('', __FILE__);
|
||||
|
|
|
@ -149,7 +149,7 @@ class TAINACAN_REST_Visibilility_Controller extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $collection,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'taxonomy_id' => $taxonomy_public->get_id()
|
||||
],
|
||||
'multiple' => 'yes'
|
||||
|
@ -165,7 +165,7 @@ class TAINACAN_REST_Visibilility_Controller extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $collection,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'taxonomy_id' => $taxonomy_private->get_id()
|
||||
],
|
||||
'multiple' => 'yes'
|
||||
|
|
|
@ -78,7 +78,7 @@ class BulkEdit extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $collection,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'taxonomy_id' => $taxonomy->get_id()
|
||||
],
|
||||
'multiple' => 'yes'
|
||||
|
@ -1229,7 +1229,7 @@ class BulkEdit extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $this->collection,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => false,
|
||||
'allow_new_terms' => 'no',
|
||||
'taxonomy_id' => $taxonomy2->get_id()
|
||||
],
|
||||
'multiple' => 'yes'
|
||||
|
|
|
@ -50,7 +50,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -187,7 +187,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -202,7 +202,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
|
||||
$metadatum->set_metadata_type_options([
|
||||
'taxonomy_id' => $tax2->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]);
|
||||
|
||||
$metadatum->validate();
|
||||
|
@ -230,7 +230,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax3->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -302,7 +302,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -318,7 +318,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax2->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -334,7 +334,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax2->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -350,7 +350,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax3->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -469,7 +469,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -486,7 +486,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax2->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -502,7 +502,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax3->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -519,7 +519,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax4->get_id(),
|
||||
'allow_new_terms' => false
|
||||
'allow_new_terms' => 'no'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -582,7 +582,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
'status' => 'publish',
|
||||
'metadata_type_options' => [
|
||||
'taxonomy_id' => $tax->get_id(),
|
||||
'allow_new_terms' => true
|
||||
'allow_new_terms' => 'yes'
|
||||
]
|
||||
),
|
||||
true
|
||||
|
@ -638,7 +638,7 @@ class TaxonomyMetadatumTypes extends TAINACAN_UnitTestCase {
|
|||
$meta->set_collection($collection);
|
||||
$meta->set_metadata_type_options([
|
||||
'taxonomy_id' => $tax->get_id(),
|
||||
'allow_new_terms' => true
|
||||
'allow_new_terms' => 'yes'
|
||||
]);
|
||||
|
||||
$this->assertFalse($meta->validate(), 'Metadatum should not validate because taxonomy is private');
|
||||
|
|
|
@ -298,7 +298,7 @@ class Facets extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $collection1,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'taxonomy_id' => $taxonomy->get_id()
|
||||
],
|
||||
'multiple' => 'yes'
|
||||
|
@ -317,7 +317,7 @@ class Facets extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $collection2,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'taxonomy_id' => $taxonomy->get_id()
|
||||
],
|
||||
'multiple' => 'yes'
|
||||
|
@ -335,7 +335,7 @@ class Facets extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $collection1,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'taxonomy_id' => $taxonomy2->get_id()
|
||||
],
|
||||
'multiple' => 'yes'
|
||||
|
@ -379,7 +379,7 @@ class Facets extends TAINACAN_UnitApiTestCase {
|
|||
'collection' => $collection2,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Relationship',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'collection_id' => $collection1->get_id(),
|
||||
'search' => []
|
||||
]
|
||||
|
|
|
@ -344,7 +344,7 @@ class ImporterTests extends TAINACAN_UnitTestCase {
|
|||
array(
|
||||
'name' => 'taxonomia',
|
||||
'collection_id' => $collection->get_id(),
|
||||
'metadata_type_options' => ['taxonomy_id' => $taxonomy->get_id(), 'allow_new_terms' => true ],
|
||||
'metadata_type_options' => ['taxonomy_id' => $taxonomy->get_id(), 'allow_new_terms' => 'yes' ],
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'status' => 'publish'
|
||||
),
|
||||
|
|
|
@ -365,7 +365,7 @@ class Taxonomies extends TAINACAN_UnitTestCase {
|
|||
'collection' => $collection,
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
|
||||
'metadata_type_options' => [
|
||||
'allow_new_terms' => true,
|
||||
'allow_new_terms' => 'yes',
|
||||
'taxonomy_id' => $taxonomy->get_id()
|
||||
],
|
||||
),
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 551 KiB |
Binary file not shown.
After Width: | Height: | Size: 498 KiB |
Binary file not shown.
After Width: | Height: | Size: 201 KiB |
Loading…
Reference in New Issue