Merge branch 'develop' into feature/309
This commit is contained in:
commit
579591fb70
1
build.sh
1
build.sh
|
@ -73,6 +73,7 @@ rsync -axz --exclude='vendor/bin/phpc*' --exclude='vendor/squizlabs' --exclude='
|
|||
--exclude='pdf-viewer/pdfjs-dist/web/compressed.tracemonkey-pldi-09.pdf' \
|
||||
--exclude='vendor/tecnickcom/tcpdf/fonts' \
|
||||
--exclude='vendor/smalot/pdfparser/src/Smalot/PdfParser/Tests/' \
|
||||
--exclude='vendor/tecnickcom/tcpdf/examples' \
|
||||
src/* $wp_plugin_dir/
|
||||
|
||||
rm -rf $wp_plugin_dir/scss
|
||||
|
|
|
@ -1951,9 +1951,9 @@
|
|||
}
|
||||
},
|
||||
"buefy": {
|
||||
"version": "0.8.5",
|
||||
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.8.5.tgz",
|
||||
"integrity": "sha512-yGQUhIsZWTodCx1rpfDTA32v5OjILpDIDAP+X6KoE6du3F3EZwJ/k5aT8D6Ba6AxNzVdDa2M7f0hzMddLbm38A==",
|
||||
"version": "0.8.6",
|
||||
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.8.6.tgz",
|
||||
"integrity": "sha512-7woxrdwANcnJbe7lofPxkJLGRRGIVwFXOo0kzEpiNB6alQj18NV6UrdAKse+LWCOADz+AeHe5gyc6qdgRjG5mw==",
|
||||
"requires": {
|
||||
"bulma": "0.7.5"
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.0",
|
||||
"buefy": "^0.8.5",
|
||||
"buefy": "^0.8.6",
|
||||
"bulma": "^0.7.5",
|
||||
"mdi": "^2.2.43",
|
||||
"moment": "^2.22.2",
|
||||
|
|
|
@ -57,6 +57,7 @@ class Admin {
|
|||
function load_admin_page() {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'add_admin_css' ), 90 );
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'add_admin_js' ), 90 );
|
||||
add_action( 'admin_enqueue_scripts', array(&$this, 'add_theme_files') );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
:value="`${metadatum.id}-${metadatum.metadata_type_options.taxonomy}-${metadatum.metadata_type_object.primitive_type}`"
|
||||
:key="metadatum.id"
|
||||
>{{ metadatum.name }}</option>
|
||||
<option value="_document_content_index-undefined-string">Documento</option>
|
||||
<option value="document_content_index-undefined-string">Documento</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
|
|
|
@ -97,8 +97,6 @@
|
|||
:maxtags="1"
|
||||
:class="{'is-field-history': bulkEditionProcedures[criterion].isDone}"
|
||||
:disabled="bulkEditionProcedures[criterion].isDone"
|
||||
:id="getMetadataByID(bulkEditionProcedures[criterion].metadatumID).metadata_type_object.component +
|
||||
'-' + getMetadataByID(bulkEditionProcedures[criterion].metadatumID).slug"
|
||||
:is="getMetadataByID(bulkEditionProcedures[criterion].metadatumID).metadata_type_object.component"
|
||||
:metadatum="{metadatum: getMetadataByID(bulkEditionProcedures[criterion].metadatumID)}"
|
||||
class="tainacan-bulk-edition-field"
|
||||
|
@ -152,8 +150,6 @@
|
|||
:maxtags="1"
|
||||
:class="{'is-field-history': bulkEditionProcedures[criterion].isDone}"
|
||||
:disabled="bulkEditionProcedures[criterion].isDone || bulkEditionProcedures[criterion].isExecuting"
|
||||
:id="getMetadataByID(bulkEditionProcedures[criterion].metadatumID).metadata_type_object.component +
|
||||
'-' + getMetadataByID(bulkEditionProcedures[criterion].metadatumID).slug"
|
||||
:is="getMetadataByID(bulkEditionProcedures[criterion].metadatumID).metadata_type_object.component"
|
||||
:metadatum="{metadatum: getMetadataByID(bulkEditionProcedures[criterion].metadatumID)}"
|
||||
class="tainacan-bulk-edition-field tainacan-bulk-edition-field-last"
|
||||
|
|
|
@ -182,7 +182,7 @@
|
|||
</span>
|
||||
<br>
|
||||
<a
|
||||
class="is-inline add-link"
|
||||
class="add-link"
|
||||
:class="{'disabled': form.enable_cover_page != 'yes'}"
|
||||
target="_blank"
|
||||
:href="newPagePath">
|
||||
|
@ -250,7 +250,7 @@
|
|||
@focus="clearErrors('default_view_mode')">
|
||||
<option
|
||||
v-for="(viewMode, index) of form.enabled_view_modes"
|
||||
v-if="registeredViewModes[viewMode] != undefined"
|
||||
v-if="registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen != true"
|
||||
:key="index"
|
||||
:value="viewMode">{{ registeredViewModes[viewMode].label }}
|
||||
</option>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</b-select>
|
||||
<router-link
|
||||
tag="a"
|
||||
class="is-inline add-link"
|
||||
class="add-link"
|
||||
:to="{ path: $routerHelper.getNewCollectionPath(), query: { fromImporter: true }}">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-add"/>
|
||||
|
@ -491,7 +491,7 @@ export default {
|
|||
|
||||
.source-file-upload {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
@include display-grid;
|
||||
}
|
||||
|
||||
.selected-source-file {
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
{{ metadatum.name }}
|
||||
</span>
|
||||
<span class="label-details">
|
||||
({{ $i18n.get(metadatum.metadata_type_object.component) }}) <em>{{ (metadatum.collection_id != collectionId) ? $i18n.get('label_inherited') : '' }}</em>
|
||||
({{ metadatum.metadata_type_object.name }}) <em>{{ (metadatum.collection_id != collectionId) ? $i18n.get('label_inherited') : '' }}</em>
|
||||
</span>
|
||||
</option>
|
||||
</b-select>
|
||||
|
@ -93,7 +93,9 @@
|
|||
<b-modal
|
||||
@close="onMetadatumEditionCanceled()"
|
||||
:active.sync="isNewMetadatumModalActive"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div
|
||||
autofocus="true"
|
||||
tabindex="-1"
|
||||
|
|
|
@ -400,7 +400,7 @@ export default {
|
|||
.source-file-upload {
|
||||
width: 100%;
|
||||
padding: 0.75rem $page-side-padding;
|
||||
display: grid;
|
||||
@include display-grid;
|
||||
}
|
||||
.document-list {
|
||||
display: inline-block;
|
||||
|
|
|
@ -213,7 +213,9 @@
|
|||
:active.sync="isTextModalActive"
|
||||
:width="640"
|
||||
scroll="keep"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div class="tainacan-modal-content">
|
||||
<div class="tainacan-modal-title">
|
||||
<h2>{{ $i18n.get('instruction_write_text') }}</h2>
|
||||
|
@ -251,10 +253,10 @@
|
|||
:width="640"
|
||||
scroll="keep"
|
||||
trap-focus
|
||||
autofocus
|
||||
role="dialog"
|
||||
tabindex="-1"
|
||||
aria-modal>
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div class="tainacan-modal-content">
|
||||
<div class="tainacan-modal-title">
|
||||
<h2>{{ $i18n.get('instruction_insert_url') }}</h2>
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
<span
|
||||
v-if="metadatum.required == 'yes'"
|
||||
class="required-metadatum-asterisk">*</span>
|
||||
<span class="metadata-type">({{ $i18n.get(metadatum.metadata_type_object.component) }})</span>
|
||||
<span class="metadata-type">({{ metadatum.metadata_type_object.metadata }})</span>
|
||||
<help-button
|
||||
:title="metadatum.name"
|
||||
:message="metadatum.description"/>
|
||||
|
@ -132,8 +132,6 @@
|
|||
:metadatum="{ metadatum: metadatum }"
|
||||
:value="itemMetadata[index].value"
|
||||
@input="clearErrorMessage(metadatum.id); bulkEdit($event, metadatum)"/>
|
||||
<!-- :class="{'is-field-history': bulkEditionProcedures[criterion].isDone}"
|
||||
:disabled="bulkEditionProcedures[criterion].isDone || bulkEditionProcedures[criterion].isExecuting" -->
|
||||
</div>
|
||||
</transition>
|
||||
</b-field>
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
</b-field>
|
||||
|
||||
<b-field :addons="false">
|
||||
<label class="label is-inline-block">{{ $i18n.get('label_options') }}</label>
|
||||
<label class="label is-inline-block">{{ $i18n.get('label_insert_options') }}</label>
|
||||
<b-field
|
||||
:type="formErrors['required'] != undefined ? 'is-danger' : ''"
|
||||
:message="formErrors['required'] != undefined ? formErrors['required'] : ''">
|
||||
|
|
|
@ -5,6 +5,15 @@
|
|||
@submit.prevent="saveEdition(editForm)">
|
||||
<div class="tainacan-page-title">
|
||||
<h2>{{ $i18n.get("title_term_edition") }}</h2>
|
||||
<a
|
||||
v-if="editForm && editForm.url != undefined && editForm.url!= ''"
|
||||
target="_blank"
|
||||
:href="editForm.url">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-see"/>
|
||||
</span>
|
||||
<span class="menu-text">{{ $i18n.get('label_view_on_theme') }}</span>
|
||||
</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
|
@ -135,7 +144,7 @@
|
|||
:message="$i18n.get('info_help_parent_term')"/>
|
||||
</label>
|
||||
<b-autocomplete
|
||||
id="tainacan-text-cover-page"
|
||||
id="tainacan-add-parent-field"
|
||||
:placeholder="$i18n.get('instruction_parent_term')"
|
||||
:data="parentTerms"
|
||||
field="name"
|
||||
|
@ -146,7 +155,18 @@
|
|||
@focus="clearErrors('parent');"
|
||||
:disabled="!hasParent">
|
||||
<template slot-scope="props">
|
||||
<div class="media">
|
||||
<div
|
||||
v-if="props.option.header_image"
|
||||
class="media-left">
|
||||
<img
|
||||
width="28"
|
||||
:src="props.option.header_image">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{{ props.option.name }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="empty">{{ $i18n.get('info_no_parent_term_found') }}</template>
|
||||
</b-autocomplete>
|
||||
|
@ -181,16 +201,6 @@
|
|||
{{ $i18n.get('cancel') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<a
|
||||
type="button"
|
||||
v-if="editForm.url != undefined && editForm.url!= ''"
|
||||
class="button is-secondary"
|
||||
target="_blank"
|
||||
:href="editForm.url">
|
||||
{{ $i18n.get('label_view_term') }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-success"
|
||||
|
@ -443,16 +453,21 @@
|
|||
animation-duration: 0.5s;
|
||||
|
||||
.tainacan-page-title {
|
||||
margin-bottom: 35px;
|
||||
margin-bottom: 30px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: baseline;
|
||||
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
color: $blue5;
|
||||
display: inline-block;
|
||||
margin-right: auto;
|
||||
}
|
||||
hr {
|
||||
margin: 3px 0px 4px 0px;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: $secondary;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
<span
|
||||
v-if="filter.filter_type_object != undefined"
|
||||
class="label-details">
|
||||
({{ $i18n.get(filter.filter_type_object.component) }})
|
||||
({{ filter.filter_type_object.name }})
|
||||
<span
|
||||
class="not-saved"
|
||||
v-if="(editForms[filter.id] != undefined && editForms[filter.id].saved != true) ||filter.status == 'auto-draft'">
|
||||
|
@ -235,7 +235,9 @@
|
|||
ref="filterTypeModal"
|
||||
:width="680"
|
||||
:active.sync="isSelectingFilterType"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div
|
||||
autofocus
|
||||
role="dialog"
|
||||
|
@ -1173,6 +1175,10 @@ export default {
|
|||
margin-left: -16px;
|
||||
}
|
||||
|
||||
.field .collapse-handle {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
input, select, textarea,
|
||||
.input, .tags, .tag {
|
||||
pointer-events: none;
|
||||
|
|
|
@ -98,19 +98,17 @@
|
|||
{{ metadatum.name }}
|
||||
</span>
|
||||
<span
|
||||
v-if="metadatum.id != undefined"
|
||||
v-if="metadatum.id != undefined && metadatum.metadata_type_object"
|
||||
class="label-details">
|
||||
({{ $i18n.get(metadatum.metadata_type_object.component) }})
|
||||
({{ metadatum.metadata_type_object.name }})
|
||||
<em v-if="metadatum.collection_id != collectionId">{{ $i18n.get('label_inherited') }}</em>
|
||||
<em
|
||||
v-if="metadatum.metadata_type_object &&
|
||||
metadatum.metadata_type_object.core &&
|
||||
v-if="metadatum.metadata_type_object.core &&
|
||||
metadatum.metadata_type_object.related_mapped_prop == 'title'">
|
||||
{{ $i18n.get('label_core_title') }}
|
||||
</em>
|
||||
<em
|
||||
v-if="metadatum.metadata_type_object &&
|
||||
metadatum.metadata_type_object.core &&
|
||||
v-if="metadatum.metadata_type_object.core &&
|
||||
metadatum.metadata_type_object.related_mapped_prop == 'description'">
|
||||
{{ $i18n.get('label_core_description') }}
|
||||
</em>
|
||||
|
@ -235,7 +233,7 @@
|
|||
</div>
|
||||
</b-tab-item>
|
||||
|
||||
<!-- Exposer --------------- -->
|
||||
<!-- Mapping --------------- -->
|
||||
<b-tab-item :label="$i18n.get('mapping')">
|
||||
<div>
|
||||
<section
|
||||
|
@ -248,10 +246,9 @@
|
|||
</span>
|
||||
</p>
|
||||
<p>{{ $i18n.get('info_there_is_no_metadatum') }}</p>
|
||||
<p>{{ $i18n.get('info_create_metadata') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<section v-else>
|
||||
<div class="field is-grouped form-submit">
|
||||
<b-select
|
||||
id="mappers-options-dropdown"
|
||||
|
@ -373,7 +370,9 @@
|
|||
<b-modal
|
||||
@close="onCancelNewMetadataMapperMetadata"
|
||||
:active.sync="isMapperMetadataCreating"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div
|
||||
autofocus
|
||||
role="dialog"
|
||||
|
|
|
@ -477,7 +477,7 @@
|
|||
v-for="(attributeValue, attributeName, index) in activity.new_value">
|
||||
<p class="is-capitalized has-text-blue5 has-text-weight-bold">
|
||||
{{ attributeName }}
|
||||
<small class="has-text-gray4 has-text-weight-normal"> {{ `(${$i18n.get('info_logs_before')})` }}</small>
|
||||
<small class="has-text-gray4 has-text-weight-normal"> {{ `(${$i18n.get('info_logs_after')})` }}</small>
|
||||
</p>
|
||||
|
||||
<div class="content">
|
||||
|
|
|
@ -363,28 +363,29 @@
|
|||
let selected = this.selected instanceof Array ? this.selected : [this.selected];
|
||||
|
||||
if (this.taxonomy_id && selected.length) {
|
||||
for (const term of selected) {
|
||||
|
||||
this.isSelectedTermsLoading = true;
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomy_id}/terms/${term}`)
|
||||
axios.get(`/taxonomy/${this.taxonomy_id}/terms/?${qs.stringify({ hideempty: 0, include: selected})}`)
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.name);
|
||||
for (const term of res.data)
|
||||
this.saveSelectedTagName(term.id, term.name);
|
||||
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
} else if (this.metadatum_type === 'Tainacan\\Metadata_Types\\Relationship' && selected.length) {
|
||||
this.isSelectedTermsLoading = true;
|
||||
|
||||
for (const item of selected) {
|
||||
|
||||
axios.get('/items/' + item + '?fetch_only=title')
|
||||
axios.get(`/items/?${qs.stringify({ fetch_only: 'title', postin: selected})}`)
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.title);
|
||||
for (const item of res.data)
|
||||
this.saveSelectedTagName(item.id, item.title);
|
||||
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -392,7 +393,6 @@
|
|||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
saveSelectedTagName(value, label){
|
||||
if (!this.selectedTagsName[value]) {
|
||||
|
|
|
@ -25,14 +25,20 @@
|
|||
:key="index"
|
||||
@click="onSelectCollection(collection)">
|
||||
<h4>{{ collection.name }}</h4>
|
||||
<p>{{ collection.length > 200 ? (collection.description.substring(0,197) + '...') : collection.description }}</p>
|
||||
<p>{{ collection.description.length > 200 ? (collection.description.substring(0,197) + '...') : collection.description }}</p>
|
||||
</div>
|
||||
<div
|
||||
v-if="collections.length <= 0"
|
||||
class="block">
|
||||
<p class="has-text-gray">
|
||||
{{ $i18n.get('info_no_collection_created') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<b-loading
|
||||
:is-full-page="false"
|
||||
:active.sync="isLoading"
|
||||
:can-cancel="false"/>
|
||||
</div>
|
||||
|
||||
<footer class="field is-grouped form-submit">
|
||||
<div class="control">
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
<b-modal
|
||||
:active.sync="isPreviewModalActive"
|
||||
scroll="keep"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<!-- <div class="tainacan-modal-content">
|
||||
<div class="tainacan-modal-title">
|
||||
<h2>{{ $i18n.get('label_document') }}</h2>
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
:active.sync="isPreviewModalActive"
|
||||
:width="1024"
|
||||
scroll="keep"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div
|
||||
autofocus
|
||||
role="dialog"
|
||||
|
@ -85,13 +87,12 @@ export default {
|
|||
getIconForMimeType(mimeType) {
|
||||
|
||||
let type = mimeType.split('/');
|
||||
|
||||
if (type[0] == 'application' && type[1] != undefined){
|
||||
switch (type[1]) {
|
||||
case 'pdf':
|
||||
return 'pdf';
|
||||
default:
|
||||
return '';
|
||||
return 'attachments';
|
||||
}
|
||||
} else {
|
||||
switch (type[0]) {
|
||||
|
@ -102,7 +103,7 @@ export default {
|
|||
case 'text':
|
||||
return 'text';
|
||||
default:
|
||||
return '';
|
||||
return 'attachments';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
</label>
|
||||
|
||||
<div
|
||||
v-if="collections && collections.length"
|
||||
class="block">
|
||||
<div
|
||||
v-for="(collection, key) in collections"
|
||||
|
@ -31,6 +32,13 @@
|
|||
</b-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="block">
|
||||
<p class="has-text-gray">
|
||||
{{ $i18n.get('info_no_collection_created') }}
|
||||
</p>
|
||||
</div>
|
||||
</b-collapse>
|
||||
</b-field>
|
||||
</template>
|
||||
|
|
|
@ -22,8 +22,8 @@ import Taxonomy from '../../classes/metadata-types/taxonomy/Taxonomy.vue';
|
|||
import FormRelationship from '../../classes/metadata-types/relationship/FormRelationship.vue';
|
||||
import FormTaxonomy from '../../classes/metadata-types/taxonomy/FormTaxonomy.vue';
|
||||
import FormSelectbox from '../../classes/metadata-types/selectbox/FormSelectbox.vue';
|
||||
import FormNumeric from '../../classes/metadata-types/numeric/FormNumeric.vue';
|
||||
|
||||
import FilterCustomInterval from '../../classes/filter-types/custom-interval/CustomInterval.vue';
|
||||
import FilterNumeric from '../../classes/filter-types/numeric/Numeric.vue';
|
||||
import FilterDate from '../../classes/filter-types/date/Date.vue';
|
||||
import FilterSelectbox from '../../classes/filter-types/selectbox/Selectbox.vue';
|
||||
|
@ -32,12 +32,13 @@ import FilterCheckbox from '../../classes/filter-types/checkbox/Checkbox.vue';
|
|||
import FilterTaginput from '../../classes/filter-types/taginput/Taginput.vue';
|
||||
import FilterNumericInterval from '../../classes/filter-types/numeric-interval/NumericInterval.vue';
|
||||
import FilterDateInterval from '../../classes/filter-types/date-interval/DateInterval.vue';
|
||||
|
||||
import FilterNumericListInterval from '../../classes/filter-types/numeric-list-interval/NumericListInterval.vue';
|
||||
import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox.vue';
|
||||
import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue';
|
||||
|
||||
import FormNumeric from '../../classes/filter-types/numeric/FormNumeric.vue';
|
||||
import FormNumericInterval from '../../classes/filter-types/numeric-interval/FormNumericInterval.vue';
|
||||
import FormFilterNumeric from '../../classes/filter-types/numeric/FormNumeric.vue';
|
||||
import FormFilterNumericInterval from '../../classes/filter-types/numeric-interval/FormNumericInterval.vue';
|
||||
import FormFilterNumericListInterval from '../../classes/filter-types/numeric-list-interval/FormNumericListInterval.vue';
|
||||
// import FormDate from '../../classes/filter-types/date/FormDate.vue';
|
||||
|
||||
import TainacanFormItem from '../../classes/metadata-types/tainacan-form-item.vue';
|
||||
|
@ -53,10 +54,6 @@ import eventBusSearch from '../../js/event-bus-search';
|
|||
import termsListBus from './terms-list-bus.js';
|
||||
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, UserCapabilitiesPlugin, StatusHelperPlugin } from './utilities';
|
||||
|
||||
import FilterNumericListInterval from '../../classes/filter-types/numeric-list-interval/NumericListInterval.vue';
|
||||
import FormNumericListInterval from '../../classes/filter-types/numeric-list-interval/FormNumericListInterval.vue';
|
||||
|
||||
|
||||
// Configure and Register Plugins
|
||||
Vue.use(Buefy, {
|
||||
defaultTooltipAnimated: true
|
||||
|
@ -79,15 +76,16 @@ Vue.component('tainacan-numeric', Numeric);
|
|||
Vue.component('tainacan-date', Date);
|
||||
Vue.component('tainacan-relationship', Relationship);
|
||||
Vue.component('tainacan-taxonomy', Taxonomy);
|
||||
|
||||
/* Metadata Option forms */
|
||||
Vue.component('tainacan-form-relationship', FormRelationship);
|
||||
Vue.component('tainacan-form-taxonomy', FormTaxonomy);
|
||||
Vue.component('tainacan-form-selectbox', FormSelectbox);
|
||||
Vue.component('tainacan-form-numeric', FormNumeric);
|
||||
Vue.component('tainacan-form-item', TainacanFormItem);
|
||||
Vue.component('tainacan-filter-item', TainacanFiltersList);
|
||||
|
||||
/* Filters */
|
||||
Vue.component('tainacan-filter-custom-interval', FilterCustomInterval);
|
||||
Vue.component('tainacan-filter-numeric', FilterNumeric);
|
||||
Vue.component('tainacan-filter-date', FilterDate);
|
||||
Vue.component('tainacan-filter-selectbox', FilterSelectbox);
|
||||
|
@ -101,9 +99,9 @@ Vue.component('tainacan-filter-numeric-list-interval', FilterNumericListInterval
|
|||
Vue.component('tainacan-filter-date-interval', FilterDateInterval);
|
||||
|
||||
/* Filter Metadata Option forms */
|
||||
Vue.component('tainacan-filter-form-numeric', FormNumeric);
|
||||
Vue.component('tainacan-filter-form-numeric-interval', FormNumericInterval);
|
||||
Vue.component('tainacan-filter-form-numeric-list-interval', FormNumericListInterval);
|
||||
Vue.component('tainacan-filter-form-numeric', FormFilterNumeric);
|
||||
Vue.component('tainacan-filter-form-numeric-interval', FormFilterNumericInterval);
|
||||
Vue.component('tainacan-filter-form-numeric-list-interval', FormFilterNumericListInterval);
|
||||
// Vue.component('tainacan-filter-form-date', FormDate);
|
||||
|
||||
/* Others */
|
||||
|
|
|
@ -5,7 +5,6 @@ import VTooltip from 'v-tooltip';
|
|||
import VueMasonry from 'vue-masonry-css';
|
||||
|
||||
// Custom elements
|
||||
import FilterCustomInterval from '../../classes/filter-types/custom-interval/CustomInterval.vue';
|
||||
import FilterNumeric from '../../classes/filter-types/numeric/Numeric.vue';
|
||||
import FilterDate from '../../classes/filter-types/date/Date.vue';
|
||||
import FilterSelectbox from '../../classes/filter-types/selectbox/Selectbox.vue';
|
||||
|
@ -44,11 +43,9 @@ Vue.use(RouterHelperPlugin);
|
|||
Vue.use(StatusHelperPlugin);
|
||||
Vue.use(ConsolePlugin, {visual: false});
|
||||
|
||||
|
||||
Vue.component('tainacan-filter-item', TaincanFiltersList);
|
||||
|
||||
/* Filters */
|
||||
Vue.component('tainacan-filter-custom-interval', FilterCustomInterval);
|
||||
Vue.component('tainacan-filter-numeric', FilterNumeric);
|
||||
Vue.component('tainacan-filter-date', FilterDate);
|
||||
Vue.component('tainacan-filter-selectbox', FilterSelectbox);
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
{{ $i18n.getWithVariables('label_view_all_%s_collections', [collectionsTotal]) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="collectionsTotal != undefined && collectionsTotal == 1"
|
||||
v-if="collectionsTotal != undefined && collectionsTotal <= 1"
|
||||
class="menu-text">
|
||||
{{ $i18n.get('label_view_collections_list') }}
|
||||
</span>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
:date-parser="(date) => dateParser(date)"
|
||||
size="is-small"
|
||||
icon="calendar-today"
|
||||
:years-range="[-50, 3]"
|
||||
:day-names="[
|
||||
$i18n.get('datepicker_short_sunday'),
|
||||
$i18n.get('datepicker_short_monday'),
|
||||
|
@ -77,6 +78,40 @@
|
|||
</p>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
style="margin-left: auto"
|
||||
class="header-item">
|
||||
<div class="control has-icons-right is-small is-clearfix">
|
||||
<b-autocomplete
|
||||
:data="users"
|
||||
:placeholder="$i18n.get('instruction_type_search_users_filter')"
|
||||
keep-first
|
||||
open-on-focus
|
||||
@input="fetchUsersForFiltering"
|
||||
@focus.once="($event) => fetchUsersForFiltering($event.target.value)"
|
||||
@select="filterActivitiesByUser"
|
||||
:loading="isFetchingUsers"
|
||||
field="name"
|
||||
icon="account">
|
||||
<template slot-scope="props">
|
||||
<div class="media">
|
||||
<div
|
||||
v-if="props.option.avatar_urls && props.option.avatar_urls['24']"
|
||||
class="media-left">
|
||||
<img
|
||||
width="24"
|
||||
:src="props.option.avatar_urls['24']">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{{ props.option.name }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="empty">{{ $i18n.get('info_no_user_found') }}</template>
|
||||
</b-autocomplete>
|
||||
</div>
|
||||
</b-field>
|
||||
|
||||
<b-field class="header-item">
|
||||
<div class="control has-icons-right is-small is-clearfix">
|
||||
<input
|
||||
|
@ -236,7 +271,10 @@
|
|||
tab: '',
|
||||
isItemLevel: false,
|
||||
searchQuery: '',
|
||||
searchDates: []
|
||||
searchDates: [],
|
||||
users: [],
|
||||
isFetchingUsers: false,
|
||||
userIdForFiltering: null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -247,7 +285,8 @@
|
|||
...mapActions('activity', [
|
||||
'fetchActivities',
|
||||
'fetchCollectionActivities',
|
||||
'fetchItemActivities'
|
||||
'fetchItemActivities',
|
||||
'fetchUsers'
|
||||
]),
|
||||
...mapGetters('activity', [
|
||||
'getActivities'
|
||||
|
@ -314,10 +353,11 @@
|
|||
|
||||
if(this.isRepositoryLevel) {
|
||||
this.fetchActivities({
|
||||
'page': this.activitiesPage,
|
||||
'activitiesPerPage': this.activitiesPerPage,
|
||||
'search': this.searchQuery,
|
||||
'searchDates': [dataInit, dataEnd]
|
||||
page: this.activitiesPage,
|
||||
activitiesPerPage: this.activitiesPerPage,
|
||||
search: this.searchQuery,
|
||||
searchDates: [dataInit, dataEnd],
|
||||
authorId: this.userIdForFiltering
|
||||
})
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
|
@ -328,11 +368,12 @@
|
|||
});
|
||||
} else if (!this.isRepositoryLevel && !this.isItemLevel) {
|
||||
this.fetchCollectionActivities({
|
||||
'page': this.activitiesPage,
|
||||
'activitiesPerPage': this.activitiesPerPage,
|
||||
'collectionId': this.$route.params.collectionId,
|
||||
'search': this.searchQuery,
|
||||
'searchDates': [dataInit, dataEnd]
|
||||
page: this.activitiesPage,
|
||||
activitiesPerPage: this.activitiesPerPage,
|
||||
collectionId: this.$route.params.collectionId,
|
||||
search: this.searchQuery,
|
||||
searchDates: [dataInit, dataEnd],
|
||||
authorId: this.userIdForFiltering
|
||||
})
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
|
@ -343,11 +384,12 @@
|
|||
});
|
||||
} else {
|
||||
this.fetchItemActivities({
|
||||
'page': this.activitiesPage,
|
||||
'activitiesPerPage': this.activitiesPerPage,
|
||||
'itemId': this.$route.params.itemId,
|
||||
'search': this.searchQuery,
|
||||
'searchDates': [dataInit, dataEnd]
|
||||
page: this.activitiesPage,
|
||||
activitiesPerPage: this.activitiesPerPage,
|
||||
itemId: this.$route.params.itemId,
|
||||
search: this.searchQuery,
|
||||
searchDates: [dataInit, dataEnd],
|
||||
authorId: this.userIdForFiltering
|
||||
})
|
||||
.then((res) => {
|
||||
this.isLoading = false;
|
||||
|
@ -390,6 +432,10 @@
|
|||
this.searchDates = null;
|
||||
this.searchActivities();
|
||||
},
|
||||
filterActivitiesByUser(user) {
|
||||
this.userIdForFiltering = user != null && user.id != undefined ? user.id : null;
|
||||
this.loadActivities();
|
||||
},
|
||||
dateFormatter(dateObject) {
|
||||
if (dateObject == null || dateObject.length == 0 || dateObject[0] == null || dateObject[1] == null)
|
||||
return "";
|
||||
|
@ -400,7 +446,21 @@
|
|||
moment(dateString[0], this.dateFormat).toDate(),
|
||||
moment(dateString[1], this.dateFormat).toDate()
|
||||
];
|
||||
}
|
||||
},
|
||||
fetchUsersForFiltering: _.debounce(function (search) {
|
||||
|
||||
this.isFetchingUsers = true;
|
||||
|
||||
this.fetchUsers({ search: search })
|
||||
.then((users) => {
|
||||
this.users = users;
|
||||
this.isFetchingUsers = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.error(error);
|
||||
this.isFetchingPages = false;
|
||||
});
|
||||
}, 500)
|
||||
},
|
||||
computed: {
|
||||
activities(){
|
||||
|
@ -485,7 +545,7 @@
|
|||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 0 !important;
|
||||
border-radius: 0px !important;
|
||||
height: 1.95rem !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -791,13 +791,20 @@
|
|||
</p>
|
||||
|
||||
<router-link
|
||||
v-if="!isSortingByCustomMetadata && !hasFiltered && (status == undefined || status == '') && !$route.query.iframemode"
|
||||
v-if="!isRepositoryLevel && !isSortingByCustomMetadata && !hasFiltered && (status == undefined || status == '') && !$route.query.iframemode"
|
||||
id="button-create-item"
|
||||
tag="button"
|
||||
class="button is-secondary"
|
||||
:to="{ path: $routerHelper.getNewItemPath(collectionId) }">
|
||||
{{ $i18n.getFrom('items', 'add_new') }}
|
||||
</router-link>
|
||||
<button
|
||||
v-else-if="isRepositoryLevel && !isSortingByCustomMetadata && !hasFiltered && (status == undefined || status == '') && !$route.query.iframemode"
|
||||
id="button-create-item"
|
||||
class="button is-secondary"
|
||||
@click="onOpenCollectionsModal">
|
||||
{{ $i18n.get('add_one_item') }}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
@ -818,7 +825,9 @@
|
|||
:active.sync="isFilterModalActive"
|
||||
:width="736"
|
||||
animation="slide-menu"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div
|
||||
ref="filters-mobile-modal"
|
||||
class="modal-inner-content"
|
||||
|
|
|
@ -796,7 +796,9 @@
|
|||
:active.sync="isFilterModalActive"
|
||||
:width="736"
|
||||
animation="slide-menu"
|
||||
trap-focus>
|
||||
trap-focus
|
||||
aria-modal
|
||||
aria-role="dialog">
|
||||
<div
|
||||
autofocus="true"
|
||||
tabindex="-1"
|
||||
|
|
|
@ -20,12 +20,17 @@
|
|||
cursor: default;
|
||||
}
|
||||
}
|
||||
&>.control.has-icons-left .icon {
|
||||
height: 2.125rem;
|
||||
width: 2.125rem;
|
||||
}
|
||||
.dropdown-menu {
|
||||
padding: 0px;
|
||||
margin-top: 0;
|
||||
border-radius: 0px;
|
||||
min-width: 6rem;
|
||||
border: none;
|
||||
z-index: 99;
|
||||
|
||||
.dropdown-content {
|
||||
padding: 0px;
|
||||
|
@ -50,6 +55,9 @@
|
|||
.is-small { color: $gray4; }
|
||||
&.is-active { background-color: $turquoise2; }
|
||||
|
||||
.media {
|
||||
align-items: center;
|
||||
|
||||
.media-left {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
@ -67,8 +75,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.is-mobile-modal {
|
||||
@media screen and (max-width: 1088px) {
|
||||
@media screen and (max-width: 768px) {
|
||||
.dropdown-content {
|
||||
max-height: 100vh;
|
||||
}
|
||||
|
@ -130,16 +139,16 @@
|
|||
.tag {
|
||||
background: white;
|
||||
padding-right: 0;
|
||||
padding-left: 0.5em;
|
||||
padding-left: 0.6em;
|
||||
|
||||
&.is-delete {
|
||||
color: $gray4;
|
||||
&::after {
|
||||
height: 30% !important;
|
||||
height: 47% !important;
|
||||
width: 1px !important;
|
||||
}
|
||||
&::before {
|
||||
width: 30% !important;
|
||||
width: 47% !important;
|
||||
height: 1px !important;
|
||||
}
|
||||
&:hover, &:focus {
|
||||
|
@ -278,7 +287,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1024px) {
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
.datepicker-header {
|
||||
margin-bottom: 0.5rem;
|
||||
|
|
|
@ -1,17 +1,37 @@
|
|||
.input, .textarea {
|
||||
input[type="color"].input,
|
||||
input[type="date"].input,
|
||||
input[type="datetime-local"].input,
|
||||
input[type="datetime"].input,
|
||||
input[type="email"].input,
|
||||
input[type="number"].input,
|
||||
input[type="month"].input,
|
||||
input[type="password"].input,
|
||||
input[type="search"].input,
|
||||
input[type="tel"].input,
|
||||
input[type="text"].input,
|
||||
input[type="time"].input,
|
||||
input[type="url"].input,
|
||||
input[type="week"].input,
|
||||
input.input,
|
||||
.input,
|
||||
textarea.textarea,
|
||||
.textarea {
|
||||
font-size: 0.875rem;
|
||||
border-radius: 1px !important;
|
||||
box-shadow: none !important;
|
||||
background-color: white;
|
||||
border: 1px solid $gray2;
|
||||
color: $tainacan-input-color;
|
||||
transition: background-color 0.1s, border 0.3s;
|
||||
transition: background-color 0.1s ease, border-color 0.3s ease;
|
||||
|
||||
&:focus, &:active {
|
||||
box-shadow: none !important;
|
||||
background-color: white;
|
||||
border: 1px solid $gray4 !important;
|
||||
}
|
||||
&:hover {
|
||||
border: 1px solid $gray3;
|
||||
}
|
||||
&[disabled] {
|
||||
color: $gray4 !important;
|
||||
background-color: $gray2 !important;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
height: 30px;
|
||||
}
|
||||
select {
|
||||
background: transparent; // WordPress 5.3 adds arrows here
|
||||
border: none;
|
||||
border-radius: 1px !important;
|
||||
font-weight: normal;
|
||||
|
@ -16,14 +17,14 @@
|
|||
margin-bottom: 0px !important;
|
||||
color: $tainacan-input-color;
|
||||
option:checked, option:hover {
|
||||
background-color: $gray2 !important;
|
||||
background: $gray2 !important;
|
||||
}
|
||||
&:focus, &:active {
|
||||
box-shadow: none !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
&[disabled=disabled] {
|
||||
background-color: white !important;
|
||||
background: $gray1 !important;
|
||||
}
|
||||
}
|
||||
&:not(.is-loading)::after {
|
||||
|
|
|
@ -6,12 +6,9 @@
|
|||
margin-right: 0.375rem;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
transition: all 0.2s ease;
|
||||
animation-name: appear;
|
||||
animation-duration: 0.2s;
|
||||
|
||||
&:hover, &:hover .tag {
|
||||
background-color: $gray2;
|
||||
}
|
||||
animation-duration: 0.3s;
|
||||
|
||||
.tag {
|
||||
background-color: white;
|
||||
|
@ -22,6 +19,8 @@
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
animation-name: appear;
|
||||
animation-duration: 0.3s;
|
||||
|
||||
&.is-delete,
|
||||
&.is-delete:hover,
|
||||
|
@ -29,12 +28,28 @@
|
|||
&.is-delete:active {
|
||||
border-radius: 50px !important;
|
||||
border-radius: 50px !important;
|
||||
margin-right: 0px !important;
|
||||
color: $gray4;
|
||||
background-color: transparent;
|
||||
background-color: white;
|
||||
transition: border-width 0.15s linear, background-color 0.15s linear;
|
||||
|
||||
&:hover {
|
||||
background-color: transparent;
|
||||
color: $gray4;
|
||||
&:after,
|
||||
&:before {
|
||||
transition: transform 0.15s linear;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
border: solid 1px $gray3 !important;
|
||||
background-color: $gray2;
|
||||
color: $gray5;
|
||||
|
||||
&:after {
|
||||
transform: translateX(-50%) translateY(-50%) rotate(45deg) scale(1.15);
|
||||
}
|
||||
&:before {
|
||||
transform: translateX(-50%) translateY(-50%) rotate(45deg) scale(1.15);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
}
|
||||
.b-numberinput {
|
||||
height: 30px;
|
||||
padding: 0 !important;
|
||||
|
||||
.control {
|
||||
margin-right: 0 !important;
|
||||
|
@ -62,6 +63,7 @@
|
|||
button,
|
||||
input {
|
||||
height: 30px !important;
|
||||
text-align: start;
|
||||
}
|
||||
button.is-primary,
|
||||
button.is-primary:hover,
|
||||
|
|
|
@ -111,8 +111,9 @@ $addColors: (
|
|||
);
|
||||
$colors: map-merge($colors, $addColors);
|
||||
|
||||
// Small size
|
||||
// Bulma Variables
|
||||
$size-small: 0.85em; // 0.75em on Bulma.
|
||||
$dropdown-mobile-breakpoint: $tablet;
|
||||
|
||||
// Tainacan Header and side menus
|
||||
$header-height: 52px;
|
||||
|
@ -120,7 +121,7 @@ $subheader-height: 42px;
|
|||
$side-menu-width: 160px;
|
||||
$filter-menu-width: 16.666666667%;
|
||||
$filter-menu-width-theme: 20.833333333%;
|
||||
$page-height: calc(100% - 94px);
|
||||
$page-height: calc(100vh - 94px);
|
||||
|
||||
// Overall Pages padding:
|
||||
$page-side-padding: 4.166666667%;//82px;
|
||||
|
@ -149,11 +150,19 @@ $table-foot-cell-border-width: 1px 0 0 !important;
|
|||
$table-cell-padding: 1.0em 0.75em;
|
||||
|
||||
// Roboto font
|
||||
$family-sans-serif: 'Roboto', sans-serif;
|
||||
$family-sans-serif: 'Roboto', 'Source Sans', 'Helvetica', sans-serif;
|
||||
|
||||
// Bulma's modal (needs to be greather than tainacan-admin-app)
|
||||
$modal-z: 9999999;
|
||||
|
||||
// Grid mixin for display: grid compatibility
|
||||
@mixin display-grid {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
}
|
||||
|
||||
// A copy of bootstrap's screen reader only class to be used for accessibility.
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
.tainacan-cards-container {
|
||||
min-height: 50vh;
|
||||
padding: 0;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
@include display-grid;
|
||||
-ms-grid-columns: 455px 455px;
|
||||
grid-template-columns: repeat(auto-fill, 455px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -11,6 +11,7 @@
|
|||
|
||||
@media screen and (max-width: 480px) {
|
||||
width: 91.666666667%;
|
||||
-ms-grid-columns: 100%;
|
||||
grid-template-columns: repeat(auto-fill, 100%);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
.tainacan-grid-container {
|
||||
min-height: 50vh;
|
||||
padding: 0;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
@include display-grid;
|
||||
grid-template-columns: repeat(auto-fill, 285px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
|
|
@ -96,8 +96,10 @@ a:hover {
|
|||
text-decoration: underline;
|
||||
}
|
||||
.add-link {
|
||||
display: inline;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
font-size: 0.75rem;
|
||||
margin: 3px 0 6px 0;
|
||||
&.disabled {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
|
@ -107,6 +109,9 @@ a:hover {
|
|||
color: $gray2 !important;
|
||||
}
|
||||
}
|
||||
.tainacan-icon::before {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
// Generic page container
|
||||
|
|
|
@ -200,7 +200,9 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'label_select_taxonomy_input_type' => __( 'Input type', 'tainacan' ),
|
||||
'label_taxonomy_allow_new_terms' => __( 'Allow new terms', 'tainacan' ),
|
||||
'label_selectbox_init' => __( 'Select', 'tainacan' ),
|
||||
'label_options' => __( 'Insert options', 'tainacan' ),
|
||||
'label_insert_options' => __( 'Insert options', 'tainacan'),
|
||||
'label_available_terms' => __( 'Available terms', 'tainacan' ),
|
||||
'label_some_available_terms' => __( 'Some available terms', 'tainacan' ),
|
||||
'label_attachments' => __( 'Attachments', 'tainacan' ),
|
||||
'label_attachment' => __( 'Attachment', 'tainacan' ),
|
||||
'label_enabled' => __( 'Enabled', 'tainacan' ),
|
||||
|
@ -213,6 +215,7 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'label_parent_term' => __( 'Parent Term', 'tainacan' ),
|
||||
'label_children_terms' => __( 'children terms', 'tainacan' ),
|
||||
'label_new_term' => __( 'Create New Term', 'tainacan' ),
|
||||
'label_create_and_select' => __( 'Create and Select', 'tainacan' ),
|
||||
'label_new_child' => __( 'New Child', 'tainacan' ),
|
||||
'label_taxonomy_terms' => __( 'Taxonomy Terms', 'tainacan' ),
|
||||
'label_no_parent_term' => __( 'No parent term', 'tainacan' ),
|
||||
|
@ -348,6 +351,7 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'label_show_metadata' => __( 'Show metadata', 'tainacan' ),
|
||||
'label_all_terms' => __( 'All terms', 'tainacan' ),
|
||||
'label_selected_terms' => __( 'Selected terms', 'tainacan' ),
|
||||
'label_selected_term' => __( 'Selected term', 'tainacan' ),
|
||||
'label_all_metadatum_values' => __( 'All metadatum values', 'tainacan' ),
|
||||
'label_selected_metadatum_values' => __( 'Selected metadatum values', 'tainacan' ),
|
||||
'label_editing_item_number' => __( 'Editing item n.', 'tainacan' ),
|
||||
|
@ -451,6 +455,7 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'instruction_select_a_metadatum' => __( 'Select a metadatum', 'tainacan' ),
|
||||
'instruction_cover_page' => __( 'Type to search a Page to choose.', 'tainacan' ),
|
||||
'instruction_moderators' => __( 'Type to search a User to add.', 'tainacan' ),
|
||||
'instruction_type_search_users_filter' => __( 'Type to search users to filter...', 'tainacan' ),
|
||||
'instruction_select_a_parent_collection' => __( 'Select a parent collection.', 'tainacan' ),
|
||||
'instruction_select_collection_thumbnail' => __( 'Select a thumbnail image for collection', 'tainacan' ),
|
||||
'instruction_select_item_thumbnail' => __( 'Select a thumbnail image for item', 'tainacan' ),
|
||||
|
@ -534,7 +539,7 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'info_no_terms_created_on_taxonomy' => __( 'No term was created for this taxonomy.', 'tainacan' ),
|
||||
'info_no_terms_found' => __( 'No term was found here', 'tainacan' ),
|
||||
'info_no_more_terms_found' => __( 'No more terms found', 'tainacan' ),
|
||||
'info_no_item_created' => __( 'No item was created in this collection.', 'tainacan' ),
|
||||
'info_no_item_created' => __( 'No item was created so far.', 'tainacan' ),
|
||||
'info_no_page_found' => __( 'No page was found with this name.', 'tainacan' ),
|
||||
'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ),
|
||||
'info_no_item_found_filter' => __( 'No item was found here with these filters.', 'tainacan' ),
|
||||
|
@ -570,6 +575,7 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'info_showing_taxonomies' => __( 'Showing taxonomies ', 'tainacan' ),
|
||||
'info_showing_activities' => __( 'Showing activities ', 'tainacan' ),
|
||||
'info_showing_processes' => __( 'Showing processes ', 'tainacan' ),
|
||||
'info_showing_terms' => __( 'Showing terms ', 'tainacan' ),
|
||||
'info_warning_remove_from_trash_first' => __( 'Remove this item from trash first' ),
|
||||
'info_to' => __( ' to ', 'tainacan' ),
|
||||
'info_of' => __( ' of ', 'tainacan' ),
|
||||
|
@ -584,7 +590,7 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'info_warning_taxonomy_not_saved' => __( 'Are you sure? The taxonomy is not saved, changes will be lost.', 'tainacan' ),
|
||||
'info_warning_terms_not_saved' => __( 'Are you sure? There are terms not saved, changes will be lost.', 'tainacan' ),
|
||||
'info_warning_orphan_terms' => __( 'Are you sure? This term is parent of other terms. These will be converted to root terms.', 'tainacan' ),
|
||||
'info_no_activities' => __( 'No activities', 'tainacan' ),
|
||||
'info_no_activities' => __( 'No activities yet.', 'tainacan' ),
|
||||
'info_logs_before' => __( 'Before', 'tainacan' ),
|
||||
'info_logs_after' => __( 'After', 'tainacan' ),
|
||||
'info_there_is_no_metadatum' => __( 'There is no metadata here yet.', 'tainacan' ),
|
||||
|
@ -669,31 +675,6 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'info_show_interval_on_tag' => __( 'Show applied interval on tags', 'tainacan' ),
|
||||
'info_title_mapping' => __( 'The title is the most relevant metadata, that shall identify your item on lists for different view modes. Select the title source metadata first, or skip to continue manual mapping.', 'taincan'),
|
||||
|
||||
// Tainacan Metadatum Types
|
||||
'tainacan-text' => __( 'Text', 'tainacan' ),
|
||||
'tainacan-textarea' => __( 'Text area', 'tainacan' ),
|
||||
'tainacan-date' => __( 'Date', 'tainacan' ),
|
||||
'tainacan-numeric' => __( 'Numeric', 'tainacan' ),
|
||||
'tainacan-selectbox' => __( 'Select box', 'tainacan' ),
|
||||
'tainacan-relationship' => __( 'Relationship', 'tainacan' ),
|
||||
'tainacan-taxonomy' => __( 'Taxonomy', 'tainacan' ),
|
||||
'tainacan-compound' => __( 'Compound', 'tainacan' ),
|
||||
|
||||
// Tainacan Filter Types
|
||||
'tainacan-filter-custom-interval' => __( 'Custom Interval', 'tainacan' ),
|
||||
'tainacan-filter-numeric' => __( 'Numeric', 'tainacan' ),
|
||||
'tainacan-filter-date' => __( 'Date', 'tainacan' ),
|
||||
'tainacan-filter-selectbox' => __( 'Select Box', 'tainacan' ),
|
||||
'tainacan-filter-autocomplete' => __( 'Autocomplete', 'tainacan' ),
|
||||
'tainacan-filter-taginput' => __( 'Tag Input', 'tainacan' ),
|
||||
'tainacan-filter-checkbox' => __( 'Check Box', 'tainacan' ),
|
||||
'tainacan-filter-taxonomy-taginput' => __( 'Taxonomy Tag Input', 'tainacan' ),
|
||||
'tainacan-filter-taxonomy-checkbox' => __( 'Taxonomy Check Box', 'tainacan' ),
|
||||
'tainacan-filter-taxonomy-selectbox' => __( 'Taxonomy Select Box', 'tainacan' ),
|
||||
'tainacan-filter-numeric-interval' => __( 'Numeric Interval', 'tainacan' ),
|
||||
'tainacan-filter-date-interval' => __( 'Date Interval', 'tainacan' ),
|
||||
'tainacan-filter-numeric-list-interval' => __( 'Numeric Interval List', 'tainacan' ),
|
||||
|
||||
// Datepicker months
|
||||
'datepicker_month_january' => __( 'January', 'tainacan' ),
|
||||
'datepicker_month_february' => __( 'February', 'tainacan' ),
|
||||
|
|
|
@ -66,7 +66,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'name' => 'title',
|
||||
'title' => 'title',
|
||||
'id' => 'p',
|
||||
'authorid' => 'author_id',
|
||||
'authorid' => 'author',
|
||||
'authorname' => 'author_name',
|
||||
'search' => 's',
|
||||
'searchterm' => 'search',
|
||||
|
@ -165,6 +165,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
$terms = get_terms([
|
||||
'taxonomy' => $tax_query['taxonomy'],
|
||||
'fields' => 'ids',
|
||||
'hide_empty' => isset($args['hide_empty']) ? $args['hide_empty'] : true,
|
||||
'search' => $tax_query['terms']
|
||||
]);
|
||||
|
||||
|
@ -179,6 +180,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
$terms = get_terms([
|
||||
'taxonomy' => $tax_query['taxonomy'],
|
||||
'fields' => 'ids',
|
||||
'hide_empty' => isset($args['hide_empty']) ? $args['hide_empty'] : true,
|
||||
'search' => $tax_query['terms']
|
||||
]);
|
||||
if ($terms) {
|
||||
|
@ -270,11 +272,11 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
*/
|
||||
public function get_fetch_only_param(){
|
||||
return [
|
||||
'fetch_only' => [
|
||||
'fetch_only' => array(
|
||||
'type' => 'string/array',
|
||||
'description' => __( 'Fetch only specific attribute. The specifics attributes are the same in schema.', 'tainacan' ),
|
||||
//TODO: explicar o fetch only meta.. cabe aqui?
|
||||
]
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -286,11 +288,22 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
* @return array|void
|
||||
*/
|
||||
public function get_wp_query_params(){
|
||||
|
||||
$query_params['id'] = array(
|
||||
'description' => __("Limit result to objects with specific id.", 'tainacan'),
|
||||
'type' => 'integer',
|
||||
);
|
||||
|
||||
$query_params['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'description' => 'The context in which the request is made.',
|
||||
'enum' => array(
|
||||
'view',
|
||||
'edit'
|
||||
),
|
||||
);
|
||||
|
||||
$query_params['search'] = array(
|
||||
'description' => __( 'Limit results to those matching a string.', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
|
@ -300,10 +313,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
|
||||
$query_params['authorid'] = array(
|
||||
'description' => __("Limit result set to objects assigned to specific authors by id.", 'tainacan'),
|
||||
'type' => 'array',
|
||||
'items' => array(
|
||||
'type' => 'integer',
|
||||
),
|
||||
);
|
||||
|
||||
$query_params['authorname'] = array(
|
||||
|
@ -329,7 +339,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'description' => __( 'Order sort attribute ascending or descending.', 'tainacan' ),
|
||||
'type' => 'string/array',
|
||||
'default' => 'desc',
|
||||
'enum' => array( 'asc', 'desc' ),
|
||||
'enum' => array( 'asc', 'desc', 'ASC', 'DESC' ),
|
||||
);
|
||||
|
||||
$query_params['orderby'] = array(
|
||||
|
@ -387,8 +397,26 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
),
|
||||
'metacompare' => array(
|
||||
'type' => 'string',
|
||||
'description' => __('Operator to test the meta_value. Possible values are =, !=, >, >=, <, <=, LIKE, NOT LIKE, IN, NOT IN, BETWEEN, NOT BETWEEN, NOT EXISTS, REGEXP, NOT REGEXP or RLIKE.'),
|
||||
'description' => __('Operator to test the metavalue'),
|
||||
'default' => '=',
|
||||
'enum' => array(
|
||||
'=',
|
||||
'!=',
|
||||
'>',
|
||||
'>=',
|
||||
'<',
|
||||
'<=',
|
||||
'LIKE',
|
||||
'NOT LIKE',
|
||||
'IN',
|
||||
'NOT IN',
|
||||
'BETWEEN',
|
||||
'NOT BETWEEN',
|
||||
'NOT EXISTS',
|
||||
'REGEXP',
|
||||
'NOT REGEXP',
|
||||
'RLIKE'
|
||||
)
|
||||
),
|
||||
'metaquery' => array(
|
||||
'description' => __('Limits result set to items that have specific custom metadata'),
|
||||
|
@ -406,8 +434,24 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
),
|
||||
'compare' => array(
|
||||
'type' => 'string',
|
||||
'description' => __('Operator to test. Possible values are =, !=, >, >=, <, <=, LIKE, NOT LIKE, IN, NOT IN, BETWEEN, NOT BETWEEN, EXISTS and NOT EXISTS.'),
|
||||
'default' => '='
|
||||
'description' => __('Operator to test.'),
|
||||
'default' => '=',
|
||||
'enum' => array(
|
||||
'=',
|
||||
'!=',
|
||||
'>',
|
||||
'>=',
|
||||
'<',
|
||||
'<=',
|
||||
'LIKE',
|
||||
'NOT LIKE',
|
||||
'IN',
|
||||
'NOT IN',
|
||||
'BETWEEN',
|
||||
'NOT BETWEEN',
|
||||
'EXISTS',
|
||||
'NOT EXISTS'
|
||||
)
|
||||
),
|
||||
'relation' => array(
|
||||
'type' => 'string',
|
||||
|
@ -457,8 +501,24 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
),
|
||||
'compare' => array(
|
||||
'type' => 'string',
|
||||
'description' => __('Operator to test. Possible values are =, !=, >, >=, <, <=, LIKE, NOT LIKE, IN, NOT IN, BETWEEN, NOT BETWEEN, EXISTS and NOT EXISTS.'),
|
||||
'default' => '='
|
||||
'description' => __('Operator to test.'),
|
||||
'default' => '=',
|
||||
'enum' => array(
|
||||
'=',
|
||||
'!=',
|
||||
'>',
|
||||
'>=',
|
||||
'<',
|
||||
'<=',
|
||||
'LIKE',
|
||||
'NOT LIKE',
|
||||
'IN',
|
||||
'NOT IN',
|
||||
'BETWEEN',
|
||||
'NOT BETWEEN',
|
||||
'EXISTS',
|
||||
'NOT EXISTS'
|
||||
)
|
||||
),
|
||||
'dayofweek' => array('type' => 'array'),
|
||||
'inclusive' => array(
|
||||
|
@ -488,7 +548,14 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
),
|
||||
'metadatum' => array(
|
||||
'type' => 'string',
|
||||
'description' => __('Select taxonomy term by. Possible values are term_id, name, slug or term_taxonomy_id. Default value is term_id.')
|
||||
'default' => 'term_id',
|
||||
'description' => __('Select taxonomy term by'),
|
||||
'enum' => array(
|
||||
'term_id',
|
||||
'name',
|
||||
'slug',
|
||||
'term_taxonomy_id'
|
||||
)
|
||||
),
|
||||
'terms' => array(
|
||||
'type' => 'int/string/array',
|
||||
|
@ -496,13 +563,24 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
),
|
||||
'operator' => array(
|
||||
'type' => 'string',
|
||||
'description' => __('Operator to test. Possible values are IN, NOT IN, AND, EXISTS and NOT EXISTS'),
|
||||
'default' => 'IN'
|
||||
'description' => __('Operator to test.'),
|
||||
'default' => 'IN',
|
||||
'enum' => array(
|
||||
'IN',
|
||||
'NOT IN',
|
||||
'AND',
|
||||
'EXISTS',
|
||||
'NOT EXISTS'
|
||||
)
|
||||
),
|
||||
'relation' => array(
|
||||
'type' => 'string',
|
||||
'description' => __('The logical relationship between each inner taxonomy array when there is more than one. Possible values are AND, OR. Do not use with a single inner taxonomy array.'),
|
||||
'default' => 'AND'
|
||||
'description' => __('The logical relationship between each inner taxonomy array when there is more than one. Do not use with a single inner taxonomy array.'),
|
||||
'default' => 'AND',
|
||||
'enum' => array(
|
||||
'AND',
|
||||
'OR'
|
||||
)
|
||||
),
|
||||
),
|
||||
'type' => 'array'
|
||||
|
|
|
@ -42,23 +42,33 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
],
|
||||
'all_users' => [
|
||||
'type' => 'bool',
|
||||
'description' => __( 'Whether to return processes from all users (if current user is admin). Default false.', 'tainacan' ),
|
||||
'description' => __( 'Whether to return processes from all users (if current user is admin).', 'tainacan' ),
|
||||
'default' => false,
|
||||
],
|
||||
'status' => [
|
||||
'type' => 'string',
|
||||
'description' => __( '"open" returns only processes currently running. "closed" returns only finished or aborted. "all" returns all. Default "all"', 'tainacan' ),
|
||||
'description' => __( '"open" returns only processes currently running. "closed" returns only finished or aborted. "all" returns all.', 'tainacan' ),
|
||||
'default' => 'all',
|
||||
'enum' => array(
|
||||
'open',
|
||||
'closed',
|
||||
'all'
|
||||
)
|
||||
],
|
||||
'perpage' => [
|
||||
'type' => 'integer',
|
||||
'description' => __( 'Number of processes to return per page. Default 10', 'tainacan' ),
|
||||
'description' => __( 'Number of processes to return per page', 'tainacan' ),
|
||||
'default' => 10,
|
||||
],
|
||||
'paged' => [
|
||||
'type' => 'integer',
|
||||
'description' => __( 'Page to retrieve. Default 1', 'tainacan' ),
|
||||
'description' => __( 'Page to retrieve', 'tainacan' ),
|
||||
'default' => 1
|
||||
],
|
||||
'recent' => [
|
||||
'type' => 'bool',
|
||||
'description' => __( 'Returns only processes created or updated recently', 'tainacan' ),
|
||||
'default' => false
|
||||
],
|
||||
],
|
||||
),
|
||||
|
@ -82,6 +92,10 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
'status' => [
|
||||
'type' => 'string',
|
||||
'description' => __( '"open" or "closed" ', 'tainacan' ),
|
||||
'enum' => array(
|
||||
'open',
|
||||
'closed'
|
||||
)
|
||||
]
|
||||
],
|
||||
),
|
||||
|
@ -141,7 +155,7 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
$user_q = $wpdb->prepare("AND user_id = %d", $request['user_id']);
|
||||
}
|
||||
|
||||
if ( isset($user_q['all_users']) && $user_q['all_users'] ) {
|
||||
if ( isset($request['all_users']) && $request['all_users'] ) {
|
||||
$user_q = "";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -455,9 +455,6 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
* @return array|void
|
||||
*/
|
||||
public function get_create_params($object_name = null) {
|
||||
$query_params['context']['default'] = 'view';
|
||||
|
||||
array_merge($query_params, parent::get_wp_query_params());
|
||||
|
||||
$query_params['title'] = array(
|
||||
'description' => __('Limits the result set to items with a specific title'),
|
||||
|
@ -477,7 +474,11 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
'description' => __( 'Whether to use the current query to select posts', 'tainacan' ),
|
||||
];
|
||||
|
||||
$query_params = array_merge($query_params, parent::get_meta_queries_params());
|
||||
$query_params = array_merge(
|
||||
$query_params,
|
||||
parent::get_wp_query_params(),
|
||||
parent::get_meta_queries_params()
|
||||
);
|
||||
|
||||
return $query_params;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_items'),
|
||||
'permission_callback' => array($this, 'get_items_permissions_check'),
|
||||
'args' => $this->get_wp_query_params(),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::CREATABLE,
|
||||
|
@ -58,7 +58,7 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission_callback' => array($this, 'get_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
|
||||
'args' => $this->get_wp_query_params(),
|
||||
|
||||
),
|
||||
array(
|
||||
|
@ -73,8 +73,8 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
'permission_callback' => array($this, 'delete_item_permissions_check'),
|
||||
'args' => array(
|
||||
'permanently' => array(
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as true. By default this will only trash collection'),
|
||||
'default' => 'false'
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as 1. By default this will only trash collection'),
|
||||
'default' => '0',
|
||||
),
|
||||
)
|
||||
),
|
||||
|
@ -478,12 +478,6 @@ class REST_Collections_Controller extends REST_Controller {
|
|||
$endpoint_args = [];
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
|
||||
$endpoint_args['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'items' => array( 'view, edit' )
|
||||
);
|
||||
|
||||
$endpoint_args['name'] = array(
|
||||
'description' => __('Limits the result set to collections with a specific name'),
|
||||
'type' => 'string',
|
||||
|
|
|
@ -1,336 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Tainacan\API\EndPoints;
|
||||
|
||||
use \Tainacan\API\REST_Controller;
|
||||
use Tainacan\Entities;
|
||||
use Tainacan\Repositories;
|
||||
use Tainacan\Entities\Entity;
|
||||
use Tainacan\Tests\TAINACAN_REST_Collections_Controller;
|
||||
|
||||
class REST_Export_Controller extends REST_Controller {
|
||||
private $item_metadata_repository;
|
||||
private $items_repository;
|
||||
private $collection_repository;
|
||||
private $metadatum_repository;
|
||||
|
||||
public function __construct() {
|
||||
$this->rest_base = 'export';
|
||||
parent::__construct();
|
||||
add_action('init', array(&$this, 'init_objects'), 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize objects after post_type register
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function init_objects() {
|
||||
$this->metadatum_repository = Repositories\Metadata::get_instance();
|
||||
$this->item_metadata_repository = Repositories\Item_Metadata::get_instance();
|
||||
$this->items_repository = Repositories\Items::get_instance();
|
||||
$this->collection_repository = Repositories\Collections::get_instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* If POST on metadatum/collection/<collection_id>, then
|
||||
* a metadatum will be created in matched collection and all your item will receive this metadatum
|
||||
*
|
||||
* If POST on metadatum/item/<item_id>, then a value will be added in a metadatum and metadatum passed
|
||||
* id body of requisition
|
||||
*
|
||||
* Both of GETs return the metadatum of matched objects
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function register_routes() {
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base. '/collection/(?P<collection_id>[\d]+)',
|
||||
array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_items'),
|
||||
'permission_callback' => array($this, 'get_items_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
|
||||
),
|
||||
)
|
||||
);
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base. '/item/(?P<item_id>[\d]+)',
|
||||
array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission_callback' => array($this, 'get_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
|
||||
),
|
||||
)
|
||||
);
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base,
|
||||
array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_items'),
|
||||
'permission_callback' => array($this, 'get_items_permissions_check'),
|
||||
'args' => $this->get_wp_query_params(),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \WP_REST_Request $request
|
||||
*
|
||||
* @return \WP_Error|\WP_REST_Response
|
||||
*/
|
||||
public function get_item( $request ) { }
|
||||
|
||||
/**
|
||||
* @param \WP_REST_Request $request
|
||||
*
|
||||
* @return bool|\WP_Error
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function get_item_permissions_check( $request ) {
|
||||
if(isset($request['collection_id'])) {
|
||||
$collection = $this->collection_repository->fetch($request['collection_id']);
|
||||
if($collection instanceof Entities\Collection) {
|
||||
if (! $collection->can_read()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} elseif(isset($request['item_id'])) {
|
||||
$item = $this->items_repository->fetch($request['item_id']);
|
||||
if($item instanceof Entities\Item) {
|
||||
if (! $item->can_read()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else { // Exporting all
|
||||
$dummy = new Entities\Collection();
|
||||
return current_user_can($dummy->get_capabilities()->read); // Need to check Colletion by collection
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Tainacan\Entities\Item $item
|
||||
* @param \WP_REST_Request $request
|
||||
*
|
||||
* @return array|\WP_Error|\WP_REST_Response
|
||||
*/
|
||||
public function prepare_item_for_response( $item, $request ) {
|
||||
$items_metadata = $item->get_metadata();
|
||||
|
||||
$prepared_item = [];
|
||||
|
||||
foreach ($items_metadata as $item_metadata){
|
||||
$prepared_item[] = $item_metadata->_toArray();
|
||||
}
|
||||
|
||||
return $prepared_item;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param \WP_REST_Request $request
|
||||
* @param \WP_Query|Entities\Item $query
|
||||
* @param array $args
|
||||
* @return \WP_Error|number
|
||||
*/
|
||||
public function export($request, $query, $args) {
|
||||
|
||||
$type = \Tainacan\Exposers_Handler::request_has_type($request);
|
||||
$path = wp_upload_dir();
|
||||
$path = $path['path'];
|
||||
$filename = $path.date('YmdHis').'-tainacan-export.'.$type->get_extension();
|
||||
$pid = -1;
|
||||
|
||||
$log = \Tainacan\Entities\Log::create(
|
||||
__('Export Process', 'tainacan'),
|
||||
__('Exporting Data', 'tainacan').'\nArgs: '.print_r($args, true),
|
||||
['file' => $filename],
|
||||
[],
|
||||
'processing'
|
||||
);
|
||||
|
||||
$body = json_decode( $request->get_body(), true );
|
||||
$background = ! (isset($body['export-background']) && $body['export-background'] == false);
|
||||
if( $background ) {
|
||||
$pid = pcntl_fork();
|
||||
} else {
|
||||
$pid = true;
|
||||
}
|
||||
if ($pid === -1) {
|
||||
$error = new \WP_Error('could not fork');
|
||||
$log = \Tainacan\Entities\Log::create(
|
||||
__('Export Process Error', 'tainacan'),
|
||||
__('Exporting Error', 'tainacan').'\\nArgs: '.print_r($args, true).'\\nError: could not fork',
|
||||
$error,
|
||||
[],
|
||||
'error'
|
||||
);
|
||||
remove_filter( 'rest_request_after_callbacks', [\Tainacan\Exposers_Handler::get_instance(), 'rest_request_after_callbacks'], 10, 3 ); //exposer mapping
|
||||
remove_filter( 'tainacan-rest-response', [\Tainacan\Exposers_Handler::get_instance(), 'rest_response'], 10, 2 ); // exposer types
|
||||
return $log;
|
||||
} elseif ($pid) { // we are the parent or run at foreground
|
||||
try {
|
||||
ignore_user_abort(true);
|
||||
set_time_limit(0);
|
||||
ini_set("memory_limit", "256M");
|
||||
|
||||
if($background) { // wait for child to respond and exit and reconnect database if is forked
|
||||
$status = null;
|
||||
pcntl_wait($status);
|
||||
global $wpdb;
|
||||
$wpdb->db_connect();
|
||||
}
|
||||
|
||||
$response = [];
|
||||
if(isset($request['collection_id'])) { // One Colletion
|
||||
$collection_id = $request['collection_id'];
|
||||
$items = $query;
|
||||
if ($items->have_posts()) {
|
||||
while ( $items->have_posts() ) { //TODO write line by line
|
||||
$items->the_post();
|
||||
|
||||
$item = new Entities\Item($items->post);
|
||||
|
||||
$prepared_item = $this->prepare_item_for_response($item, $request);
|
||||
|
||||
array_push($response, $prepared_item);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
}
|
||||
} elseif (isset($request['item_id'])) { // One Item
|
||||
|
||||
$item = new Entities\Item($request['item_id']);
|
||||
if($item->get_id() > 0) {
|
||||
$prepared_item = $this->prepare_item_for_response($item, $request);
|
||||
|
||||
$response = [$prepared_item];
|
||||
}
|
||||
} else { // Export All
|
||||
$collections = $query;
|
||||
$collection_controller = new REST_Collections_Controller();
|
||||
if ($collections->have_posts()) {
|
||||
while ($collections->have_posts()) {
|
||||
$collections->the_post();
|
||||
$collection_id = $collections->post->ID;
|
||||
$collection = \Tainacan\Repositories\Repository::get_entity_by_post($collections->post);
|
||||
|
||||
$prepared_collection = $collection_controller->prepare_item_for_response($collection, $request);
|
||||
|
||||
$prepared_items = [];
|
||||
|
||||
$items = $this->items_repository->fetch($args, $collection_id, 'WP_Query');
|
||||
if ($items->have_posts()) {
|
||||
while ( $items->have_posts() ) { //TODO write line by line
|
||||
$items->the_post();
|
||||
|
||||
$item = new Entities\Item($items->post);
|
||||
|
||||
$prepared_item = $this->prepare_item_for_response($item, $request);
|
||||
|
||||
array_push($prepared_items, $prepared_item);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
}
|
||||
|
||||
$prepared_collection['items'] = $prepared_items;
|
||||
array_push($prepared_collection, $response);
|
||||
}
|
||||
wp_reset_postdata();
|
||||
}
|
||||
}
|
||||
|
||||
$rest_response = new \WP_REST_Response(apply_filters('tainacan-rest-response', $response, $request));
|
||||
$data = $rest_response->get_data();
|
||||
file_put_contents($filename, is_string($data) ? $data : print_r($data, true));
|
||||
|
||||
if($background) {
|
||||
$log->set_status('publish');
|
||||
$logs = \Tainacan\Repositories\Logs::get_instance();
|
||||
$logs->update($log);
|
||||
exit(1);
|
||||
} else {
|
||||
return $rest_response->get_data();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
if($background) {
|
||||
exit(1);
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
} else { // we are the child
|
||||
|
||||
remove_filter( 'rest_request_after_callbacks', [\Tainacan\Exposers_Handler::get_instance(), 'rest_request_after_callbacks'], 10, 3 ); //exposer mapping
|
||||
remove_filter( 'tainacan-rest-response', [\Tainacan\Exposers_Handler::get_instance(), 'rest_response'], 10, 2 ); // exposer types
|
||||
return $log;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \WP_REST_Request $request
|
||||
*
|
||||
* @return \WP_Error|\WP_REST_Response
|
||||
*/
|
||||
public function get_items( $request ) {
|
||||
$args = $this->prepare_filters($request); // TODO default args
|
||||
$rest_response = new \WP_REST_Response([], 200); // TODO error, empty response
|
||||
|
||||
if(isset($request['collection_id'])) { // One Colletion
|
||||
$collection_id = $request['collection_id'];
|
||||
$items = $this->items_repository->fetch($args, $collection_id, 'WP_Query');
|
||||
|
||||
$response = $this->export($request, $items, $args);
|
||||
|
||||
$total_items = $items->found_posts;
|
||||
$ret = $response instanceof Entity ? $response->__toArray() : $response;
|
||||
$rest_response = new \WP_REST_Response($ret, 200);
|
||||
|
||||
$rest_response->header('X-WP-Total', (int) $total_items);
|
||||
} elseif (isset($request['item_id'])) { // One Item
|
||||
|
||||
$item = new Entities\Item($request['item_id']);
|
||||
if($item->get_id() > 0) {
|
||||
$response = $this->export($request, $item, $args);
|
||||
|
||||
$total_items = 1;
|
||||
$max_pages = 1;
|
||||
|
||||
$rest_response = new \WP_REST_Response($response->__toArray(), 200);
|
||||
|
||||
$rest_response->header('X-WP-Total', 1);
|
||||
$rest_response->header('X-WP-TotalPages', 1);
|
||||
}
|
||||
} else { // Export All
|
||||
$Tainacan_Collection = \Tainacan\Repositories\Collections::get_instance();
|
||||
$collections = $Tainacan_Collection->fetch(['post_status' => 'publish'], 'WP_Query');
|
||||
|
||||
$response = $this->export($request, $collections, $args);
|
||||
$total_items = $collections->found_posts;
|
||||
$ret = $response instanceof Entity ? $response->__toArray() : $response;
|
||||
$rest_response = new \WP_REST_Response($ret, 200);
|
||||
|
||||
$rest_response->header('X-WP-Total', (int) $total_items);
|
||||
}
|
||||
|
||||
return $rest_response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \WP_REST_Request $request
|
||||
*
|
||||
* @return bool|\WP_Error
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function get_items_permissions_check( $request ) {
|
||||
return $this->get_item_permissions_check($request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -83,8 +83,8 @@ class REST_Filters_Controller extends REST_Controller {
|
|||
'permission_callback' => array($this, 'delete_item_permissions_check'),
|
||||
'args' => array(
|
||||
'permanently' => array(
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as true. By default this will only trash collection'),
|
||||
'default' => 'false'
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as 1. By default this will only trash collection'),
|
||||
'default' => '0'
|
||||
),
|
||||
)
|
||||
),
|
||||
|
@ -469,10 +469,9 @@ class REST_Filters_Controller extends REST_Controller {
|
|||
public function get_endpoint_args_for_item_schema( $method = null ) {
|
||||
$endpoint_args = [];
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'items' => array( 'view, edit' )
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
parent::get_wp_query_params()
|
||||
);
|
||||
} elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) {
|
||||
$map = $this->filter_repository->get_map();
|
||||
|
@ -498,16 +497,17 @@ class REST_Filters_Controller extends REST_Controller {
|
|||
* @return array|void
|
||||
*/
|
||||
public function get_wp_query_params() {
|
||||
$query_params['context']['default'] = 'view';
|
||||
|
||||
$query_params = array_merge($query_params, parent::get_wp_query_params());
|
||||
|
||||
$query_params['name'] = array(
|
||||
'description' => __('Limits the result set to filters with a specific name'),
|
||||
'type' => 'string',
|
||||
);
|
||||
|
||||
$query_params = array_merge($query_params, parent::get_meta_queries_params());
|
||||
$query_params = array_merge(
|
||||
$query_params,
|
||||
parent::get_wp_query_params(),
|
||||
parent::get_meta_queries_params()
|
||||
);
|
||||
|
||||
return $query_params;
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
if ( method_exists($importer, 'get_source_special_fields') ) {
|
||||
$response['source_special_fields'] = $importer->get_source_special_fields();
|
||||
}
|
||||
|
||||
$Tainacan_Importer_Handler->save_importer_instance($importer);
|
||||
return new \WP_REST_Response( $response, 200 );
|
||||
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ class REST_Item_Metadata_Controller extends REST_Controller {
|
|||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_items'),
|
||||
'permission_callback' => array($this, 'get_items_permissions_check'),
|
||||
'args' => $this->get_wp_query_params(),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -268,7 +268,12 @@ class REST_Item_Metadata_Controller extends REST_Controller {
|
|||
public function get_endpoint_args_for_item_schema( $method = null ) {
|
||||
$endpoint_args = [];
|
||||
|
||||
if ($method === \WP_REST_Server::EDITABLE) {
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
$this->get_wp_query_params()
|
||||
);
|
||||
} elseif ($method === \WP_REST_Server::EDITABLE) {
|
||||
$endpoint_args['values'] = [
|
||||
'type' => 'array/string/object/integer',
|
||||
'items' => [
|
||||
|
@ -290,7 +295,15 @@ class REST_Item_Metadata_Controller extends REST_Controller {
|
|||
* @return array
|
||||
*/
|
||||
public function get_wp_query_params() {
|
||||
$query_params['context']['default'] = 'view';
|
||||
$query_params['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'description' => 'The context in which the request is made.',
|
||||
'enum' => array(
|
||||
'view',
|
||||
'edit'
|
||||
),
|
||||
);
|
||||
|
||||
return $query_params;
|
||||
}
|
||||
|
|
|
@ -80,8 +80,8 @@ class REST_Items_Controller extends REST_Controller {
|
|||
'permission_callback' => array($this, 'delete_item_permissions_check'),
|
||||
'args' => array(
|
||||
'permanently' => array(
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as true. By default this will only trash collection', 'tainacan'),
|
||||
'default' => 'false'
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as 1. By default this will only trash collection', 'tainacan'),
|
||||
'default' => '0'
|
||||
),
|
||||
)
|
||||
),
|
||||
|
@ -757,15 +757,18 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$endpoint_args = [];
|
||||
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args['fetch_only'] = array(
|
||||
'type' => 'string/array',
|
||||
'description' => __( 'Fetch only specific attribute. The specifics attributes are the same in schema.' ),
|
||||
);
|
||||
|
||||
$endpoint_args['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'items' => array( 'view, edit' )
|
||||
'description' => 'The context in which the request is made.',
|
||||
'enum' => array(
|
||||
'view',
|
||||
'edit'
|
||||
),
|
||||
);
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
parent::get_fetch_only_param()
|
||||
);
|
||||
} elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) {
|
||||
$map = $this->items_repository->get_map();
|
||||
|
@ -791,16 +794,16 @@ class REST_Items_Controller extends REST_Controller {
|
|||
* @return array|void
|
||||
*/
|
||||
public function get_wp_query_params() {
|
||||
$query_params['context']['default'] = 'view';
|
||||
|
||||
array_merge($query_params, parent::get_wp_query_params());
|
||||
|
||||
$query_params['title'] = array(
|
||||
'description' => __('Limits the result set to items with a specific title'),
|
||||
'type' => 'string',
|
||||
);
|
||||
|
||||
$query_params = array_merge($query_params, parent::get_meta_queries_params());
|
||||
$query_params = array_merge(
|
||||
$query_params,
|
||||
parent::get_wp_query_params(),
|
||||
parent::get_meta_queries_params()
|
||||
);
|
||||
|
||||
return $query_params;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,17 @@ class REST_Logs_Controller extends REST_Controller {
|
|||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission_callback' => array($this, 'get_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE)
|
||||
'args' => array(
|
||||
'context' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'description' => 'The context in which the request is made.',
|
||||
'enum' => array(
|
||||
'view',
|
||||
'edit'
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
'schema' => [$this, 'get_schema']
|
||||
)
|
||||
|
@ -351,10 +361,9 @@ class REST_Logs_Controller extends REST_Controller {
|
|||
public function get_endpoint_args_for_item_schema( $method = null ) {
|
||||
$endpoint_args = [];
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'items' => array( 'view' )
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
parent::get_wp_query_params()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,24 +44,33 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
public function register_routes() {
|
||||
register_rest_route($this->namespace, '/collection/(?P<collection_id>[\d]+)/' . $this->rest_base . '/(?P<metadatum_id>[\d]+)',
|
||||
array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission_callback' => array($this, 'get_item_permissions_check'),
|
||||
'args' => array(
|
||||
'context' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'description' => 'The context in which the request is made.',
|
||||
'enum' => array(
|
||||
'view',
|
||||
'edit'
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::EDITABLE,
|
||||
'callback' => array($this, 'update_item'),
|
||||
'permission_callback' => array($this, 'update_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::EDITABLE)
|
||||
),
|
||||
// ENDPOINT X. THIS ENDPOINT DO THE SAME THING OF ENDPOINT Z. I hope in a brief future it function changes.
|
||||
array(
|
||||
'methods' => \WP_REST_Server::DELETABLE,
|
||||
'callback' => array($this, 'delete_item'),
|
||||
'permission_callback' => array($this, 'delete_item_permissions_check'),
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission_callback' => array($this, 'get_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE),
|
||||
),
|
||||
'schema' => [$this, 'get_schema']
|
||||
)
|
||||
);
|
||||
|
@ -84,28 +93,38 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
);
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base,
|
||||
array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::CREATABLE,
|
||||
'callback' => array($this, 'create_item'),
|
||||
'permission_callback' => array($this, 'create_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::CREATABLE),
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_items'),
|
||||
'permission_callback' => array($this, 'get_items_permissions_check'),
|
||||
'args' => $this->get_wp_query_params(),
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::CREATABLE,
|
||||
'callback' => array($this, 'create_item'),
|
||||
'permission_callback' => array($this, 'create_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::CREATABLE),
|
||||
),
|
||||
'schema' => [$this, 'get_schema'],
|
||||
)
|
||||
);
|
||||
register_rest_route($this->namespace, '/'. $this->rest_base . '/(?P<metadatum_id>[\d]+)',
|
||||
array(
|
||||
// ENDPOINT Z.
|
||||
array(
|
||||
'methods' => \WP_REST_Server::DELETABLE,
|
||||
'callback' => array($this, 'delete_item'),
|
||||
'permission_callback' => array($this, 'delete_item_permissions_check')
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission' => array($this, 'get_item_permissions_check'),
|
||||
'args' => array(
|
||||
'context' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'description' => 'The context in which the request is made.',
|
||||
'enum' => array(
|
||||
'view',
|
||||
'edit'
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::EDITABLE,
|
||||
|
@ -114,10 +133,9 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::EDITABLE)
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission' => array($this, 'get_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE)
|
||||
'methods' => \WP_REST_Server::DELETABLE,
|
||||
'callback' => array($this, 'delete_item'),
|
||||
'permission_callback' => array($this, 'delete_item_permissions_check')
|
||||
),
|
||||
'schema' => [$this, 'get_schema'],
|
||||
)
|
||||
|
@ -564,10 +582,9 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
public function get_endpoint_args_for_item_schema( $method = null ) {
|
||||
$endpoint_args = [];
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'items' => array( 'view, edit' )
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
parent::get_wp_query_params()
|
||||
);
|
||||
} elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) {
|
||||
$map = $this->metadatum_repository->get_map();
|
||||
|
|
|
@ -54,7 +54,21 @@ class REST_Taxonomies_Controller extends REST_Controller {
|
|||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission_callback' => array($this, 'get_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::READABLE)
|
||||
'args' => array(
|
||||
'context' => array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'description' => 'The context in which the request is made.',
|
||||
'enum' => array(
|
||||
'view',
|
||||
'edit'
|
||||
)
|
||||
),
|
||||
'fetch_only' => array(
|
||||
'type' => 'string/array',
|
||||
'description' => __( 'Fetch only specific attribute. The specifics attributes are the same in schema.', 'tainacan' ),
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'methods' => \WP_REST_Server::DELETABLE,
|
||||
|
@ -62,8 +76,8 @@ class REST_Taxonomies_Controller extends REST_Controller {
|
|||
'permission_callback' => array($this, 'delete_item_permissions_check'),
|
||||
'args' => array(
|
||||
'permanently' => array(
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as true. By default this will only trash collection'),
|
||||
'default' => 'false',
|
||||
'description' => __('To delete permanently, you can pass \'permanently\' as 1. By default this will only trash collection'),
|
||||
'default' => '0',
|
||||
),
|
||||
)
|
||||
),
|
||||
|
@ -452,15 +466,10 @@ class REST_Taxonomies_Controller extends REST_Controller {
|
|||
public function get_endpoint_args_for_item_schema( $method = null ) {
|
||||
$endpoint_args = [];
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args['fetch_only'] = array(
|
||||
'type' => 'string/array',
|
||||
'description' => __( 'Fetch only specific attribute. The specifics attributes are the same in schema.' ),
|
||||
);
|
||||
|
||||
$endpoint_args['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'items' => array( 'view, edit' )
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
parent::get_wp_query_params(),
|
||||
parent::get_fetch_only_param()
|
||||
);
|
||||
} elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) {
|
||||
$map = $this->taxonomy_repository->get_map();
|
||||
|
|
|
@ -56,8 +56,9 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
'callback' => array($this, 'delete_item'),
|
||||
'permission_callback' => array($this, 'delete_item_permissions_check'),
|
||||
'args' => [
|
||||
'info' => [
|
||||
'description' => __('Delete term permanently.')
|
||||
'permanently' => [
|
||||
'description' => __('Delete term permanently.'),
|
||||
'default' => '1'
|
||||
]
|
||||
]
|
||||
),
|
||||
|
@ -420,10 +421,9 @@ class REST_Terms_Controller extends REST_Controller {
|
|||
public function get_endpoint_args_for_item_schema( $method = null ) {
|
||||
$endpoint_args = [];
|
||||
if($method === \WP_REST_Server::READABLE) {
|
||||
$endpoint_args['context'] = array(
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'items' => array( 'view, edit' )
|
||||
$endpoint_args = array_merge(
|
||||
$endpoint_args,
|
||||
parent::get_wp_query_params()
|
||||
);
|
||||
} elseif ($method === \WP_REST_Server::CREATABLE || $method === \WP_REST_Server::EDITABLE) {
|
||||
$map = $this->terms_repository->get_map();
|
||||
|
|
|
@ -18,7 +18,6 @@ $rest_exporters_controller = new \Tainacan\API\EndPoints\REST_Exporters_Contr
|
|||
$rest_background_processes_controller = new \Tainacan\API\EndPoints\REST_Background_Processes_Controller();
|
||||
$rest_bulkedit_controller = new \Tainacan\API\EndPoints\REST_Bulkedit_Controller();
|
||||
$rest_exposers_controller = new \Tainacan\API\EndPoints\REST_Exposers_Controller();
|
||||
new \Tainacan\API\EndPoints\REST_Export_Controller();
|
||||
new \Tainacan\API\EndPoints\REST_Metadatum_Mappers_Controller();
|
||||
$rest_facets_controller = new \Tainacan\API\EndPoints\REST_Facets_Controller();
|
||||
$rest_oaipmh_expose_controller = new \Tainacan\API\EndPoints\REST_Oaipmh_Expose_Controller();
|
||||
|
|
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -171,8 +174,13 @@
|
|||
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid {
|
||||
margin-right: 6px; }
|
||||
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid div {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 33% 33% 33%;
|
||||
grid-template-columns: 33% 33% 33%;
|
||||
-ms-grid-rows: 50% 50%;
|
||||
grid-template-rows: 50% 50%;
|
||||
grid-column-gap: 2px;
|
||||
grid-row-gap: 2px;
|
||||
|
@ -180,13 +188,17 @@
|
|||
height: 40px;
|
||||
margin: 4px auto 8px auto; }
|
||||
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid div > div:first-of-type {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: span 2;
|
||||
flex-basis: 100%;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
-ms-grid-row: 1;
|
||||
-ms-grid-row-span: 2;
|
||||
grid-column: 1/3;
|
||||
grid-row: 1/3;
|
||||
width: 41px;
|
||||
height: 42px; }
|
||||
.components-panel__body .collection-carousel-view-modes button.collection-carousel-view-mode-grid div > div {
|
||||
flex-basis: 50%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: #555758;
|
||||
|
@ -214,7 +226,7 @@
|
|||
background: #f2f2f2; }
|
||||
|
||||
.wp-block-tainacan-carousel-collections-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-carousel-collections-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1rem;
|
||||
|
@ -270,7 +282,7 @@
|
|||
text-decoration: none;
|
||||
padding: 8px 16px;
|
||||
display: block;
|
||||
line-height: 1.2rem; }
|
||||
line-height: 1.2em; }
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container a > img {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
|
@ -280,16 +292,23 @@
|
|||
width: 100%;
|
||||
display: block; }
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid .collection-items-grid {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
grid-template-columns: 33% 33% 33%;
|
||||
grid-template-rows: 50% 50%;
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid .collection-items-grid img:first-of-type {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: span 2; }
|
||||
flex-basis: 100%;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
-ms-grid-row: 1;
|
||||
-ms-grid-row-span: 2;
|
||||
grid-column: 1/3;
|
||||
grid-row: 1/3; }
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container .swiper-slide.collection-list-item-grid .collection-items-grid img {
|
||||
flex-basis: 50%;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: 2px;
|
||||
|
@ -389,15 +408,22 @@
|
|||
background-color: white !important;
|
||||
border: 1px solid #cbcbcb !important; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
grid-template-columns: 33% 33% 33%;
|
||||
grid-template-rows: 50% 50%; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid img:first-of-type {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: span 2; }
|
||||
flex-basis: 100%;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
-ms-grid-row: 1;
|
||||
-ms-grid-row-span: 2;
|
||||
grid-column: 1/3;
|
||||
grid-row: 1/3; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid img {
|
||||
flex-basis: 50%;
|
||||
padding: 2px;
|
||||
margin-bottom: 0px; }
|
||||
@media only screen and (max-width: 1686px) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -156,7 +159,7 @@
|
|||
color: #454647; }
|
||||
|
||||
.wp-block-tainacan-carousel-items-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-carousel-items-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1rem;
|
||||
|
@ -222,12 +225,13 @@
|
|||
.wp-block-tainacan-carousel-items-list .carousel-items-collection-header .collection-name h3 {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-size: 1.3rem; }
|
||||
font-size: 1.3em;
|
||||
margin: 0; }
|
||||
.wp-block-tainacan-carousel-items-list .carousel-items-collection-header .collection-name h3:hover {
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-carousel-items-list .carousel-items-collection-header .collection-name span.label {
|
||||
font-weight: normal;
|
||||
font-size: 1rem; }
|
||||
font-size: 0.75em; }
|
||||
.wp-block-tainacan-carousel-items-list .carousel-items-collection-header .collection-name.only-collection-name {
|
||||
justify-content: center;
|
||||
padding: 1rem; }
|
||||
|
@ -284,7 +288,7 @@
|
|||
text-decoration: none;
|
||||
padding: 8px 16px;
|
||||
display: block;
|
||||
line-height: 1.2rem; }
|
||||
line-height: 1.2em; }
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel .swiper-container a > img {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -171,8 +174,13 @@
|
|||
.components-panel__body .term-carousel-view-modes button.term-carousel-view-mode-grid {
|
||||
margin-right: 6px; }
|
||||
.components-panel__body .term-carousel-view-modes button.term-carousel-view-mode-grid div {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 33% 33% 33%;
|
||||
grid-template-columns: 33% 33% 33%;
|
||||
-ms-grid-rows: 50% 50%;
|
||||
grid-template-rows: 50% 50%;
|
||||
grid-column-gap: 2px;
|
||||
grid-row-gap: 2px;
|
||||
|
@ -180,13 +188,17 @@
|
|||
height: 40px;
|
||||
margin: 4px auto 8px auto; }
|
||||
.components-panel__body .term-carousel-view-modes button.term-carousel-view-mode-grid div > div:first-of-type {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: span 2;
|
||||
flex-basis: 100%;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
-ms-grid-row: 1;
|
||||
-ms-grid-row-span: 2;
|
||||
grid-column: 1/3;
|
||||
grid-row: 1/3;
|
||||
width: 41px;
|
||||
height: 42px; }
|
||||
.components-panel__body .term-carousel-view-modes button.term-carousel-view-mode-grid div > div {
|
||||
flex-basis: 50%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: #555758;
|
||||
|
@ -214,7 +226,7 @@
|
|||
background: #f2f2f2; }
|
||||
|
||||
.wp-block-tainacan-carousel-terms-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-carousel-terms-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1rem;
|
||||
|
@ -270,7 +282,7 @@
|
|||
text-decoration: none;
|
||||
padding: 8px 16px;
|
||||
display: block;
|
||||
line-height: 1.2rem; }
|
||||
line-height: 1.2em; }
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container a > img {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
|
@ -280,16 +292,23 @@
|
|||
width: 100%;
|
||||
display: block; }
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid .term-items-grid {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
grid-template-columns: 33% 33% 33%;
|
||||
grid-template-rows: 50% 50%;
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid .term-items-grid img:first-of-type {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: span 2; }
|
||||
flex-basis: 100%;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
-ms-grid-row: 1;
|
||||
-ms-grid-row-span: 2;
|
||||
grid-column: 1/3;
|
||||
grid-row: 1/3; }
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container .swiper-slide.term-list-item-grid .term-items-grid img {
|
||||
flex-basis: 50%;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: 2px;
|
||||
|
@ -389,15 +408,22 @@
|
|||
background-color: white !important;
|
||||
border: 1px solid #cbcbcb !important; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item .term-items-grid {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
grid-template-columns: 33% 33% 33%;
|
||||
grid-template-rows: 50% 50%; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item .term-items-grid img:first-of-type {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: span 2; }
|
||||
flex-basis: 100%;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column-span: 2;
|
||||
-ms-grid-row: 1;
|
||||
-ms-grid-row-span: 2;
|
||||
grid-column: 1/3;
|
||||
grid-row: 1/3; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item .term-items-grid img {
|
||||
flex-basis: 50%;
|
||||
padding: 2px;
|
||||
margin-bottom: 0px; }
|
||||
@media only screen and (max-width: 1686px) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -156,7 +159,7 @@
|
|||
color: #454647; }
|
||||
|
||||
.wp-block-tainacan-collections-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-collections-list .components-spinner {
|
||||
position: absolute;
|
||||
right: 0; }
|
||||
|
@ -178,8 +181,11 @@
|
|||
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-grid,
|
||||
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-grid {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -156,7 +159,7 @@
|
|||
color: #454647; }
|
||||
|
||||
.wp-block-tainacan-dynamic-items-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-dynamic-items-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1rem;
|
||||
|
@ -164,6 +167,8 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #555758; }
|
||||
.wp-block-tainacan-dynamic-items-list:hover .components-resizable-box__handle {
|
||||
display: block; }
|
||||
@-webkit-keyframes skeleton-animation {
|
||||
0% {
|
||||
opacity: 1.0; }
|
||||
|
@ -221,12 +226,13 @@
|
|||
.wp-block-tainacan-dynamic-items-list .dynamic-items-collection-header .collection-name h3 {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-size: 1.3rem; }
|
||||
font-size: 1.3em;
|
||||
margin: 0; }
|
||||
.wp-block-tainacan-dynamic-items-list .dynamic-items-collection-header .collection-name h3:hover {
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-dynamic-items-list .dynamic-items-collection-header .collection-name span.label {
|
||||
font-weight: normal;
|
||||
font-size: 1rem; }
|
||||
font-size: 0.75em; }
|
||||
.wp-block-tainacan-dynamic-items-list .dynamic-items-collection-header .collection-name.only-collection-name {
|
||||
justify-content: center;
|
||||
padding: 1rem; }
|
||||
|
@ -334,57 +340,28 @@
|
|||
width: 100%;
|
||||
border: 1px solid #cbcbcb;
|
||||
box-shadow: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-list-without-margin,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-list-without-margin {
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.items-list-without-margin,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.items-list-without-margin,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.items-list-without-margin,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.items-list-without-margin {
|
||||
grid-template-columns: repeat(auto-fill, 185px);
|
||||
justify-content: center !important;
|
||||
grid-template-rows: auto !important;
|
||||
list-style: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-list-without-margin li,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-list-without-margin li {
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.items-list-without-margin li,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.items-list-without-margin li,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.items-list-without-margin li,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.items-list-without-margin li {
|
||||
margin-top: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
height: 185px !important; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-list-without-margin li img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-list-without-margin li img {
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list.items-list-without-margin li img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list.items-list-without-margin li img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid.items-list-without-margin li img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid.items-list-without-margin li img {
|
||||
height: 185px !important;
|
||||
margin-bottom: 0px !important; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid {
|
||||
padding: 0;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
list-style-type: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin: 12px 12px 24px 12px;
|
||||
margin-bottom: 12px;
|
||||
width: 185px; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a {
|
||||
color: #454647;
|
||||
font-weight: bold;
|
||||
line-height: normal; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item img {
|
||||
height: auto;
|
||||
width: 185px;
|
||||
min-width: 185px;
|
||||
padding: 0px;
|
||||
margin-bottom: 0.5rem; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a.item-without-title span,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a.item-without-title span {
|
||||
display: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item:hover a,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item:hover a {
|
||||
color: #454647;
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit li.item-list-item {
|
||||
display: flex;
|
||||
align-items: flex-start; }
|
||||
|
@ -414,6 +391,45 @@
|
|||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit li.item-list-item:hover button:hover {
|
||||
background-color: white !important;
|
||||
border: 1px solid #cbcbcb !important; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
list-style-type: none;
|
||||
margin: 0; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin: 12px 12px 24px 12px;
|
||||
margin-bottom: 12px;
|
||||
width: 185px; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a {
|
||||
color: #454647;
|
||||
font-weight: bold;
|
||||
line-height: normal; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item img {
|
||||
height: auto;
|
||||
width: 185px;
|
||||
min-width: 185px;
|
||||
padding: 0px;
|
||||
margin-bottom: 0.5rem; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item a.item-without-title span,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item a.item-without-title span {
|
||||
display: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid li.item-list-item:hover a,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid li.item-list-item:hover a {
|
||||
color: #454647;
|
||||
text-decoration: none; }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-grid,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-grid {
|
||||
|
@ -430,7 +446,8 @@
|
|||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
list-style-type: none; }
|
||||
list-style-type: none;
|
||||
margin: 0; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item {
|
||||
position: relative;
|
||||
|
@ -481,5 +498,389 @@
|
|||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item {
|
||||
min-width: calc(100% - 24px);
|
||||
width: calc(100% - 24px); } }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic {
|
||||
width: auto;
|
||||
display: flex;
|
||||
list-style: none;
|
||||
min-height: 280px;
|
||||
margin: 0; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container {
|
||||
padding: 0;
|
||||
justify-content: stretch;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 150px 150px 150px;
|
||||
grid-template-columns: repeat(3, 150px);
|
||||
grid-auto-flow: dense;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container:not(:first-of-type),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container:not(:first-of-type) {
|
||||
margin-left: 0 !important; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item {
|
||||
flex-grow: 1;
|
||||
justify-self: stretch;
|
||||
position: relative;
|
||||
min-width: 100%;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
margin: 0; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
color: #454647;
|
||||
font-weight: bold;
|
||||
line-height: normal; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item img,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item img {
|
||||
display: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a span,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
background: rgba(255, 255, 255, 0.75);
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
padding: 8px 12px;
|
||||
word-break: break-word;
|
||||
transition: opacity 0.5s ease; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item:hover a span,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item:hover a span {
|
||||
opacity: 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item a.item-without-title span,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item a.item-without-title span {
|
||||
display: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container li.item-list-item:hover a,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container li.item-list-item:hover a {
|
||||
color: #454647;
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--1-2x3 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--1-2x3 li.item-list-item {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-2x3 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-2x3 li.item-list-item {
|
||||
grid-row: span 1;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-2x3 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-2x3 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-2x3 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-2x3 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-2x3 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-2x3 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-2x3 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-2x3 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--1-3x2 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--1-3x2 li.item-list-item {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-3x2 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-3x2 li.item-list-item {
|
||||
grid-row: span 3;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-3x2 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-3x2 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x2 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x2 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x2 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x2 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-3x2 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-3x2 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--1-3x3 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--1-3x3 li.item-list-item {
|
||||
grid-row: span 3;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-3x3 li.item-list-item:first-of-type,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-3x3 li.item-list-item:first-of-type {
|
||||
grid-row: span 1;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-3x3 li.item-list-item:last-of-type,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-3x3 li.item-list-item:last-of-type {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-3x3 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-3x3 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-3x3 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-3x3 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x3 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x3 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x3 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x3 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x3 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x3 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-3x3 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-3x3 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-3x3 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-3x3 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-3x3 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-3x3 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-3x3 li.item-list-item:nth-of-type(4), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-3x3 li.item-list-item:nth-of-type(6),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-3x3 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-3x3 li.item-list-item:nth-of-type(6) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--1-3x4 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--1-3x4 li.item-list-item {
|
||||
grid-row: span 3;
|
||||
grid-column: span 4; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-3x4 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-3x4 li.item-list-item {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-3x4 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-3x4 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-3x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-3x4 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-3x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-3x4 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(2), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-3x4 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-3x4 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-3x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-3x4 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-3x4 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-3x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-3x4 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(2), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(6),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(6) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-3x4 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--1-4x3 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--1-4x3 li.item-list-item {
|
||||
grid-row: span 4;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-4x3 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-4x3 li.item-list-item {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-4x3 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-4x3 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-4x3 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-4x3 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-4x3 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-4x3 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-4x3 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-4x3 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-4x3 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-4x3 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-4x3 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-4x3 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-4x3 li.item-list-item:nth-of-type(2), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-4x3 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-4x3 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-4x3 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-4x3 li.item-list-item:nth-of-type(5),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-4x3 li.item-list-item:nth-of-type(5) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(3), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(6),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(6) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(5),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x3 li.item-list-item:nth-of-type(5) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--1-4x5 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--1-4x5 li.item-list-item {
|
||||
grid-row: span 4;
|
||||
grid-column: span 5; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-4x5 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-4x5 li.item-list-item {
|
||||
grid-row: span 2;
|
||||
grid-column: span 5; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-4x5 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-4x5 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 5; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-4x5 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-4x5 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-4x5 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-4x5 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(2), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-4x5 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-4x5 li.item-list-item:nth-of-type(3), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-4x5 li.item-list-item:nth-of-type(5),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-4x5 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-4x5 li.item-list-item:nth-of-type(5) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-4x5 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-4x5 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(5),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(5) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 3; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(6),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-4x5 li.item-list-item:nth-of-type(6) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--1-5x4 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--1-5x4 li.item-list-item {
|
||||
grid-row: span 5;
|
||||
grid-column: span 4; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--2-5x4 li.item-list-item,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--2-5x4 li.item-list-item {
|
||||
grid-row: span 5;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-5x4 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-5x4 li.item-list-item:nth-of-type(1) {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-5x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-5x4 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 5;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--3-5x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--3-5x4 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(2), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--4-5x4 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(3), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(5),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(5) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--5-5x4 li.item-list-item:nth-of-type(4) {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(1), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(5),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(1),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(5) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(2),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(2) {
|
||||
grid-row: span 3;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(3),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(3) {
|
||||
grid-row: span 1;
|
||||
grid-column: span 2; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(4), .wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(6),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(4),
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container.mosaic-container--6-5x4 li.item-list-item:nth-of-type(6) {
|
||||
grid-row: span 2;
|
||||
grid-column: span 1; }
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic {
|
||||
overflow-x: auto; }
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-mosaic .mosaic-container,
|
||||
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-mosaic .mosaic-container {
|
||||
min-width: 240px; } }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-dynamic-items-list.css.map */
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -156,7 +159,7 @@
|
|||
color: #454647; }
|
||||
|
||||
.wp-block-tainacan-facets-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-facets-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1rem;
|
||||
|
@ -221,12 +224,13 @@
|
|||
.wp-block-tainacan-facets-list .facets-collection-header .collection-name h3 {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-size: 1.3rem; }
|
||||
font-size: 1.3em;
|
||||
margin: 0; }
|
||||
.wp-block-tainacan-facets-list .facets-collection-header .collection-name h3:hover {
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-facets-list .facets-collection-header .collection-name span.label {
|
||||
font-weight: normal;
|
||||
font-size: 1rem; }
|
||||
font-size: 0.75em; }
|
||||
.wp-block-tainacan-facets-list .facets-collection-header .collection-name.only-collection-name {
|
||||
justify-content: center;
|
||||
padding: 1rem; }
|
||||
|
@ -337,8 +341,11 @@
|
|||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -493,9 +500,8 @@
|
|||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item a {
|
||||
color: #454647;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 54px; }
|
||||
display: inline;
|
||||
min-height: 54px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item img {
|
||||
height: auto;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -156,7 +159,7 @@
|
|||
color: #454647; }
|
||||
|
||||
.wp-block-tainacan-items-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-items-list .components-spinner {
|
||||
position: absolute;
|
||||
right: 0; }
|
||||
|
@ -178,8 +181,11 @@
|
|||
.wp-block-tainacan-items-list ul.items-list.items-layout-grid,
|
||||
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-grid {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -160,7 +163,7 @@
|
|||
justify-content: center; }
|
||||
|
||||
.wp-block-tainacan-search-bar {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-search-bar .tainacan-search-container {
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -95,8 +95,11 @@
|
|||
.wp-block-tainacan-modal .modal-checkbox-list,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 250px 250px;
|
||||
grid-template-columns: repeat(auto-fill, 250px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
@ -156,15 +159,18 @@
|
|||
color: #454647; }
|
||||
|
||||
.wp-block-tainacan-terms-list {
|
||||
margin: 2rem 0px; }
|
||||
margin: 2rem auto; }
|
||||
.wp-block-tainacan-terms-list .components-spinner {
|
||||
position: absolute;
|
||||
right: 0; }
|
||||
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-grid,
|
||||
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-grid {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5B,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,iBAAiB;EACxB,UAAU,EAAE,OAAO;EAEnB,gBAAE;IACE,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,OAAO;IAEb,oBAAI;MACA,GAAG,EAAE,GAAG;MACR,YAAY,EAAE,OAAO;MACrB,QAAQ,EAAE,QAAQ;MAClB,IAAI,EAAE,OAAO;;AAIzB,mCAAoC;EAChC,SAAS,EAAE,mBAAmB;EAC9B,UAAU,EAAE,IAAI;EAChB,IAAI,EAAE,OAAO;EAEb,uCAAI;IACA,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,GAAG;IACR,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,OAAO;;AAKrB,wBAAyB;EACrB,KAAK,EAAE,GAAG;EAEV,0CAA2C;IAH/C,wBAAyB;MAGyB,KAAK,EAAE,GAAG;EACxD,yCAA0C;IAJ9C,wBAAyB;MAIuB,KAAK,EAAE,IAAI;EAGvD,sCAAgB;IACZ,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IAEZ,6CAAO;MACH,KAAK,EAAE,iBAAiB;MACxB,MAAM,EAAE,kBAAkB;MAC1B,WAAW,EAAE,KAAK;IAGtB,yDAAmB;MACf,MAAM,EAAE,IAAI;MACZ,KAAK,EAAE,iBAAiB;MACxB,WAAW,EAAE,gBAAgB;MAC7B,OAAO,EAAE,wBAAwB;MACjC,UAAU,EAAE,iBAAiB;EAKrC,2CAAmB;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,OAAO;IACd,+DAAoB;MAAE,MAAM,EAAE,GAAG;EAGrC,0EAAkD;IAC9C,aAAa,EAAE,CAAC;EAGpB,2BAAG;IACC,MAAM,EAAE,WAAW;EAGvB,2CAAmB;IACf,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,IAAI;IAEnB,oEAAyB;MACrB,KAAK,EAAE,GAAG;MAEV,0CAA2C;QAH/C,oEAAyB;UAGyB,KAAK,EAAE,GAAG;MACxD,iFAAe;QACX,WAAW,EAAE,CAAC;MAElB,oGAAgC;QAC5B,SAAS,EAAE,IAAI;MAEnB,yGAAqC;QACjC,WAAW,EAAE,GAAG;QAChB,KAAK,EAAE,OAAO;QACd,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;MAEtB,yGAAqC;QACjC,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,IAAI;EAKxB,gDAAwB;IACpB,WAAW,EAAE,GAAG;IAChB,WAAW,EAAE,OAAO;EAGxB;4EACkD;IAC9C,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IACb,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,MAAM;IAElB;uGAAyB;MACrB,QAAQ,EAAE,MAAM;IAGpB;;;gHACkC;MAC9B,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,UAAU;MAE3B;;;sHAAI;QACA,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;MAEtB;;;wHAAM;QACF,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,GAAG;QAEd,yCAA0C;UAP9C;;;4HAAM;YAO0C,SAAS,EAAE,GAAG;EAItE,gDAAwB;IACpB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,MAAM;IAEvB,kDAAE;MACE,KAAK,EAAE,OAAO;MACd,YAAY,EAAE,IAAI;MAClB,UAAU,EAAE,GAAG;EAGvB,2CAAmB;IACf,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,aAAa;IAC9B,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,OAAO;IAEf,6CAAE;MACE,OAAO,EAAE,MAAM;MACf,KAAK,EAAE,OAAO;;ACtL1B,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAGhB,iDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;oEACqC;IACjC,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IACb,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,OAAO,EAAE,KAAK;MACd,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,KAAK,EAAE,KAAK;MAEZ;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,MAAM;MAGvB;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,GAAG;QACZ,aAAa,EAAE,MAAM;MAGzB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;EAIjC,kEAAqC;IACjC,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,UAAU;IAEvB,yEAAO;MACH,QAAQ,EAAE,mBAAmB;MAC7B,gBAAgB,EAAE,yBAAyB;MAC3C,KAAK,EAAE,OAAO;MACd,OAAO,EAAE,GAAG;MACZ,WAAW,EAAE,GAAG;MAChB,SAAS,EAAE,IAAI;MACf,UAAU,EAAE,MAAM;MAClB,QAAQ,EAAE,QAAQ;MAClB,OAAO,EAAE,CAAC;MACV,KAAK,EAAE,KAAK;MACZ,GAAG,EAAE,GAAG;MACR,eAAe,EAAE,MAAM;MACvB,OAAO,EAAE,GAAG;IAGhB,+EAAe;MACX,UAAU,EAAE,OAAO;MACnB,gBAAgB,EAAE,gBAAiC;MACnD,OAAO,EAAE,CAAC;MACV,KAAK,EAAE,IAAI;MACX,GAAG,EAAE,IAAI;MACT,MAAM,EAAE,iBAAiB;MACzB,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,wCAAwC;IAExD,qFAAqB;MACjB,gBAAgB,EAAE,gBAAiC;MACnD,MAAM,EAAE,4BAA4B;EAG5C,yCAA0C;IAEtC;sEACqC;MACjC,qBAAqB,EAAE,uBAAuB;MAE9C;0FAAkB;QACd,KAAK,EAAE,IAAI;QACX;gGAAI;UAAE,KAAK,EAAE,IAAI;EAM7B;oEACqC;IACjC,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,IAAI;MAChB,SAAS,EAAE,gBAAgB;MAC3B,KAAK,EAAE,gBAAgB;MAEvB;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,UAAU;MAG1B;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QAlC/C;4FAAkB;UAmCV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAvC/C;4FAAkB;UAwCV,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA5C9C;4FAAkB;UA6CV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAjD9C;4FAAkB;UAkDV,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB",
|
||||
"mappings": "AAEA,kCAAmC;EAC/B,KAAK,EAAE,iBAAiB;;AAE5B,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,iBAAiB;EACxB,UAAU,EAAE,OAAO;EAEnB,gBAAE;IACE,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,OAAO;IAEb,oBAAI;MACA,GAAG,EAAE,GAAG;MACR,YAAY,EAAE,OAAO;MACrB,QAAQ,EAAE,QAAQ;MAClB,IAAI,EAAE,OAAO;;AAIzB,mCAAoC;EAChC,SAAS,EAAE,mBAAmB;EAC9B,UAAU,EAAE,IAAI;EAChB,IAAI,EAAE,OAAO;EAEb,uCAAI;IACA,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,GAAG;IACR,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,OAAO;;AAqBrB,wBAAyB;EACrB,KAAK,EAAE,GAAG;EAEV,0CAA2C;IAH/C,wBAAyB;MAGyB,KAAK,EAAE,GAAG;EACxD,yCAA0C;IAJ9C,wBAAyB;MAIuB,KAAK,EAAE,IAAI;EAGvD,sCAAgB;IACZ,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IAEZ,6CAAO;MACH,KAAK,EAAE,iBAAiB;MACxB,MAAM,EAAE,kBAAkB;MAC1B,WAAW,EAAE,KAAK;IAGtB,yDAAmB;MACf,MAAM,EAAE,IAAI;MACZ,KAAK,EAAE,iBAAiB;MACxB,WAAW,EAAE,gBAAgB;MAC7B,OAAO,EAAE,wBAAwB;MACjC,UAAU,EAAE,iBAAiB;EAKrC,2CAAmB;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,OAAO;IACd,+DAAoB;MAAE,MAAM,EAAE,GAAG;EAGrC,0EAAkD;IAC9C,aAAa,EAAE,CAAC;EAGpB,2BAAG;IACC,MAAM,EAAE,WAAW;EAGvB,2CAAmB;IACf,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,IAAI;IAEnB,oEAAyB;MACrB,KAAK,EAAE,GAAG;MAEV,0CAA2C;QAH/C,oEAAyB;UAGyB,KAAK,EAAE,GAAG;MACxD,iFAAe;QACX,WAAW,EAAE,CAAC;MAElB,oGAAgC;QAC5B,SAAS,EAAE,IAAI;MAEnB,yGAAqC;QACjC,WAAW,EAAE,GAAG;QAChB,KAAK,EAAE,OAAO;QACd,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;MAEtB,yGAAqC;QACjC,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,IAAI;EAKxB,gDAAwB;IACpB,WAAW,EAAE,GAAG;IAChB,WAAW,EAAE,OAAO;EAGxB;4EACkD;IAC9C,OAAO,EAAE,CAAC;IAjGd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IAgGT,gBAAgB,EAAE,WAAW;IAC7B,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,MAAM;IAElB;uGAAyB;MACrB,QAAQ,EAAE,MAAM;IAGpB;;;gHACkC;MAC9B,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,UAAU;MAE3B;;;sHAAI;QACA,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;MAEtB;;;wHAAM;QACF,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,GAAG;QAEd,yCAA0C;UAP9C;;;4HAAM;YAO0C,SAAS,EAAE,GAAG;EAItE,gDAAwB;IACpB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,MAAM;IAEvB,kDAAE;MACE,KAAK,EAAE,OAAO;MACd,YAAY,EAAE,IAAI;MAClB,UAAU,EAAE,GAAG;EAGvB,2CAAmB;IACf,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,aAAa;IAC9B,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,OAAO;IAEf,6CAAE;MACE,OAAO,EAAE,MAAM;MACf,KAAK,EAAE,OAAO;;ACtM1B,6BAA8B;EAC1B,MAAM,EAAE,SAAS;EAGjB,iDAAoB;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,CAAC;EAIZ;oEACqC;IACjC,OAAO,EAAE,CAAC;ID+Bd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,IAAI;IChCT,gBAAgB,EAAE,6BAA6B;IAC/C,qBAAqB,EAAE,wBAAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,OAAO,EAAE,KAAK;MACd,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,KAAK,EAAE,KAAK;MAEZ;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,MAAM;MAGvB;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,GAAG;QACZ,aAAa,EAAE,MAAM;MAGzB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;EAIjC,kEAAqC;IACjC,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,UAAU;IAEvB,yEAAO;MACH,QAAQ,EAAE,mBAAmB;MAC7B,gBAAgB,EAAE,yBAAyB;MAC3C,KAAK,EAAE,OAAO;MACd,OAAO,EAAE,GAAG;MACZ,WAAW,EAAE,GAAG;MAChB,SAAS,EAAE,IAAI;MACf,UAAU,EAAE,MAAM;MAClB,QAAQ,EAAE,QAAQ;MAClB,OAAO,EAAE,CAAC;MACV,KAAK,EAAE,KAAK;MACZ,GAAG,EAAE,GAAG;MACR,eAAe,EAAE,MAAM;MACvB,OAAO,EAAE,GAAG;IAGhB,+EAAe;MACX,UAAU,EAAE,OAAO;MACnB,gBAAgB,EAAE,gBAAiC;MACnD,OAAO,EAAE,CAAC;MACV,KAAK,EAAE,IAAI;MACX,GAAG,EAAE,IAAI;MACT,MAAM,EAAE,iBAAiB;MACzB,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,wCAAwC;IAExD,qFAAqB;MACjB,gBAAgB,EAAE,gBAAiC;MACnD,MAAM,EAAE,4BAA4B;EAG5C,yCAA0C;IAEtC;sEACqC;MACjC,qBAAqB,EAAE,uBAAuB;MAE9C;0FAAkB;QACd,KAAK,EAAE,IAAI;QACX;gGAAI;UAAE,KAAK,EAAE,IAAI;EAM7B;oEACqC;IACjC,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,IAAI;IAErB;wFAAkB;MACd,QAAQ,EAAE,QAAQ;MAClB,MAAM,EAAE,mBAAmB;MAC3B,aAAa,EAAE,IAAI;MACnB,UAAU,EAAE,IAAI;MAChB,SAAS,EAAE,gBAAgB;MAC3B,KAAK,EAAE,gBAAgB;MAEvB;4FAAE;QACE,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,UAAU;MAG1B;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;MAGzB,0CAA2C;QAlC/C;4FAAkB;UAmCV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,0CAA2C;QAvC/C;4FAAkB;UAwCV,SAAS,EAAE,oBAAoB;UAC/B,KAAK,EAAE,oBAAoB;MAG/B,yCAA0C;QA5C9C;4FAAkB;UA6CV,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,gBAAgB;MAG3B,yCAA0C;QAjD9C;4FAAkB;UAkDV,SAAS,EAAE,iBAAiB;UAC5B,KAAK,EAAE,iBAAiB",
|
||||
"sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-terms-list.css"
|
||||
|
|
|
@ -81,9 +81,9 @@ class Elastic_Press {
|
|||
|
||||
if ($item instanceof Entities\Item) {
|
||||
$ids_meta = array_keys ($post_args['meta']);
|
||||
\array_filter(function($n) {
|
||||
$ids_meta = \array_filter($ids_meta, function($n) {
|
||||
if (is_numeric($n)) return intval($n);
|
||||
}, $ids_meta);
|
||||
});
|
||||
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
|
||||
|
@ -584,7 +584,7 @@ class Elastic_Press {
|
|||
}
|
||||
|
||||
if($search != '') {
|
||||
$formatted_args['query']['bool']['must'][] = ["wildcard"=>["$field.name.raw" => "*$search*"]];
|
||||
$formatted_args['query']['bool']['must'][] = ["wildcard"=>["$field.name.sortable" => "*$search*"]];
|
||||
}
|
||||
} else {
|
||||
$aggs[$id] = [
|
||||
|
@ -613,7 +613,7 @@ class Elastic_Press {
|
|||
$field_relationship_label = "$field_relationship_label[0].$field_relationship_label[1].relationship_label";
|
||||
//$formatted_args['query']['bool']['must'][] = ["wildcard"=>["$field" => "*$search*"]];
|
||||
$formatted_args['query']['bool']['must'][] = ["bool"=>["should"=>[
|
||||
["wildcard"=>["$field"=>"*$search*"]],
|
||||
["wildcard"=>["$id.value.sortable"=>"*$search*"]],
|
||||
["wildcard"=>["$field_relationship_label"=>"*$search*"]] //pega nome do metadado é melhor!
|
||||
]]];
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ class Media {
|
|||
private static $instance = null;
|
||||
private static $file_handle = null;
|
||||
private static $file_name = null;
|
||||
private $attachment_html_url_base = 'tainacan_attachment_html';
|
||||
|
||||
public static function get_instance() {
|
||||
if(!isset(self::$instance)) {
|
||||
|
@ -18,6 +19,25 @@ class Media {
|
|||
return self::$instance;
|
||||
}
|
||||
|
||||
protected function __construct() {
|
||||
add_action( 'init', [$this, 'add_attachment_page_rewrite_rule'] );
|
||||
add_filter( 'query_vars', [$this, 'attachment_page_add_var'] );
|
||||
add_action( 'template_redirect', [$this, 'attachment_page'] );
|
||||
}
|
||||
|
||||
public function add_attachment_page_rewrite_rule() {
|
||||
add_rewrite_rule(
|
||||
'^' . $this->attachment_html_url_base . '/([0-9]+)/?',
|
||||
'index.php?tainacan_attachment_page=$matches[1]',
|
||||
'top'
|
||||
);
|
||||
}
|
||||
|
||||
public function attachment_page_add_var($vars) {
|
||||
$vars[] = 'tainacan_attachment_page';
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert an attachment from an URL address.
|
||||
*
|
||||
|
@ -237,7 +257,7 @@ class Media {
|
|||
return;
|
||||
}
|
||||
|
||||
$content_index_meta = '_document_content_index';
|
||||
$content_index_meta = 'document_content_index';
|
||||
|
||||
if ($file == null) {
|
||||
$meta_id = update_post_meta( $item_id, $content_index_meta, null );
|
||||
|
@ -273,4 +293,70 @@ class Media {
|
|||
}
|
||||
}
|
||||
|
||||
public function get_attachment_html_url($attachment_id) {
|
||||
return site_url( $this->attachment_html_url_base . '/' . (int) $attachment_id );
|
||||
}
|
||||
|
||||
public function attachment_page() {
|
||||
$att_id = get_query_var('tainacan_attachment_page');
|
||||
|
||||
if ( ! $att_id ) {
|
||||
return; // continue normal execution
|
||||
}
|
||||
|
||||
$attachment = get_post($att_id);
|
||||
|
||||
if ( $attachment instanceof \WP_Post && $attachment->post_type == 'attachment' ) {
|
||||
$parent = $attachment->post_parent;
|
||||
|
||||
$item = \Tainacan\Repositories\Items::get_instance()->fetch( (int) $parent );
|
||||
|
||||
if ( $item instanceof \Tainacan\Entities\Item ) {
|
||||
|
||||
if ( ! $item->can_read() ) {
|
||||
|
||||
http_response_code(401);
|
||||
die;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
http_response_code(404);
|
||||
die;
|
||||
}
|
||||
|
||||
} else {
|
||||
http_response_code(404);
|
||||
die;
|
||||
}
|
||||
|
||||
$output = '';
|
||||
|
||||
if ( wp_attachment_is_image($att_id) ) {
|
||||
|
||||
$img = wp_get_attachment_url($attachment->ID, 'large');
|
||||
$output .= "<img style='max-width: 100%;' src='" . $img . "' />";
|
||||
|
||||
} else {
|
||||
|
||||
global $wp_embed;
|
||||
|
||||
$url = wp_get_attachment_url($att_id);
|
||||
|
||||
$embed = $wp_embed->autoembed($url);
|
||||
|
||||
if ( $embed == $url ) {
|
||||
$output .= sprintf("<a href='%s' target='blank'>%s</a>", $url, $url);
|
||||
} else {
|
||||
$output .= $embed;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo $output;
|
||||
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -11,6 +11,8 @@ class Private_Files {
|
|||
|
||||
private static $instance = null;
|
||||
|
||||
public $dir_separator;
|
||||
|
||||
public static function get_instance() {
|
||||
if(!isset(self::$instance)) {
|
||||
self::$instance = new self();
|
||||
|
@ -20,6 +22,11 @@ class Private_Files {
|
|||
}
|
||||
|
||||
protected function __construct() {
|
||||
|
||||
// Once upon a time I thought I had to worry about Windows and use DIRECTORY_SEPARATOR
|
||||
// but this only gave me frustration and bugs.
|
||||
$this->dir_separator = '/';
|
||||
|
||||
add_filter('wp_handle_upload_prefilter', [$this, 'pre_upload']);
|
||||
add_filter('wp_handle_sideload_prefilter', [$this, 'pre_upload']);
|
||||
add_filter('wp_handle_upload', [$this, 'post_upload']);
|
||||
|
@ -160,8 +167,8 @@ class Private_Files {
|
|||
|
||||
$path['path'] = str_replace($path['subdir'], '', $path['path']); //remove default subdir (year/month)
|
||||
$path['url'] = str_replace($path['subdir'], '/' . $tainacan_basepath . '/' . $col_id_url . '/' . $item_id_url, $path['url']);
|
||||
$path['path'] .= DIRECTORY_SEPARATOR . $tainacan_basepath . DIRECTORY_SEPARATOR . $col_id . '/' . $item_id;
|
||||
$path['subdir'] = DIRECTORY_SEPARATOR . $tainacan_basepath . DIRECTORY_SEPARATOR . $col_id . '/' . $item_id;
|
||||
$path['path'] .= $this->dir_separator . $tainacan_basepath . $this->dir_separator . $col_id . $this->dir_separator . $item_id;
|
||||
$path['subdir'] = $this->dir_separator . $tainacan_basepath . $this->dir_separator . $col_id . $this->dir_separator . $item_id;
|
||||
|
||||
}
|
||||
|
||||
|
@ -193,31 +200,31 @@ class Private_Files {
|
|||
|
||||
$requested_uri = str_replace('/' . $this->get_private_folder_prefix(), '/', $requested_uri);
|
||||
|
||||
$file_path = \str_replace( '/', DIRECTORY_SEPARATOR, str_replace($base_upload_url, '', $requested_uri) );
|
||||
$file_path = \str_replace( '/', $this->dir_separator, str_replace($base_upload_url, '', $requested_uri) );
|
||||
|
||||
$file = $upload_dir['basedir'] . $file_path;
|
||||
|
||||
$existing_file = false;
|
||||
|
||||
$file_dirs = explode(DIRECTORY_SEPARATOR, $file);
|
||||
$file_dirs = explode($this->dir_separator, $file);
|
||||
$file_dirs_size = sizeof($file_dirs);
|
||||
|
||||
$item_id = $file_dirs[$file_dirs_size-2];
|
||||
$collection_id = $file_dirs[$file_dirs_size-3];
|
||||
|
||||
// private item
|
||||
$prefixed_file = str_replace( DIRECTORY_SEPARATOR . $item_id . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR . $this->get_private_folder_prefix() . $item_id . DIRECTORY_SEPARATOR, $file);
|
||||
$prefixed_file = str_replace( $this->dir_separator . $item_id . $this->dir_separator, $this->dir_separator . $this->get_private_folder_prefix() . $item_id . $this->dir_separator, $file);
|
||||
|
||||
if ( \file_exists( $prefixed_file ) ) {
|
||||
$existing_file = $prefixed_file;
|
||||
}
|
||||
// private collection
|
||||
$prefixed_collection = str_replace( DIRECTORY_SEPARATOR . $collection_id . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR . $this->get_private_folder_prefix() . $collection_id . DIRECTORY_SEPARATOR, $file);
|
||||
$prefixed_collection = str_replace( $this->dir_separator . $collection_id . $this->dir_separator, $this->dir_separator . $this->get_private_folder_prefix() . $collection_id . $this->dir_separator, $file);
|
||||
if ( !$existing_file && \file_exists( $prefixed_collection ) ) {
|
||||
$existing_file = $prefixed_collection;
|
||||
}
|
||||
// private both
|
||||
$prefixed_both = str_replace( DIRECTORY_SEPARATOR . $collection_id . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR . $this->get_private_folder_prefix() . $collection_id . DIRECTORY_SEPARATOR, $prefixed_file);
|
||||
$prefixed_both = str_replace( $this->dir_separator . $collection_id . $this->dir_separator, $this->dir_separator . $this->get_private_folder_prefix() . $collection_id . $this->dir_separator, $prefixed_file);
|
||||
if ( !$existing_file && \file_exists( $prefixed_both ) ) {
|
||||
$existing_file = $prefixed_both;
|
||||
}
|
||||
|
@ -255,7 +262,7 @@ class Private_Files {
|
|||
*/
|
||||
function image_get_intermediate_size($data, $post_id, $size) {
|
||||
|
||||
$data['path'] = str_replace(DIRECTORY_SEPARATOR . $this->get_private_folder_prefix(), DIRECTORY_SEPARATOR, $data['path']);
|
||||
$data['path'] = str_replace($this->dir_separator . $this->get_private_folder_prefix(), $this->dir_separator, $data['path']);
|
||||
$data['url'] = str_replace('/' . $this->get_private_folder_prefix(), '/', $data['url']);
|
||||
|
||||
return $data;
|
||||
|
@ -278,8 +285,8 @@ class Private_Files {
|
|||
*/
|
||||
function update_item_and_collection($obj) {
|
||||
|
||||
$folder = DIRECTORY_SEPARATOR;
|
||||
$check_folder = DIRECTORY_SEPARATOR;
|
||||
$folder = $this->dir_separator;
|
||||
$check_folder = $this->dir_separator;
|
||||
$check = false;
|
||||
|
||||
if ( $obj instanceof \Tainacan\Entities\Collection ) {
|
||||
|
@ -298,11 +305,11 @@ class Private_Files {
|
|||
$collection = $obj->get_collection();
|
||||
$col_status_object = get_post_status_object($collection->get_status());
|
||||
|
||||
$folder .= $col_status_object->public ? $collection->get_id() : $this->get_private_folder_prefix() . $collection->get_id() . DIRECTORY_SEPARATOR;
|
||||
$check_folder .= $col_status_object->public ? $collection->get_id() : $this->get_private_folder_prefix() . $collection->get_id() . DIRECTORY_SEPARATOR;
|
||||
$folder .= $col_status_object->public ? $collection->get_id() : $this->get_private_folder_prefix() . $collection->get_id() . $this->dir_separator;
|
||||
$check_folder .= $col_status_object->public ? $collection->get_id() : $this->get_private_folder_prefix() . $collection->get_id() . $this->dir_separator;
|
||||
|
||||
$folder .= DIRECTORY_SEPARATOR;
|
||||
$check_folder .= DIRECTORY_SEPARATOR;
|
||||
$folder .= $this->dir_separator;
|
||||
$check_folder .= $this->dir_separator;
|
||||
|
||||
$status_obj = get_post_status_object($obj->get_status());
|
||||
|
||||
|
@ -317,8 +324,8 @@ class Private_Files {
|
|||
|
||||
$upload_dir = wp_get_upload_dir();
|
||||
$base_dir = $upload_dir['basedir'];
|
||||
$full_path = $base_dir . DIRECTORY_SEPARATOR . $this->get_items_uploads_folder() . $folder;
|
||||
$full_path_check = $base_dir . DIRECTORY_SEPARATOR . $this->get_items_uploads_folder() . $check_folder;
|
||||
$full_path = $base_dir . $this->dir_separator . $this->get_items_uploads_folder() . $folder;
|
||||
$full_path_check = $base_dir . $this->dir_separator . $this->get_items_uploads_folder() . $check_folder;
|
||||
|
||||
if (\file_exists($full_path_check)) {
|
||||
rename($full_path_check, $full_path);
|
||||
|
@ -346,7 +353,7 @@ class Private_Files {
|
|||
|
||||
$upload_dir = wp_get_upload_dir();
|
||||
$base_dir = $upload_dir['basedir'];
|
||||
$full_path = $base_dir . DIRECTORY_SEPARATOR . $this->get_items_uploads_folder() . DIRECTORY_SEPARATOR . '*' . DIRECTORY_SEPARATOR . $prefix;
|
||||
$full_path = $base_dir . $this->dir_separator . $this->get_items_uploads_folder() . $this->dir_separator . '*' . $this->dir_separator . $prefix;
|
||||
|
||||
foreach ($ids as $id) {
|
||||
$folder = $full_path . $id;
|
||||
|
@ -355,9 +362,9 @@ class Private_Files {
|
|||
if (sizeof($found) == 1 && isset($found[0])) {
|
||||
|
||||
if ($status_obj->public) {
|
||||
$target = str_replace(DIRECTORY_SEPARATOR . $this->get_private_folder_prefix() . $id, DIRECTORY_SEPARATOR . $id, $found[0]);
|
||||
$target = str_replace($this->dir_separator . $this->get_private_folder_prefix() . $id, $this->dir_separator . $id, $found[0]);
|
||||
} else {
|
||||
$target = str_replace(DIRECTORY_SEPARATOR . $id, DIRECTORY_SEPARATOR . $this->get_private_folder_prefix() . $id, $found[0]);
|
||||
$target = str_replace($this->dir_separator . $id, $this->dir_separator . $this->get_private_folder_prefix() . $id, $found[0]);
|
||||
}
|
||||
|
||||
rename($found[0], $target);
|
||||
|
|
|
@ -95,6 +95,14 @@ class Log extends Entity {
|
|||
return $this->get_mapped_property( 'date' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the log slug
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
function get_slug() {
|
||||
return $this->get_mapped_property( 'slug' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Log description
|
||||
|
@ -203,7 +211,7 @@ class Log extends Entity {
|
|||
}
|
||||
|
||||
public function get_object_type() {
|
||||
$this->get_mapped_property('object_type');
|
||||
return $this->get_mapped_property('object_type');
|
||||
}
|
||||
|
||||
public function set_object_type($value) {
|
||||
|
@ -211,7 +219,7 @@ class Log extends Entity {
|
|||
}
|
||||
|
||||
public function get_object_id() {
|
||||
$this->get_mapped_property('object_id');
|
||||
return $this->get_mapped_property('object_id');
|
||||
}
|
||||
|
||||
public function set_object_id($value) {
|
||||
|
@ -233,7 +241,7 @@ class Log extends Entity {
|
|||
}
|
||||
|
||||
public function get_action() {
|
||||
$this->get_mapped_property('action');
|
||||
return $this->get_mapped_property('action');
|
||||
}
|
||||
|
||||
public function set_action($value) {
|
||||
|
|
|
@ -81,6 +81,7 @@ class Taxonomy extends Entity {
|
|||
'rewrite' => [
|
||||
'slug' => $this->get_slug()
|
||||
],
|
||||
'update_count_callback' => '_update_generic_term_count'
|
||||
);
|
||||
|
||||
if (taxonomy_exists($this->get_db_identifier())){
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<img
|
||||
:alt="$i18n.get('label_thumbnail')"
|
||||
width="24"
|
||||
:src="`${props.option.img}`">
|
||||
:src="props.option.img">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
<span class="ellipsed-text">{{ props.option.label }}</span>
|
||||
|
@ -49,8 +49,7 @@
|
|||
return {
|
||||
selected:'',
|
||||
options: [],
|
||||
label: '',
|
||||
relatedCollectionId: ''
|
||||
label: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -58,15 +57,6 @@
|
|||
this.updateSelectedValues();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' &&
|
||||
this.filter.metadatum &&
|
||||
this.filter.metadatum.metadata_type_object &&
|
||||
this.filter.metadatum.metadata_type_object.options &&
|
||||
this.filter.metadatum.metadata_type_object.options.collection_id) {
|
||||
this.relatedCollectionId = this.filter.metadatum.metadata_type_object.options.collection_id;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.updateSelectedValues();
|
||||
},
|
||||
|
@ -134,11 +124,9 @@
|
|||
|
||||
let endpoint = '/items/' + metadata.value + '?fetch_only=title,thumbnail';
|
||||
|
||||
if (this.relatedCollectionId != '')
|
||||
endpoint = '/collection/' + this.relatedCollectionId + endpoint;
|
||||
|
||||
axios.get(endpoint)
|
||||
.then( res => {
|
||||
|
||||
let item = res.data;
|
||||
this.label = item.title;
|
||||
this.selected = item.title;
|
||||
|
@ -151,24 +139,13 @@
|
|||
} else {
|
||||
this.label = metadata.value;
|
||||
this.selected = metadata.value;
|
||||
|
||||
this.$emit( 'sendValuesToTags', { label: this.label, value: this.selected });
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
this.label = '';
|
||||
this.selected = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
#profileImage {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
font-size: 2.1875rem;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 9.375rem;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
|
@ -1,259 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- Date -->
|
||||
<div v-if="metadatumType === 'Tainacan\\Metadata_Types\\Date'">
|
||||
<b-datepicker
|
||||
:aria-labelledby="'filter-label-id-' + filter.id"
|
||||
:placeholder="$i18n.get('label_selectbox_init')"
|
||||
v-model="dateInit"
|
||||
size="is-small"
|
||||
@focus="isTouched = true"
|
||||
@input="validadeValues()"
|
||||
editable
|
||||
:date-formatter="(date) => dateFormatter(date)"
|
||||
:date-parser="(date) => dateParser(date)"
|
||||
icon="calendar-today"
|
||||
:day-names="[
|
||||
$i18n.get('datepicker_short_sunday'),
|
||||
$i18n.get('datepicker_short_monday'),
|
||||
$i18n.get('datepicker_short_tuesday'),
|
||||
$i18n.get('datepicker_short_wednesday'),
|
||||
$i18n.get('datepicker_short_thursday'),
|
||||
$i18n.get('datepicker_short_friday'),
|
||||
$i18n.get('datepicker_short_saturday'),
|
||||
]"/>
|
||||
<p class="is-size-7 has-text-centered is-marginless">{{ $i18n.get('label_until') }}</p>
|
||||
<b-datepicker
|
||||
:aria-labelledby="'filter-label-id-' + filter.id"
|
||||
:placeholder="$i18n.get('label_selectbox_init')"
|
||||
v-model="dateEnd"
|
||||
size="is-small"
|
||||
@input="validadeValues()"
|
||||
@focus="isTouched = true"
|
||||
editable
|
||||
:date-formatter="(date) => dateFormatter(date)"
|
||||
:date-parser="(date) => dateParser(date)"
|
||||
icon="calendar-today"
|
||||
:day-names="[
|
||||
$i18n.get('datepicker_short_sunday'),
|
||||
$i18n.get('datepicker_short_monday'),
|
||||
$i18n.get('datepicker_short_tuesday'),
|
||||
$i18n.get('datepicker_short_wednesday'),
|
||||
$i18n.get('datepicker_short_thursday'),
|
||||
$i18n.get('datepicker_short_friday'),
|
||||
$i18n.get('datepicker_short_saturday'),
|
||||
]"/>
|
||||
</div>
|
||||
|
||||
<!-- Numeric -->
|
||||
<div v-else>
|
||||
<b-input
|
||||
type="number"
|
||||
:aria-labelledby="'filter-label-id-' + filter.id"
|
||||
size="is-small"
|
||||
step="any"
|
||||
@input="validadeValues"
|
||||
v-model="valueInit"/>
|
||||
<p class="is-size-7 has-text-centered is-marginless">{{ $i18n.get('label_until') }}</p>
|
||||
<b-input
|
||||
type="number"
|
||||
:aria-labelledby="'filter-label-id-' + filter.id"
|
||||
size="is-small"
|
||||
step="any"
|
||||
@input="validadeValues"
|
||||
@focus="isTouched = true"
|
||||
v-model="valueEnd"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { wpAjax, dateInter } from "../../../admin/js/mixins";
|
||||
import { filterTypeMixin } from '../filter-types-mixin';
|
||||
import moment from 'moment';
|
||||
|
||||
export default {
|
||||
mixins: [
|
||||
wpAjax,
|
||||
dateInter,
|
||||
filterTypeMixin
|
||||
],
|
||||
mounted() {
|
||||
this.updateSelectedValues();
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
valueInit: '',
|
||||
valueEnd: '',
|
||||
dateInit: undefined,
|
||||
dateEnd: undefined,
|
||||
isTouched: false,
|
||||
type: 'DECIMAL'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isTouched( val ){
|
||||
if ( val && this.dateInit === null)
|
||||
this.dateInit = new Date();
|
||||
|
||||
if ( val && this.dateEnd === null)
|
||||
this.dateEnd = new Date();
|
||||
},
|
||||
'query.metaquery'() {
|
||||
this.updateSelectedValues();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// only validate if the first value is higher than first
|
||||
validadeValues: _.debounce( function (){
|
||||
|
||||
if( this.metadatumType === 'Tainacan\\Metadata_Types\\Date' ){
|
||||
if (this.dateInit === undefined)
|
||||
this.dateInit = new Date();
|
||||
|
||||
if (this.dateEnd === undefined)
|
||||
this.dateEnd = new Date();
|
||||
|
||||
if ( this.dateInit > this.dateEnd ) {
|
||||
this.showErrorMessage();
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (this.valueInit.constructor == Number)
|
||||
this.valueInit = this.valueInit.valueOf();
|
||||
|
||||
if (this.valueEnd.constructor == Number)
|
||||
this.valueEnd = this.valueEnd.valueOf();
|
||||
|
||||
this.valueInit = parseFloat(this.valueInit);
|
||||
this.valueEnd = parseFloat(this.valueEnd);
|
||||
|
||||
if (isNaN(this.valueInit) || isNaN(this.valueEnd))
|
||||
return
|
||||
|
||||
if (this.valueInit > this.valueEnd) {
|
||||
this.showErrorMessage();
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.emit();
|
||||
}, 800),
|
||||
// message for error
|
||||
showErrorMessage(){
|
||||
if ( !this.isTouched ) return false;
|
||||
|
||||
this.$buefy.toast.open({
|
||||
duration: 3000,
|
||||
message: this.$i18n.get('info_error_first_value_greater'),
|
||||
position: 'is-bottom',
|
||||
type: 'is-danger'
|
||||
})
|
||||
},
|
||||
dateFormatter(dateObject){
|
||||
return moment(dateObject, moment.ISO_8601).format(this.dateFormat);
|
||||
},
|
||||
dateParser(dateString){
|
||||
return moment(dateString, this.dateFormat).toDate();
|
||||
},
|
||||
updateSelectedValues(){
|
||||
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
|
||||
return false;
|
||||
|
||||
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key == this.metadatumId);
|
||||
|
||||
if (index >= 0) {
|
||||
let metadata = this.query.metaquery[ index ];
|
||||
|
||||
if( metadata.value && metadata.value.length > 0 && this.metadatumType === 'Tainacan\\Metadata_Types\\Numeric'){
|
||||
this.valueInit = parseFloat(metadata.value[0]);
|
||||
this.valueEnd = parseFloat(metadata.value[1]);
|
||||
} else if( metadata.value && metadata.value.length > 0 ){
|
||||
this.dateInit = new Date(metadata.value[0]);
|
||||
this.dateEnd = new Date(metadata.value[1]);
|
||||
}
|
||||
|
||||
if (metadata.value[0] != undefined && metadata.value[1] != undefined)
|
||||
this.$emit('sendValuesToTags', {
|
||||
label: (this.metadatumType === 'Tainacan\\Metadata_Types\\Numeric' ? (metadata.value[0] + ' - ' + metadata.value[1]) : this.parseDateToNavigatorLanguage(metadata.value[0]) + ' - ' + this.parseDateToNavigatorLanguage(metadata.value[1])),
|
||||
value: [metadata.value[0], metadata.value[1]]
|
||||
});
|
||||
} else {
|
||||
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Numeric') {
|
||||
this.valueInit = '';
|
||||
this.valueEnd = '';
|
||||
} else {
|
||||
this.dateInit = null;
|
||||
this.dateEnd = null;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
// emit the operation for listeners
|
||||
emit() {
|
||||
let values = [];
|
||||
|
||||
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Date') {
|
||||
|
||||
if (this.dateInit === null && this.dateEnd === null) {
|
||||
values = [];
|
||||
this.type = 'DATE';
|
||||
} else {
|
||||
let dateInit = this.dateInit.getUTCFullYear() + '-' +
|
||||
('00' + (this.dateInit.getUTCMonth() + 1)).slice(-2) + '-' +
|
||||
('00' + this.dateInit.getUTCDate()).slice(-2);
|
||||
let dateEnd = this.dateEnd.getUTCFullYear() + '-' +
|
||||
('00' + (this.dateEnd.getUTCMonth() + 1)).slice(-2) + '-' +
|
||||
('00' + this.dateEnd.getUTCDate()).slice(-2);
|
||||
values = [ dateInit, dateEnd ];
|
||||
this.type = 'DATE';
|
||||
}
|
||||
} else {
|
||||
if (this.valueInit === null || this.valueEnd === null
|
||||
|| this.valueInit === '' || this.valueEnd === ''){
|
||||
return;
|
||||
} else {
|
||||
values = [ this.valueInit, this.valueEnd ];
|
||||
|
||||
if(this.valueInit !== this.valueEnd && (this.valueInit % 1 !== 0 && this.valueEnd % 1 == 0)) {
|
||||
this.type = 'DECIMAL';
|
||||
} else if(this.valueInit !== this.valueEnd &&
|
||||
this.valueInit % 1 !== 0 &&
|
||||
this.valueEnd % 1 !== 0) {
|
||||
|
||||
this.type = '';
|
||||
} else if(this.valueInit !== this.valueEnd &&
|
||||
!(this.valueInit % 1 == 0 && this.valueEnd % 1 !== 0)){
|
||||
this.type = 'DECIMAL';
|
||||
} else {
|
||||
this.type = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit('input', {
|
||||
filter: 'range',
|
||||
type: this.type,
|
||||
compare: 'BETWEEN',
|
||||
metadatum_id: this.metadatumId,
|
||||
collection_id: this.collectionId,
|
||||
value: values
|
||||
});
|
||||
|
||||
if (values[0] != undefined && values[1] != undefined)
|
||||
this.$emit( 'sendValuesToTags', {
|
||||
label: (this.metadatumType === 'Tainacan\\Metadata_Types\\Numeric' ? (values[0] + ' - ' + values[1]) : this.parseDateToNavigatorLanguage(values[0]) + ' - ' + this.parseDateToNavigatorLanguage(values[1])),
|
||||
value: [ values[0], values[1] ]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.field {
|
||||
margin-bottom: 0.125rem !important;
|
||||
}
|
||||
p.is-size-7 {
|
||||
margin-bottom: 0.125rem !important;
|
||||
}
|
||||
</style>
|
|
@ -1,74 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Tainacan\Filter_Types;
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
|
||||
/**
|
||||
* Class TainacanMetadatumType
|
||||
*/
|
||||
class Custom_Interval extends Filter_Type {
|
||||
|
||||
function __construct(){
|
||||
$this->set_name( __('Custom Interval', 'tainacan'));
|
||||
$this->set_supported_types(['float','date']);
|
||||
$this->set_component('tainacan-filter-custom-interval');
|
||||
$this->set_use_max_options(false);
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="6">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<p class="is-size-7 has-text-centered is-marginless">until</p>
|
||||
<div class="b-numberinput field is-grouped">
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="control is-small is-clearfix">
|
||||
<input type="number" step="0.01" class="input is-small" value="10">
|
||||
</div>
|
||||
<p class="control">
|
||||
<button type="button" class="button is-primary is-small">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $filter
|
||||
* @return string
|
||||
* @internal param $metadatum
|
||||
*/
|
||||
public function render( $filter ){
|
||||
$type = ( $filter->get_metadatum()->get_metadata_type() === 'Tainacan\Metadata_Types\Date' ) ? 'date' : 'numeric';
|
||||
return '<tainacan-filter-custom-interval
|
||||
name="'.$filter->get_name().'"
|
||||
collection_id="'.$filter->get_collection_id().'"
|
||||
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-custom-interval>';
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@
|
|||
:date-formatter="(date) => dateFormatter(date)"
|
||||
:date-parser="(date) => dateParser(date)"
|
||||
icon="calendar-today"
|
||||
:years-range="[-200, 100]"
|
||||
:day-names="[
|
||||
$i18n.get('datepicker_short_sunday'),
|
||||
$i18n.get('datepicker_short_monday'),
|
||||
|
@ -32,6 +33,7 @@
|
|||
:date-formatter="(date) => dateFormatter(date)"
|
||||
:date-parser="(date) => dateParser(date)"
|
||||
icon="calendar-today"
|
||||
:years-range="[-200, 50]"
|
||||
:day-names="[
|
||||
$i18n.get('datepicker_short_sunday'),
|
||||
$i18n.get('datepicker_short_monday'),
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
:date-parser="(date) => dateParser(date)"
|
||||
size="is-small"
|
||||
icon="calendar-today"
|
||||
:years-range="[-200, 50]"
|
||||
:day-names="[
|
||||
$i18n.get('datepicker_short_sunday'),
|
||||
$i18n.get('datepicker_short_monday'),
|
||||
|
|
|
@ -276,13 +276,14 @@ export const dynamicFilterTypeMixin = {
|
|||
sResults.push({
|
||||
label: item.label,
|
||||
value: item.value,
|
||||
img: item.thumbnail && item.thumbnail['tainacan-small'] && item.thumbnail['tainacan-small'][0] ? item.thumbnail['tainacan-small'][0] : (item.img ? item.img : ''),
|
||||
total_items: item.total_items
|
||||
});
|
||||
} else if (indexToIgnore < 0) {
|
||||
opts.push({
|
||||
label: item.label,
|
||||
value: item.value,
|
||||
img: (item.img ? item.img : this.thumbPlaceholderPath),
|
||||
img: item.thumbnail && item.thumbnail['tainacan-small'] && item.thumbnail['tainacan-small'][0] ? item.thumbnail['tainacan-small'][0] : (item.img ? item.img : ''),
|
||||
total_items: item.total_items
|
||||
});
|
||||
}
|
||||
|
@ -291,14 +292,14 @@ export const dynamicFilterTypeMixin = {
|
|||
sResults.push({
|
||||
label: item.label,
|
||||
value: item.value,
|
||||
img: (item.img ? item.img : this.thumbPlaceholderPath),
|
||||
img: item.thumbnail && item.thumbnail['tainacan-small'] && item.thumbnail['tainacan-small'][0] ? item.thumbnail['tainacan-small'][0] : (item.img ? item.img : ''),
|
||||
total_items: item.total_items
|
||||
});
|
||||
} else {
|
||||
opts.push({
|
||||
label: item.label,
|
||||
value: item.value,
|
||||
img: (item.img ? item.img : this.thumbPlaceholderPath),
|
||||
img: item.thumbnail && item.thumbnail['tainacan-small'] && item.thumbnail['tainacan-small'][0] ? item.thumbnail['tainacan-small'][0] : (item.img ? item.img : ''),
|
||||
total_items: item.total_items
|
||||
});
|
||||
}
|
||||
|
|
|
@ -31,19 +31,21 @@
|
|||
:key="index">
|
||||
<b-field>
|
||||
<b-input
|
||||
expanded="true"
|
||||
expanded
|
||||
:placeholder="$i18n.get('label')"
|
||||
@input="onUpdate(interval)"
|
||||
v-model="interval.label" />
|
||||
</b-field>
|
||||
<b-field>
|
||||
<b-input
|
||||
expanded
|
||||
type="number"
|
||||
step="0.01"
|
||||
:placeholder="$i18n.get('info_initial_value')"
|
||||
@input="onUpdate(interval, true)"
|
||||
v-model="interval.from" />
|
||||
<b-input
|
||||
expanded
|
||||
type="number"
|
||||
step="0.01"
|
||||
:placeholder="$i18n.get('info_final_value')"
|
||||
|
@ -54,7 +56,7 @@
|
|||
<a
|
||||
role="button"
|
||||
@click="addInterval(index)"
|
||||
class="is-inline add-link"
|
||||
class="add-link"
|
||||
:title="$i18n.get('add_value')">
|
||||
<span class="icon is-small">
|
||||
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
|
||||
|
@ -68,7 +70,7 @@
|
|||
<a
|
||||
role="button"
|
||||
@click="removeInterval(index)"
|
||||
class="is-inline add-link"
|
||||
class="add-link"
|
||||
:title="$i18n.get('remove_value')">
|
||||
<span class="icon is-small">
|
||||
<i class="tainacan-icon has-text-secondary tainacan-icon-repprovedcircle"/>
|
||||
|
@ -105,10 +107,10 @@
|
|||
interval.to == "" || interval.from == "" ||
|
||||
Number(interval.to) < Number(interval.from))
|
||||
) {
|
||||
if (this.isValid) {
|
||||
this.isValid = false;
|
||||
|
||||
if (interval.to != '' && interval.from != '' && interval.to != null && interval.from != null)
|
||||
this.showErrorMessage()
|
||||
}
|
||||
} else {
|
||||
this.isValid = true;
|
||||
this.$emit('input', {
|
||||
|
@ -181,6 +183,12 @@
|
|||
}
|
||||
.field.has-addons {
|
||||
margin-bottom: 0.125rem;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
&>.control {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,9 +74,7 @@
|
|||
|
||||
export default {
|
||||
props: {
|
||||
filter: Object,
|
||||
value: [String, Number, Array],
|
||||
disabled: false,
|
||||
value: [String, Number, Array]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
mixins: [filterTypeMixin, dynamicFilterTypeMixin],
|
||||
data(){
|
||||
return {
|
||||
options: []
|
||||
options: [],
|
||||
selected: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -75,7 +76,6 @@
|
|||
let metadata = this.query.metaquery[ index ];
|
||||
if (this.selected != metadata.value) {
|
||||
this.selected = metadata.value;
|
||||
this.$emit('sendValuesToTags', { label: metadata.value, value: metadata.value })
|
||||
}
|
||||
} else {
|
||||
this.selected = '';
|
||||
|
@ -83,6 +83,8 @@
|
|||
} else {
|
||||
this.selected = '';
|
||||
}
|
||||
|
||||
this.$emit('sendValuesToTags', { label: this.selected, value: this.selected })
|
||||
},
|
||||
onSelect(value) {
|
||||
this.$emit('input', {
|
||||
|
@ -91,7 +93,6 @@
|
|||
collection_id: this.collectionId,
|
||||
value: value
|
||||
});
|
||||
this.$emit('sendValuesToTags', { label: value, value: value })
|
||||
|
||||
this.updateSelectedValues();
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@
|
|||
}
|
||||
|
||||
.datepicker {
|
||||
@media screen and (min-width: 1024px) {
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
.datepicker-header {
|
||||
|
||||
|
@ -211,7 +211,7 @@
|
|||
max-width: 165px !important;
|
||||
}
|
||||
.pagination .pagination-list .control {
|
||||
width: 74px !important;
|
||||
width: 77px !important;
|
||||
|
||||
.select {
|
||||
min-width: 100% !important;
|
||||
|
@ -221,14 +221,13 @@
|
|||
font-size: 0.75rem !important;
|
||||
height: 24px !important;
|
||||
min-width: 100% !important;
|
||||
|
||||
}
|
||||
&:not(.is-loading)::after {
|
||||
margin-top: -13px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.datepicker-cell {
|
||||
padding: 0.15rem 0.175rem !important;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<script>
|
||||
import qs from 'qs';
|
||||
import { tainacan as axios, all } from '../../../js/axios/axios';
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
import { filterTypeMixin, dynamicFilterTypeMixin } from '../filter-types-mixin';
|
||||
|
||||
export default {
|
||||
|
@ -58,6 +58,9 @@
|
|||
this.updateSelectedValues();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.updateSelectedValues();
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
results:'',
|
||||
|
@ -151,20 +154,20 @@
|
|||
});
|
||||
},
|
||||
getTerms(metadata) {
|
||||
let promises = [];
|
||||
for (let id of metadata.terms) {
|
||||
//getting a specific value from api, does not need be in facets api
|
||||
promises.push(
|
||||
axios.get('/taxonomy/' + this.taxonomyId + '/terms/' + id + '?order=asc' )
|
||||
|
||||
let params = {
|
||||
'include': metadata.terms,
|
||||
'order': 'asc',
|
||||
'fetchonly': 0
|
||||
};
|
||||
|
||||
return axios.get('/taxonomy/' + this.taxonomyId + '/terms/?' + qs.stringify(params) )
|
||||
.then( res => {
|
||||
this.selected.push({ label: res.data.name, value: res.data.id });
|
||||
this.selected = res.data.map(term => { return { label: term.name, value: term.id } });
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
return all(promises);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class Core_Title extends Metadata_Type {
|
|||
$this->set_core(true);
|
||||
$this->set_related_mapped_prop('title');
|
||||
$this->set_component('tainacan-text');
|
||||
$this->set_name( __('Core Description', 'tainacan') );
|
||||
$this->set_name( __('Core Title', 'tainacan') );
|
||||
$this->set_description( __('The "Core Title" is a compulsory metadata automatically created for all collections by default. It is the main metadatum of the item and where the basic research tools will do their searches.', 'tainacan') );
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
<div
|
||||
:class="{'has-content': dateValue !== undefined && dateValue !== ''}"
|
||||
class="control is-inline">
|
||||
<input
|
||||
<b-input
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:disabled="disabled"
|
||||
class="input"
|
||||
:class="{'is-danger': isInvalidDate && dateValue}"
|
||||
type="text"
|
||||
v-mask="dateMask"
|
||||
v-model="dateValue"
|
||||
@blur="onBlur"
|
||||
@input="onInput"
|
||||
:placeholder="dateFormat.toLowerCase()">
|
||||
@input.native="onInput"
|
||||
:placeholder="dateFormat.toLowerCase()" />
|
||||
<p
|
||||
v-if="isInvalidDate && dateValue"
|
||||
class="has-text-danger is-italic is-size-7">{{ $i18n.get('info_error_invalid_date') }}</p>
|
||||
|
@ -25,10 +22,7 @@
|
|||
|
||||
<!--<div class="field">-->
|
||||
<!--<b-datepicker-->
|
||||
<!--:class="{'has-content': dateValue !== undefined && dateValue !== ''}"-->
|
||||
<!--:id="id"-->
|
||||
<!--v-model="dateValue"-->
|
||||
<!--@blur="onBlur"-->
|
||||
<!--:readonly="false"-->
|
||||
<!--inline-->
|
||||
<!--@input="onInput($event)"-->
|
||||
|
@ -36,7 +30,6 @@
|
|||
<!--</div>-->
|
||||
<!--</b-collapse>-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -56,17 +49,11 @@
|
|||
}
|
||||
},
|
||||
props: {
|
||||
id: '',
|
||||
metadatum: {
|
||||
type: Object
|
||||
},
|
||||
metadatum: Object,
|
||||
value: [String, Number, Array],
|
||||
disabled: false,
|
||||
},
|
||||
methods: {
|
||||
onBlur() {
|
||||
this.$emit('blur');
|
||||
},
|
||||
onInput: _.debounce(function ($event) {
|
||||
// Emty dates don't need to be validated, they remove the metadata
|
||||
if ($event.target.value != '') {
|
||||
|
@ -89,8 +76,14 @@
|
|||
} else {
|
||||
this.$emit('input', [null]);
|
||||
}
|
||||
this.$emit('blur');
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.control {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,99 @@
|
|||
<template>
|
||||
<section>
|
||||
<b-field :addons="false">
|
||||
<label class="label is-inline">
|
||||
{{ $i18n.getHelperTitle('tainacan-numeric', 'step') }}<span> * </span>
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('tainacan-numeric', 'step')"
|
||||
:message="$i18n.getHelperMessage('tainacan-numeric', 'step')"/>
|
||||
</label>
|
||||
<div
|
||||
v-if="!showEditStepOptions"
|
||||
class="is-flex">
|
||||
<b-select
|
||||
name="step_options"
|
||||
v-model="step"
|
||||
@input="onUpdateStep">
|
||||
<option value="0.001">0.001</option>
|
||||
<option value="0.01">0.01</option>
|
||||
<option value="0.1">0.1</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="100">100</option>
|
||||
<option value="1000">1000</option>
|
||||
<option
|
||||
v-if="step && ![0.001,0.01,0.1,1,2,5,10,100,1000].find( (element) => element == step )"
|
||||
:value="step">
|
||||
{{ step }}</option>
|
||||
</b-select>
|
||||
<button
|
||||
class="button is-white is-pulled-right"
|
||||
:aria-label="$i18n.get('edit')"
|
||||
@click.prevent="showEditStepOptions = true">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('edit'),
|
||||
autoHide: true,
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-edit has-text-secondary"/>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="showEditStepOptions"
|
||||
class="is-flex">
|
||||
<b-input
|
||||
name="max_options"
|
||||
v-model="step"
|
||||
@input="onUpdateStep"
|
||||
type="number"
|
||||
step="1" />
|
||||
<button
|
||||
@click.prevent="showEditStepOptions = false"
|
||||
class="button is-white is-pulled-right">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('close'),
|
||||
autoHide: true,
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-close has-text-secondary"/>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</b-field>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: [ String, Object, Array ]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
step: [Number, String],
|
||||
showEditStepOptions: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onUpdateStep(value) {
|
||||
this.$emit('input', { step: value });
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.step = this.value && this.value.step ? this.value.step : 0.01;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
section{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
|
@ -1,44 +1,32 @@
|
|||
<template>
|
||||
<b-input
|
||||
:disabled="disabled"
|
||||
:class="{'has-content': inputValue !== undefined && inputValue !== ''}"
|
||||
:id="id"
|
||||
lang="en"
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:value="value"
|
||||
@input="onInput($event)"
|
||||
type="number"
|
||||
:value="inputValue"
|
||||
step="0.01"
|
||||
@blur="onBlur"
|
||||
@change="onBlur"
|
||||
@input="onInput($event)"/>
|
||||
lang="en"
|
||||
:step="getStep"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
created(){
|
||||
if( this.value ){
|
||||
this.inputValue = this.value
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputValue: ''
|
||||
}
|
||||
},
|
||||
props: {
|
||||
id: '',
|
||||
metadatum: {
|
||||
type: Object
|
||||
},
|
||||
metadatum: Object,
|
||||
value: [String, Number, Array],
|
||||
disabled: false,
|
||||
},
|
||||
methods: {
|
||||
onBlur() {
|
||||
this.$emit('blur');
|
||||
computed: {
|
||||
getStep() {
|
||||
if (this.metadatum && this.metadatum.metadatum.metadata_type_options && this.metadatum.metadatum.metadata_type_options.step)
|
||||
return this.metadatum.metadatum.metadata_type_options.step;
|
||||
else
|
||||
return 0.01;
|
||||
}
|
||||
},
|
||||
onInput($event) {
|
||||
this.inputValue = $event;
|
||||
this.$emit('input', this.inputValue);
|
||||
methods: {
|
||||
onInput(value) {
|
||||
this.$emit('input', value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ class Numeric extends Metadata_Type {
|
|||
function __construct(){
|
||||
// call metadatum type constructor
|
||||
parent::__construct();
|
||||
$this->set_name( __('Numeric', 'tainacan') );
|
||||
$this->set_primitive_type('float');
|
||||
$this->set_component('tainacan-numeric');
|
||||
$this->set_name( __('Numeric', 'tainacan') );
|
||||
$this->set_form_component('tainacan-form-numeric');
|
||||
$this->set_description( __('A numeric value, integer or float', 'tainacan') );
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
|
@ -25,6 +26,18 @@ class Numeric extends Metadata_Type {
|
|||
');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_form_labels(){
|
||||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on filter control buttons.', 'tainacan' ),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata
|
||||
* @return string
|
||||
|
|
|
@ -3,17 +3,41 @@
|
|||
<b-taginput
|
||||
expanded
|
||||
:disabled="disabled"
|
||||
:id="id"
|
||||
v-model="selected"
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:value="selected"
|
||||
size="is-small"
|
||||
icon="magnify"
|
||||
@input="onInput"
|
||||
:data="options"
|
||||
:maxtags="maxtags != undefined ? maxtags : (metadatum.metadatum.multiple == 'yes' || allowNew === true ? 100 : 1)"
|
||||
autocomplete
|
||||
attached
|
||||
:loading="loading"
|
||||
:placeholder="$i18n.get('instruction_type_existing_term')"
|
||||
:loading="isLoading"
|
||||
:aria-close-label="$i18n.get('remove_value')"
|
||||
:class="{'has-selected': selected != undefined && selected != []}"
|
||||
field="label"
|
||||
@typing="search"/>
|
||||
@typing="(query) => { options = []; search(query); }">
|
||||
<template slot-scope="props">
|
||||
<div class="media">
|
||||
<div
|
||||
v-if="props.option.img"
|
||||
class="media-left">
|
||||
<img
|
||||
width="28"
|
||||
:src="props.option.img">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{{ props.option.label }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template
|
||||
v-if="!isLoading"
|
||||
slot="empty">
|
||||
{{ $i18n.get('info_no_item_found') }}
|
||||
</template>
|
||||
</b-taginput>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -23,16 +47,19 @@
|
|||
|
||||
export default {
|
||||
created() {
|
||||
let collectionId = ( this.metadatum && this.metadatum.metadatum.metadata_type_options.collection_id ) ? this.metadatum.metadatum.metadata_type_options.collection_id : this.collection_id;
|
||||
this.collectionId = ( this.metadatum && this.metadatum.metadatum.metadata_type_options && this.metadatum.metadatum.metadata_type_options.collection_id ) ? this.metadatum.metadatum.metadata_type_options.collection_id : '';
|
||||
if (this.metadatum.value && (Array.isArray( this.metadatum.value ) ? this.metadatum.value.length > 0 : true )) {
|
||||
let query = qs.stringify({ postin: ( Array.isArray( this.metadatum.value ) ) ? this.metadatum.value : [ this.metadatum.value ] });
|
||||
query += this.metadatum.metadatum.metadata_type_options.search ? '&fetch_only_meta=' + this.metadatum.metadatum.metadata_type_options.search : '';
|
||||
axios.get('/collection/'+collectionId+'/items?' + query + '&nopaging=1&fetch_only=title,thumbnail')
|
||||
axios.get('/collection/' + this.collectionId + '/items?' + query + '&nopaging=1&fetch_only=title,thumbnail')
|
||||
.then( res => {
|
||||
if (res.data.items) {
|
||||
for (let item of res.data.items) {
|
||||
this.selected.push({ label: this.getItemLabel(item), value: item.id, img: item.thumbnail && item.thumbnail['tainacan-small'] && item.thumbnail['tainacan-small'][0] ? item.thumbnail['tainacan-small'][0] : '' });
|
||||
}
|
||||
for (let item of res.data.items)
|
||||
this.selected.push({
|
||||
label: this.getItemLabel(item),
|
||||
value: item.id,
|
||||
img: item.thumbnail && item.thumbnail['tainacan-small'] && item.thumbnail['tainacan-small'][0] ? item.thumbnail['tainacan-small'][0] : ''
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
@ -45,92 +72,70 @@
|
|||
results:'',
|
||||
selected:[],
|
||||
options: [],
|
||||
loading: false,
|
||||
collectionId: 0,
|
||||
isLoading: false,
|
||||
collectionId: '',
|
||||
inputValue: null,
|
||||
queryObject: {},
|
||||
itemsFound: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
metadatum: {
|
||||
type: Object
|
||||
},
|
||||
collection_id: {
|
||||
type: Number
|
||||
},
|
||||
id: '',
|
||||
metadatum: Object,
|
||||
maxtags: undefined,
|
||||
disabled: false,
|
||||
allowNew: true,
|
||||
},
|
||||
watch: {
|
||||
selected( value ){
|
||||
this.selected = value;
|
||||
let values = [];
|
||||
if( this.selected.length > 0 ){
|
||||
for(let val of this.selected){
|
||||
values.push( val.value );
|
||||
}
|
||||
}
|
||||
this.onInput( values );
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setResults(option){
|
||||
if(!option)
|
||||
return;
|
||||
this.results = option.value;
|
||||
},
|
||||
onInput( $event ) {
|
||||
this.$emit('input', $event);
|
||||
this.$emit('blur');
|
||||
onInput(newSelected) {
|
||||
this.selected = newSelected;
|
||||
this.$emit('input', newSelected.map((item) => item.value));
|
||||
},
|
||||
search: _.debounce(function(query) {
|
||||
if ( this.selected.length > 0 && this.metadatum.metadatum.multiple === 'no')
|
||||
return '';
|
||||
|
||||
if (query !== '') {
|
||||
this.loading = true;
|
||||
this.options = [];
|
||||
this.isLoading = true;
|
||||
|
||||
let metaquery = this.mountQuery( query );
|
||||
let collectionId = ( this.metadatum && this.metadatum.metadatum.metadata_type_options.collection_id ) ? this.metadatum.metadatum.metadata_type_options.collection_id : this.collection_id;
|
||||
|
||||
axios.get('/collection/'+collectionId+'/items?' + qs.stringify( metaquery ))
|
||||
axios.get('/collection/' + this.collectionId + '/items?' + this.getQueryString(query))
|
||||
.then( res => {
|
||||
this.loading = false;
|
||||
this.isLoading = false;
|
||||
this.options = [];
|
||||
let result = res.data;
|
||||
|
||||
if (result.items) {
|
||||
for (let item of result.items) {
|
||||
this.options.push({ label: this.getItemLabel(item), value: item.id })
|
||||
}
|
||||
if (res.data.items) {
|
||||
for (let item of res.data.items)
|
||||
this.options.push({
|
||||
label: this.getItemLabel(item),
|
||||
value: item.id,
|
||||
img: item.thumbnail && item.thumbnail['tainacan-small'] && item.thumbnail['tainacan-small'][0] ? item.thumbnail['tainacan-small'][0] : ''
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
});
|
||||
} else {
|
||||
this.options = [];
|
||||
}
|
||||
|
||||
}, 500),
|
||||
getItemLabel(item) {
|
||||
let label = '';
|
||||
for (let m in item.metadata) {
|
||||
if (item.metadata[m].id == this.metadatum.metadatum.metadata_type_options.search) {
|
||||
if (item.metadata[m].id == this.metadatum.metadatum.metadata_type_options.search)
|
||||
label = item.metadata[m].value_as_string;
|
||||
}
|
||||
}
|
||||
if (label != '' && label != item.title && item.title != '') {
|
||||
if (label != '' && label != item.title && item.title != '')
|
||||
label += ' (' + item.title + ')';
|
||||
} else if (label == '') {
|
||||
else if (label == '')
|
||||
label = item.title;
|
||||
}
|
||||
|
||||
return label;
|
||||
},
|
||||
mountQuery( search ) {
|
||||
getQueryString( search ) {
|
||||
let query = [];
|
||||
|
||||
if (this.metadatum.metadatum.metadata_type_options &&
|
||||
|
@ -150,7 +155,7 @@
|
|||
query['fetch_only'] = 'title,thumbnail';
|
||||
query['fetch_only_meta'] = this.metadatum.metadatum.metadata_type_options.search;
|
||||
|
||||
return query;
|
||||
return qs.stringify(query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ class Relationship extends Metadata_Type {
|
|||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
// item not found
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ class Relationship extends Metadata_Type {
|
|||
$return .= $this->get_item_html($item);
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
// item not found
|
||||
}
|
||||
|
||||
|
|
|
@ -1,44 +1,33 @@
|
|||
<template>
|
||||
<div>
|
||||
<b-select
|
||||
expanded
|
||||
:disabled="disabled"
|
||||
:id = "id"
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:placeholder="$i18n.get('label_selectbox_init')"
|
||||
:value="value"
|
||||
:class="{'is-empty': value == undefined || value == ''}"
|
||||
@blur="$emit('blur')"
|
||||
@input="onChecked($event)">
|
||||
@input="onSelected($event)">
|
||||
<option value="">{{ $i18n.get('label_selectbox_init') }}...</option>
|
||||
<option
|
||||
v-for="(option, index) in getOptions"
|
||||
:key="index"
|
||||
:label="option"
|
||||
:value="option"
|
||||
border>{{ option }}</option>
|
||||
:value="option">
|
||||
{{ option }}
|
||||
</option>
|
||||
</b-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props: {
|
||||
metadatum: {
|
||||
type: Object
|
||||
},
|
||||
options: {
|
||||
type: String
|
||||
},
|
||||
metadatum: Object,
|
||||
value: [String, Number, Array],
|
||||
id: '',
|
||||
disabled: false,
|
||||
},
|
||||
computed: {
|
||||
getOptions(){
|
||||
if ( this.options && this.options !== '' ){
|
||||
return this.options.split("\n");
|
||||
}
|
||||
else if ( this.metadatum && this.metadatum.metadatum.metadata_type_options.options ) {
|
||||
if (this.metadatum && this.metadatum.metadatum.metadata_type_options && this.metadatum.metadatum.metadata_type_options.options ) {
|
||||
const metadata = this.metadatum.metadatum.metadata_type_options.options;
|
||||
return ( metadata ) ? metadata.split("\n") : [];
|
||||
}
|
||||
|
@ -46,7 +35,7 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
onChecked(value) {
|
||||
onSelected(value) {
|
||||
this.$emit('input', value);
|
||||
},
|
||||
}
|
||||
|
|
|
@ -27,8 +27,12 @@
|
|||
<span
|
||||
v-if="metadatum.metadatum.required == 'yes'"
|
||||
class="required-metadatum-asterisk"
|
||||
:class="metadatumTypeMessage">*</span>
|
||||
<span class="metadata-type">({{ $i18n.get(metadatum.metadatum.metadata_type_object.component) }})</span>
|
||||
:class="metadatumTypeMessage">
|
||||
*
|
||||
</span>
|
||||
<span class="metadata-type">
|
||||
({{ metadatum.metadatum.metadata_type_object.name }})
|
||||
</span>
|
||||
<help-button
|
||||
:title="metadatum.metadatum.name"
|
||||
:message="metadatum.metadatum.description"/>
|
||||
|
@ -38,43 +42,46 @@
|
|||
v-show="isCollapsed || metadatumTypeMessage == 'is-danger'"
|
||||
v-if="isTextInputComponent( metadatum.metadatum.metadata_type_object.component )">
|
||||
<component
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:is="metadatum.metadatum.metadata_type_object.component"
|
||||
v-model="inputs[0]"
|
||||
:metadatum="metadatum"
|
||||
@input="emitIsChangingValue()"/>
|
||||
<div v-if="metadatum.metadatum.multiple == 'yes'">
|
||||
<div
|
||||
v-if="index > 0"
|
||||
v-for="(input, index) in inputsList "
|
||||
:key="index"
|
||||
@input="changeValue()"/>
|
||||
<template v-if="metadatum.metadatum.multiple == 'yes' && inputs.length > 1">
|
||||
<transition-group
|
||||
name="filter-item"
|
||||
class="multiple-inputs">
|
||||
<template v-for="(input, index) of inputs">
|
||||
<component
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
v-if="index > 0"
|
||||
:key="index"
|
||||
:is="metadatum.metadatum.metadata_type_object.component"
|
||||
v-model="inputs[index]"
|
||||
:metadatum="metadatum"
|
||||
@input="emitIsChangingValue()"/>
|
||||
@input="changeValue()"/>
|
||||
<a
|
||||
v-if="index > 0"
|
||||
@click="removeInput(index)"
|
||||
class="is-inline add-link">
|
||||
class="add-link"
|
||||
:key="index">
|
||||
<b-icon
|
||||
icon="minus-circle"
|
||||
size="is-small"
|
||||
type="is-secondary"/>
|
||||
{{ $i18n.get('label_remove_value') }}</a>
|
||||
</div>
|
||||
|
||||
{{ $i18n.get('label_remove_value') }}
|
||||
</a>
|
||||
</template>
|
||||
</transition-group>
|
||||
</template>
|
||||
<template v-if="metadatum.metadatum.multiple == 'yes'">
|
||||
<a
|
||||
@click="addInput"
|
||||
class="is-inline add-link">
|
||||
class="is-block add-link">
|
||||
<span class="icon is-small">
|
||||
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_add_value') }}
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</transition>
|
||||
<transition name="filter-item">
|
||||
|
@ -82,11 +89,10 @@
|
|||
v-show="isCollapsed"
|
||||
v-if="!isTextInputComponent( metadatum.metadatum.metadata_type_object.component )">
|
||||
<component
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:is="metadatum.metadatum.metadata_type_object.component"
|
||||
v-model="inputs"
|
||||
:metadatum="metadatum"
|
||||
@input="emitIsChangingValue()"/>
|
||||
@input="changeValue()"/>
|
||||
</div>
|
||||
</transition>
|
||||
</b-field>
|
||||
|
@ -98,112 +104,85 @@
|
|||
export default {
|
||||
name: 'TainacanFormItem',
|
||||
props: {
|
||||
metadatum: {
|
||||
type: Object
|
||||
},
|
||||
isCollapsed: true // Metadatum Collapses
|
||||
metadatum: Object,
|
||||
isCollapsed: true
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
inputs: [],
|
||||
metadatumTypeMessage:''
|
||||
inputs: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
inputsList() {
|
||||
return this.inputs;
|
||||
},
|
||||
getErrorMessage() {
|
||||
|
||||
let msg = '';
|
||||
let errorMessage = '';
|
||||
let errors = eventBus.getErrors(this.metadatum.metadatum.id);
|
||||
|
||||
if (errors) {
|
||||
this.setMetadatumTypeMessage('is-danger');
|
||||
for (let error of errors) {
|
||||
for (let index of Object.keys(error)) {
|
||||
// this.$console.log(index);
|
||||
msg += error[index] + '\n';
|
||||
for (let index of Object.keys(error))
|
||||
errorMessage += error[index] + '\n';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setMetadatumTypeMessage('');
|
||||
}
|
||||
|
||||
return msg;
|
||||
return errorMessage;
|
||||
},
|
||||
metadatumTypeMessage() {
|
||||
return this.getErrorMessage ? 'is-danger' : ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getValue();
|
||||
this.createInputs();
|
||||
},
|
||||
methods: {
|
||||
emitIsChangingValue() {
|
||||
this.changeValue();
|
||||
},
|
||||
changeValue: _.debounce(function() {
|
||||
|
||||
if(this.metadatum.value != this.inputs){
|
||||
|
||||
if(this.inputs.length > 0 && this.inputs[0].value){
|
||||
let terms = [];
|
||||
|
||||
for(let term of this.inputs){
|
||||
terms.push(term.value);
|
||||
}
|
||||
if (this.inputs && this.inputs.length > 0 && this.inputs[0] && this.inputs[0].value) {
|
||||
let terms = this.inputs.map(term => term.value)
|
||||
|
||||
if (this.metadatum.value instanceof Array){
|
||||
let eq = [];
|
||||
let equal = [];
|
||||
|
||||
for (let meta of terms) {
|
||||
let found = this.metadatum.value.find((element) => {
|
||||
return meta == element.id;
|
||||
});
|
||||
|
||||
if(found){
|
||||
eq.push(found);
|
||||
}
|
||||
let foundIndex = this.metadatum.value.findIndex(element => meta == element.id);
|
||||
if (foundIndex >= 0)
|
||||
equal.push(this.metadatum.value[foundIndex]);
|
||||
}
|
||||
|
||||
if(eq.length == terms.length && this.metadatum.value.length <= eq.length){
|
||||
if (equal.length == terms.length && this.metadatum.value.length <= equal.length)
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
} else if (this.metadatum.value.constructor.name == 'Object') {
|
||||
|
||||
if(this.metadatum.value.id == this.inputs){
|
||||
if (this.metadatum.value.id == this.inputs)
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (this.metadatum.value instanceof Array) {
|
||||
let eq = [];
|
||||
|
||||
let equal = [];
|
||||
|
||||
for (let meta of this.inputs) {
|
||||
let found = this.metadatum.value.find((element) => {
|
||||
return meta == element.id;
|
||||
});
|
||||
let foundIndex = this.metadatum.value.findIndex(element => meta == element.id);
|
||||
|
||||
if(found){
|
||||
eq.push(found);
|
||||
}
|
||||
if (foundIndex >= 0)
|
||||
equal.push(this.metadatum.value[foundIndex]);
|
||||
}
|
||||
|
||||
if(eq.length == this.inputs.length && this.metadatum.value.length <= eq.length){
|
||||
if (equal.length == this.inputs.length && this.metadatum.value.length <= equal.length)
|
||||
return;
|
||||
}
|
||||
}
|
||||
eventBus.$emit('input', {
|
||||
itemId: this.metadatum.item.id,
|
||||
metadatumId: this.metadatum.metadatum.id,
|
||||
values: this.inputs ? this.inputs : ''
|
||||
});
|
||||
|
||||
eventBus.$emit('input', { item_id: this.metadatum.item.id, metadatum_id: this.metadatum.metadatum.id, values: this.inputs } );
|
||||
}
|
||||
}, 1000),
|
||||
getValue(){
|
||||
if (this.metadatum.value instanceof Array) {
|
||||
}, 900),
|
||||
createInputs() {
|
||||
if (this.metadatum.value instanceof Array)
|
||||
this.inputs = this.metadatum.value.slice(0);
|
||||
|
||||
if (this.inputs.length === 0){
|
||||
this.inputs.push('');
|
||||
}
|
||||
} else {
|
||||
this.metadatum.value == null || this.metadatum.value == undefined ? this.inputs.push('') : this.inputs.push(this.metadatum.value);
|
||||
}
|
||||
else
|
||||
this.metadatum.value == null || this.metadatum.value == undefined ? this.inputs = [] : this.inputs.push(this.metadatum.value);
|
||||
},
|
||||
addInput(){
|
||||
this.inputs.push('');
|
||||
|
@ -214,11 +193,8 @@
|
|||
this.changeValue();
|
||||
},
|
||||
isTextInputComponent(component) {
|
||||
let array = ['tainacan-relationship','tainacan-taxonomy'];
|
||||
const array = ['tainacan-relationship','tainacan-taxonomy'];
|
||||
return !(array.indexOf(component) >= 0 );
|
||||
},
|
||||
setMetadatumTypeMessage( message ){
|
||||
this.metadatumTypeMessage = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="add-new-term">
|
||||
<span v-if="!showForm">
|
||||
<a
|
||||
@click="toggleForm()"
|
||||
class="is-inline add-link">
|
||||
class="add-link">
|
||||
<span class="icon is-small">
|
||||
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_new_term') }}
|
||||
</a>
|
||||
</span>
|
||||
<transition name="appear">
|
||||
<transition name="filter-item">
|
||||
<section
|
||||
v-if="showForm"
|
||||
style="padding-left: 0px; margin-top: 12px; margin-bottom: -12px;">
|
||||
class="add-new-term-form">
|
||||
<b-field
|
||||
:addons="false"
|
||||
:type="((formErrors.name !== '' || formErrors.repeated !== '') && (formErrors.name !== undefined || formErrors.repeated !== undefined )) ? 'is-danger' : ''"
|
||||
|
@ -26,25 +26,11 @@
|
|||
:message="$i18n.get('info_help_term_name')"/>
|
||||
</label>
|
||||
<b-input
|
||||
:class="{'has-content': name != undefined && name != ''}"
|
||||
:placeholder="$i18n.get('label_term_without_name')"
|
||||
v-model="name"
|
||||
@focus="clearErrors({ name: 'name', repeated: 'repeated' })"/>
|
||||
</b-field>
|
||||
|
||||
<!-- <b-field :label="$i18n.get('label_parent_term')">
|
||||
<b-select
|
||||
v-model="parent">
|
||||
<option
|
||||
:value="0"
|
||||
selected> ---{{ $i18n.get('label_parent_term') }}--- </option>
|
||||
<option
|
||||
v-for="(option,index) in options"
|
||||
:key="index"
|
||||
:value="option.id"
|
||||
v-html="setSpaces( option.level ) + option.name"/>
|
||||
</b-select>
|
||||
</b-field> -->
|
||||
|
||||
<!-- Parent -------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
|
@ -62,7 +48,7 @@
|
|||
:message="$i18n.get('info_help_parent_term')"/>
|
||||
</label>
|
||||
<b-autocomplete
|
||||
id="tainacan-text-cover-page"
|
||||
id="tainacan-add-parent-field"
|
||||
:placeholder="$i18n.get('instruction_parent_term')"
|
||||
:data="parentTerms"
|
||||
field="name"
|
||||
|
@ -85,7 +71,7 @@
|
|||
</p>
|
||||
</transition>
|
||||
</b-field>
|
||||
|
||||
<div class="field is-grouped form-submit">
|
||||
<button
|
||||
:class="{ 'is-loading': isAddingNewTerm }"
|
||||
class="button is-outlined"
|
||||
|
@ -93,14 +79,14 @@
|
|||
type="button">
|
||||
{{ $i18n.get('cancel') }}
|
||||
</button>
|
||||
|
||||
<button
|
||||
:class="{ 'is-loading': isAddingNewTerm }"
|
||||
class="button is-secondary"
|
||||
@click="save"
|
||||
type="button">
|
||||
{{ $i18n.get('save') }}
|
||||
{{ $i18n.get('label_create_and_select') }}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</transition>
|
||||
|
@ -122,19 +108,15 @@
|
|||
parentTermName: '',
|
||||
isAddingNewTerm: false,
|
||||
isFetchingParentTerms: false,
|
||||
metadatum_id: this.metadatum.metadatum.id,
|
||||
metadatumId: this.metadatum.metadatum.id,
|
||||
itemId: this.metadatum.item.id,
|
||||
formErrors: {}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
id: String,
|
||||
item_id: [Number,String],
|
||||
metadatum: [Number,String],
|
||||
taxonomy_id: [Number,String],
|
||||
taxonomyId: [Number,String],
|
||||
value: [ Array, Boolean, Number ],
|
||||
options: {
|
||||
type: Array
|
||||
},
|
||||
componentType: ''
|
||||
},
|
||||
methods: {
|
||||
|
@ -153,20 +135,11 @@
|
|||
this.formErrors = {};
|
||||
this.showForm = !this.showForm;
|
||||
},
|
||||
setSpaces( level ){
|
||||
let result = '';
|
||||
let space = ' '
|
||||
|
||||
for(let i = 0;i < level; i++)
|
||||
result += space;
|
||||
|
||||
return result;
|
||||
},
|
||||
fecthParentTerms(search) {
|
||||
this.isFetchingParentTerms = true;
|
||||
|
||||
this.fetchPossibleParentTerms({
|
||||
taxonomyId: this.taxonomy_id,
|
||||
taxonomyId: this.taxonomyId,
|
||||
termId: 'new',
|
||||
search: search })
|
||||
.then((parentTerms) => {
|
||||
|
@ -182,15 +155,15 @@
|
|||
this.clearErrors('parent');
|
||||
},
|
||||
onSelectParentTerm(selectedParentTerm) {
|
||||
if (selectedParentTerm) {
|
||||
this.parent = selectedParentTerm.id;
|
||||
this.selectedParentTerm = selectedParentTerm;
|
||||
this.parentTermName = selectedParentTerm.name;
|
||||
}
|
||||
},
|
||||
clearErrors(attributes) {
|
||||
if (attributes instanceof Object) {
|
||||
for(let attribute in attributes){
|
||||
for(let attribute in attributes)
|
||||
this.formErrors[attribute] = undefined;
|
||||
}
|
||||
} else {
|
||||
this.formErrors[attributes] = undefined;
|
||||
}
|
||||
|
@ -206,32 +179,32 @@
|
|||
} else {
|
||||
this.isAddingNewTerm = true;
|
||||
|
||||
axios.post(`/taxonomy/${this.taxonomy_id}/terms?hideempty=0&order=asc`, {
|
||||
axios.post(`/taxonomy/${this.taxonomyId}/terms?hideempty=0&order=asc`, {
|
||||
name: this.name,
|
||||
parent: this.parent
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
this.isAddingNewTerm = false;
|
||||
|
||||
if (res.data && res.data.id || res.id) {
|
||||
let id = ( res.id ) ? res.id : res.data.id;
|
||||
let id = res.id ? res.id : res.data.id;
|
||||
let val = this.value;
|
||||
|
||||
if (!Array.isArray(val) && this.metadatum.metadatum.multiple === 'no') {
|
||||
axios.patch(`/item/${this.item_id}/metadata/${this.metadatum_id}`, {
|
||||
axios.patch(`/item/${this.itemId}/metadata/${this.metadatumId}`, {
|
||||
values: id,
|
||||
}).then(() => {
|
||||
this.$emit('newTerm', { values: id, taxonomyId: this.taxonomy_id, metadatumId: this.metadatum_id });
|
||||
this.isAddingNewTerm = false;
|
||||
this.$emit('newTerm', { values: id, taxonomyId: this.taxonomyId, metadatumId: this.metadatumId });
|
||||
this.toggleForm();
|
||||
})
|
||||
} else {
|
||||
val = ( val ) ? val : [];
|
||||
val = val ? val : [];
|
||||
val.push( this.componentType == ('tainacan-taxonomy-checkbox' || 'tainacan-taxonomy-radio') ? id : {'label': this.name, 'value': id} );
|
||||
axios.patch(`/item/${this.item_id}/metadata/${this.metadatum_id}`, {
|
||||
axios.patch(`/item/${this.itemId}/metadata/${this.metadatumId}`, {
|
||||
values: val,
|
||||
}).then(() => {
|
||||
this.$emit('newTerm', { values: val, taxonomyId: this.taxonomy_id, metadatumId: this.metadatum_id });
|
||||
this.isAddingNewTerm = false;
|
||||
this.$emit('newTerm', { values: val, taxonomyId: this.taxonomyId, metadatumId: this.metadatumId });
|
||||
this.toggleForm();
|
||||
})
|
||||
}
|
||||
|
@ -256,5 +229,17 @@
|
|||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.add-new-term {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 25px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
.add-new-term-form {
|
||||
padding: 14px 24px 12px 24px;
|
||||
margin-top: 12px;
|
||||
margin-bottom: -12px;
|
||||
border: 1px solid #cbcbcb;
|
||||
}
|
||||
</style>
|
|
@ -7,54 +7,32 @@
|
|||
v-model="valueComponent"
|
||||
:allow-select-to-create="allowSelectToCreate"
|
||||
:allow-new="allowNew"
|
||||
:terms="terms"
|
||||
:taxonomy-id="taxonomy_id"
|
||||
:options="getOptions(0)"/>
|
||||
<a
|
||||
class="add-new-term"
|
||||
v-if="(this.getComponent == 'tainacan-taxonomy-checkbox' || this.getComponent == 'tainacan-taxonomy-radio') &&
|
||||
terms.length < totalTerms"
|
||||
@click="openCheckboxModal()">
|
||||
{{ $i18n.get('label_view_all') }}
|
||||
</a>
|
||||
:taxonomy-id="taxonomyId"
|
||||
:metadatum="metadatum.metadatum"/>
|
||||
<add-new-term
|
||||
class="add-new-term"
|
||||
v-if="allowNew"
|
||||
:component-type="getComponent"
|
||||
:taxonomy_id="taxonomy_id"
|
||||
:taxonomy-id="taxonomyId"
|
||||
:metadatum="metadatum"
|
||||
:item_id="metadatum.item.id"
|
||||
:value="valueComponent"
|
||||
:options="getOptions(0)"
|
||||
@newTerm="reload"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios'
|
||||
import TainacanTaxonomyRadio from './TaxonomyRadio.vue'
|
||||
import TainacanTaxonomyCheckbox from './TaxonomyCheckbox.vue'
|
||||
import TainacanTaxonomyTagInput from './TaxonomyTaginput.vue'
|
||||
import AddNewTerm from './AddNewTerm.vue'
|
||||
import CheckboxRadioModal from '../../../admin/components/other/checkbox-radio-modal.vue'
|
||||
|
||||
export default {
|
||||
created(){
|
||||
let metadata_type_options = this.metadatum.metadatum.metadata_type_options;
|
||||
this.component = ( metadata_type_options && metadata_type_options.input_type )
|
||||
? this.metadatum.metadatum.metadata_type_options.input_type : this.componentAttribute;
|
||||
const metadata_type_options = this.metadatum.metadatum.metadata_type_options;
|
||||
|
||||
this.collectionId = this.metadatum.metadatum.collection_id;
|
||||
this.taxonomy_id = metadata_type_options.taxonomy_id;
|
||||
this.taxonomyId = metadata_type_options.taxonomy_id;
|
||||
this.taxonomy = metadata_type_options.taxonomy;
|
||||
|
||||
if( metadata_type_options && metadata_type_options.allow_new_terms && this.metadatum.item ){
|
||||
if (metadata_type_options && metadata_type_options.allow_new_terms && this.metadatum.item)
|
||||
this.allowNew = metadata_type_options.allow_new_terms == 'yes';
|
||||
}
|
||||
|
||||
// This condition is temporary
|
||||
if(this.component != 'tainacan-taxonomy-tag-input' || this.forcedComponentType != 'tainacan-taxonomy-tag-input'){
|
||||
this.getTermsFromTaxonomy();
|
||||
}
|
||||
|
||||
this.getTermsId();
|
||||
},
|
||||
|
@ -67,33 +45,20 @@
|
|||
data(){
|
||||
return {
|
||||
valueComponent: null,
|
||||
component: '',
|
||||
collectionId: '',
|
||||
taxonomy_id: '',
|
||||
taxonomyId: '',
|
||||
taxonomy: '',
|
||||
terms:[], // object with names
|
||||
totalTerms: 0,
|
||||
allowNew: false,
|
||||
offset: 0,
|
||||
termsNumber: 12
|
||||
terms:[],
|
||||
allowNew: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
valueComponent( val ){
|
||||
this.valueComponent = val;
|
||||
this.$emit('input', val);
|
||||
this.$emit('blur');
|
||||
}
|
||||
},
|
||||
props: {
|
||||
metadatum: {
|
||||
type: Object
|
||||
},
|
||||
componentAttribute: {
|
||||
type: String
|
||||
},
|
||||
metadatum: Object,
|
||||
value: [ Number, String, Array, Object ],
|
||||
id: '',
|
||||
disabled: false,
|
||||
forcedComponentType: '',
|
||||
maxtags: '',
|
||||
|
@ -101,123 +66,36 @@
|
|||
},
|
||||
computed: {
|
||||
getComponent() {
|
||||
if (this.forcedComponentType){
|
||||
if (this.forcedComponentType)
|
||||
return this.forcedComponentType;
|
||||
} else if( this.metadatum.metadatum
|
||||
&& this.metadatum.metadatum.metadata_type_options && this.metadatum.metadatum.metadata_type_options.input_type ){
|
||||
else if(this.metadatum.metadatum &&
|
||||
this.metadatum.metadatum.metadata_type_options &&
|
||||
this.metadatum.metadatum.metadata_type_options.input_type
|
||||
)
|
||||
return this.metadatum.metadatum.metadata_type_options.input_type;
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openCheckboxModal(){
|
||||
this.$buefy.modal.open({
|
||||
parent: this,
|
||||
component: CheckboxRadioModal,
|
||||
props: {
|
||||
isFilter: false,
|
||||
parent: 0,
|
||||
taxonomy_id: this.taxonomy_id,
|
||||
selected: !this.valueComponent ? [] : this.valueComponent,
|
||||
metadatumId: this.metadatum.metadatum.id,
|
||||
taxonomy: this.taxonomy,
|
||||
collectionId: this.collectionId,
|
||||
isTaxonomy: true,
|
||||
query: '',
|
||||
metadatum: this.metadatum.metadatum,
|
||||
isCheckbox: this.getComponent == 'tainacan-taxonomy-checkbox'
|
||||
},
|
||||
events: {
|
||||
input: (selected) => {
|
||||
this.valueComponent = selected;
|
||||
}
|
||||
},
|
||||
width: 'calc(100% - 8.333333333%)',
|
||||
trapFocus: true
|
||||
});
|
||||
},
|
||||
getTermsFromTaxonomy(){
|
||||
let endpoint = '/taxonomy/' + this.taxonomy_id + '/terms?hideempty=0&order=asc';
|
||||
|
||||
if (this.getComponent == 'tainacan-taxonomy-checkbox' || this.getComponent == 'tainacan-taxonomy-radio')
|
||||
endpoint = endpoint + '&number=' + this.termsNumber + '&offset=' + this.offset;
|
||||
|
||||
axios.get(endpoint)
|
||||
.then( res => {
|
||||
if (this.getComponent == 'tainacan-taxonomy-checkbox' || this.getComponent == 'tainacan-taxonomy-radio') {
|
||||
this.totalTerms = Number(res.headers['x-wp-total']);
|
||||
this.offset += this.termsNumber;
|
||||
}
|
||||
for (let item of res.data) {
|
||||
this.terms.push( item );
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
});
|
||||
},
|
||||
getOptions( parent, level = 0 ){ // retrieve only ids
|
||||
let result = [];
|
||||
if ( this.terms ){
|
||||
for( let term of this.terms ){
|
||||
if( term.parent == parent ){
|
||||
term['level'] = level;
|
||||
result.push( term );
|
||||
const levelTerm = level + 1;
|
||||
const children = this.getOptions( term.id, levelTerm);
|
||||
result = result.concat( children );
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
getTermsId() {
|
||||
let values = [];
|
||||
|
||||
if( this.value && this.value.length > 0){
|
||||
for( let term of this.value ){
|
||||
if( term && term.id)
|
||||
values.push(term.id);
|
||||
}
|
||||
}
|
||||
|
||||
if( values.length > 0 && this.metadatum.metadatum && this.component != 'tainacan-taxonomy-tag-input'){
|
||||
this.valueComponent = ( this.metadatum.metadatum && this.metadatum.metadatum.multiple === 'no' ) ? values[0] : values;
|
||||
} else if(values.length > 0 && this.metadatum.metadatum && this.component == 'tainacan-taxonomy-tag-input') {
|
||||
let values = [];
|
||||
|
||||
for(let term of this.value){
|
||||
values.push({label: term.name, value: term.id});
|
||||
}
|
||||
|
||||
if (this.value && this.metadatum.metadatum && this.getComponent != 'tainacan-taxonomy-tag-input') {
|
||||
values = this.value.map(term => term.id)
|
||||
this.valueComponent = (values.length >= 0 && this.metadatum.metadatum && this.metadatum.metadatum.multiple === 'no') ? values[0] : values;
|
||||
} else if (this.value && this.metadatum.metadatum && this.getComponent == 'tainacan-taxonomy-tag-input') {
|
||||
values = this.value.map((term) => { return { label: term.name, value: term.id } });
|
||||
this.valueComponent = values;
|
||||
}
|
||||
|
||||
},
|
||||
onInput($event) {
|
||||
this.inputValue = $event;
|
||||
this.valueComponent = $event;
|
||||
this.$emit('input', this.inputValue);
|
||||
this.$emit('blur');
|
||||
this.$emit('input', this.valueComponent);
|
||||
},
|
||||
reload($event) {
|
||||
if ($event.taxonomyId == this.taxonomy_id && $event.metadatumId == this.metadatum.metadatum.id) {
|
||||
if ($event.taxonomyId == this.taxonomyId && $event.metadatumId == this.metadatum.metadatum.id) {
|
||||
this.valueComponent = $event.values;
|
||||
this.terms = [];
|
||||
this.offset = 0;
|
||||
this.getTermsFromTaxonomy();
|
||||
this.getTermsId();
|
||||
this.$emit('update-taxonomy-inputs', $event)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.add-new-term{
|
||||
margin-top: 15px;
|
||||
margin-bottom: 30px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
</style>
|
|
@ -24,39 +24,73 @@
|
|||
v-if="isSelectedTermsLoading"
|
||||
class="control has-icons-right is-loading is-clearfix" />
|
||||
</b-field>
|
||||
|
||||
<p
|
||||
style="margin-top: 10px;"
|
||||
class="has-text-gray">
|
||||
{{ (isShowingAllTerms ? $i18n.get('label_available_terms') : $i18n.get('label_some_available_terms')) + ':' }}
|
||||
</p>
|
||||
<div
|
||||
v-for="(option, index) in options"
|
||||
:key="index">
|
||||
class="metadata-taxonomy-list"
|
||||
:id="metadatum.metadata_type_object.component + '-' + metadatum.slug">
|
||||
<template v-for="(option, index) in options">
|
||||
<b-checkbox
|
||||
:disabled="disabled"
|
||||
:id="id"
|
||||
:style="{ paddingLeft: (option.level * 30) + 'px' }"
|
||||
:key="index"
|
||||
:disabled="disabled"
|
||||
:style="{ paddingLeft: (option.level * 30) + 'px' }"
|
||||
v-model="checked"
|
||||
@input="onChecked(option)"
|
||||
:native-value="option.id"
|
||||
border>
|
||||
{{ option.name }}
|
||||
</b-checkbox>
|
||||
<br>
|
||||
<br :key="index">
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
v-if="!isShowingAllTerms"
|
||||
class="view-all">
|
||||
<span>
|
||||
{{
|
||||
$i18n.get('info_showing_terms') + 1 +
|
||||
$i18n.get('info_to') + options.length +
|
||||
$i18n.get('info_of') + totalTerms + '. '
|
||||
}}
|
||||
</span>
|
||||
<a @click="openCheckboxModal()">
|
||||
{{ $i18n.get('label_view_all') + ' ' + totalTerms + '.' }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
import qs from 'qs';
|
||||
import CheckboxRadioModal from '../../../admin/components/other/checkbox-radio-modal.vue'
|
||||
|
||||
export default {
|
||||
created() {
|
||||
if (this.value && this.value.length > 0)
|
||||
this.checked = this.value;
|
||||
|
||||
this.getTermsFromTaxonomy();
|
||||
this.$parent.$on('update-taxonomy-inputs', ($event) => {
|
||||
if ($event.taxonomyId == this.taxonomyId && $event.metadatumId == this.metadatum.id) {
|
||||
this.offset = 0;
|
||||
this.getTermsFromTaxonomy();
|
||||
}
|
||||
});
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checked: [],
|
||||
selectedTagsName: {},
|
||||
isSelectedTermsLoading: false,
|
||||
options: [],
|
||||
terms: [],
|
||||
termsNumber: 12,
|
||||
offset: 0,
|
||||
totalTerms: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -65,40 +99,43 @@
|
|||
this.fetchSelectedLabels();
|
||||
}
|
||||
},
|
||||
props: {
|
||||
options: {
|
||||
type: Array
|
||||
computed: {
|
||||
isShowingAllTerms() {
|
||||
return this.terms.length >= this.totalTerms;
|
||||
}
|
||||
},
|
||||
props: {
|
||||
value: [ Number, String, Array ],
|
||||
disabled: false,
|
||||
taxonomyId: Number
|
||||
taxonomyId: Number,
|
||||
metadatum: Object
|
||||
},
|
||||
methods: {
|
||||
onChecked() {
|
||||
this.$emit('blur');
|
||||
this.onInput(this.checked);
|
||||
},
|
||||
onInput($event) {
|
||||
this.inputValue = $event;
|
||||
this.$emit('input', this.inputValue);
|
||||
this.value = $event;
|
||||
this.$emit('input', this.value);
|
||||
},
|
||||
fetchSelectedLabels() {
|
||||
|
||||
if (this.value != null && this.value != undefined) {
|
||||
|
||||
this.isSelectedTermsLoading = true;
|
||||
let selected = this.value instanceof Array ? this.value : [this.value];
|
||||
const selected = this.value instanceof Array ? this.value : [this.value];
|
||||
|
||||
if (this.taxonomyId && selected.length > 0) {
|
||||
for (const term of selected) {
|
||||
|
||||
if(!this.isSelectedTermsLoading){
|
||||
if (this.taxonomyId) {
|
||||
this.isSelectedTermsLoading = true;
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/?${qs.stringify({ hideempty: 0, include: selected })}`)
|
||||
.then((res) => {
|
||||
let terms = res.data;
|
||||
|
||||
for (let term of terms) {
|
||||
if (!this.selectedTagsName[term.id])
|
||||
this.$set(this.selectedTagsName, term.id, term.name);
|
||||
}
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/${term}`)
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.name);
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -106,16 +143,69 @@
|
|||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.isSelectedTermsLoading = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
saveSelectedTagName(value, label){
|
||||
if(!this.selectedTagsName[value]) {
|
||||
this.$set(this.selectedTagsName, `${value}`, label);
|
||||
getTermsFromTaxonomy() {
|
||||
this.terms = [];
|
||||
|
||||
const endpoint = '/taxonomy/' + this.taxonomyId + '/terms?hideempty=0&order=asc&number=' + this.termsNumber + '&offset=' + this.offset;
|
||||
|
||||
axios.get(endpoint)
|
||||
.then( res => {
|
||||
this.totalTerms = Number(res.headers['x-wp-total']);
|
||||
this.offset += this.termsNumber;
|
||||
|
||||
for (let item of res.data)
|
||||
this.terms.push( item );
|
||||
|
||||
this.options = this.getOptions(0);
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
});
|
||||
},
|
||||
getOptions(parent, level = 0) { // retrieve only ids
|
||||
let result = [];
|
||||
if (this.terms) {
|
||||
for (let term of this.terms){
|
||||
if (term.parent == parent){
|
||||
term['level'] = level;
|
||||
result.push(term);
|
||||
const levelTerm = level + 1;
|
||||
const children = this.getOptions( term.id, levelTerm);
|
||||
result = result.concat(children);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
openCheckboxModal() {
|
||||
this.$buefy.modal.open({
|
||||
parent: this,
|
||||
component: CheckboxRadioModal,
|
||||
props: {
|
||||
isFilter: false,
|
||||
parent: 0,
|
||||
taxonomy_id: this.taxonomyId,
|
||||
selected: !this.value ? [] : this.value,
|
||||
metadatumId: this.metadatum.id,
|
||||
taxonomy: this.taxonomy,
|
||||
collectionId: this.metadatum.collection_id,
|
||||
isTaxonomy: true,
|
||||
query: '',
|
||||
metadatum: this.metadatum,
|
||||
isCheckbox: true
|
||||
},
|
||||
events: {
|
||||
input: (selected) => {
|
||||
this.value = selected;
|
||||
this.$emit('input', this.value);
|
||||
}
|
||||
},
|
||||
width: 'calc(100% - 8.333333333%)',
|
||||
trapFocus: true
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchSelectedLabels();
|
||||
|
@ -123,7 +213,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped lang="scss">
|
||||
.selected-tags {
|
||||
margin-top: 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
|
@ -138,4 +228,18 @@
|
|||
border-right-color: #dbdbdb !important;
|
||||
border-top-color: #dbdbdb !important;
|
||||
}
|
||||
.metadata-taxonomy-list {
|
||||
column-count: 2;
|
||||
margin: 10px;
|
||||
|
||||
label {
|
||||
break-inside: avoid;
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
.view-all {
|
||||
color: #898d8f;
|
||||
margin-bottom: 20px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<p
|
||||
v-if="value instanceof Array ? value.length > 0 : (value != undefined && value != '')"
|
||||
class="has-text-gray">
|
||||
{{ $i18n.get('label_selected_terms') + ' :' }}
|
||||
{{ $i18n.get('label_selected_term') + ':' }}
|
||||
</p>
|
||||
<b-field
|
||||
v-if="value instanceof Array ? value.length > 0 : (value != undefined && value != '')"
|
||||
|
@ -16,7 +16,7 @@
|
|||
<b-tag
|
||||
attached
|
||||
closable
|
||||
@close="value = ''">
|
||||
@close="clearInput()">
|
||||
{{ selectedTagsName[value] }}
|
||||
</b-tag>
|
||||
</div>
|
||||
|
@ -24,22 +24,27 @@
|
|||
v-if="isSelectedTermsLoading"
|
||||
class="control has-icons-right is-loading is-clearfix" />
|
||||
</b-field>
|
||||
<p
|
||||
style="margin-top: 10px;"
|
||||
class="has-text-gray">
|
||||
{{ (isShowingAllTerms ? $i18n.get('label_available_terms') : $i18n.get('label_some_available_terms')) + ':' }}
|
||||
</p>
|
||||
<div class="metadata-taxonomy-list">
|
||||
<b-radio
|
||||
:disabled="disabled"
|
||||
:id="id"
|
||||
:id="metadatum.metadata_type_object.component + '-' + metadatum.slug"
|
||||
v-model="checked"
|
||||
@input="onChecked()"
|
||||
@input="onChecked('')"
|
||||
:native-value="''"
|
||||
border>
|
||||
{{ $i18n.get('clear_radio') }}
|
||||
</b-radio>
|
||||
<div
|
||||
v-for="(option, index) in options"
|
||||
:key="index">
|
||||
<template
|
||||
:id="metadatum.metadata_type_object.component + '-' + metadatum.slug"
|
||||
v-for="(option, index) in options">
|
||||
<b-radio
|
||||
:disabled="disabled"
|
||||
:id="id"
|
||||
:style="{ paddingLeft: (option.level * 30) + 'px' }"
|
||||
:style="{ marginLeft: 0, paddingLeft: (option.level * 30) + 'px' }"
|
||||
:key="index"
|
||||
v-model="checked"
|
||||
@input="onChecked(option)"
|
||||
|
@ -47,20 +52,51 @@
|
|||
border>
|
||||
{{ option.name }}
|
||||
</b-radio>
|
||||
<br>
|
||||
<br :key="index">
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
v-if="!isShowingAllTerms"
|
||||
class="view-all">
|
||||
<span>
|
||||
{{
|
||||
$i18n.get('info_showing_terms') + 1 +
|
||||
$i18n.get('info_to') + options.length +
|
||||
$i18n.get('info_of') + totalTerms + '. '
|
||||
}}
|
||||
</span>
|
||||
<a @click="openCheckboxModal()">
|
||||
{{ $i18n.get('label_view_all') + ' ' + totalTerms + '.' }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
import qs from 'qs';
|
||||
import CheckboxRadioModal from '../../../admin/components/other/checkbox-radio-modal.vue'
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.getTermsFromTaxonomy();
|
||||
this.$parent.$on('update-taxonomy-inputs', ($event) => {
|
||||
if ($event.taxonomyId == this.taxonomyId && $event.metadatumId == this.metadatum.id) {
|
||||
this.offset = 0;
|
||||
this.getTermsFromTaxonomy();
|
||||
}
|
||||
});
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checked: ( this.value ) ? this.value : '',
|
||||
checked: this.value ? this.value : '',
|
||||
selectedTagsName: {},
|
||||
isSelectedTermsLoading: false,
|
||||
options: [],
|
||||
terms: [],
|
||||
termsNumber: 12,
|
||||
offset: 0,
|
||||
totalTerms: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -69,40 +105,47 @@
|
|||
this.fetchSelectedLabels();
|
||||
}
|
||||
},
|
||||
props: {
|
||||
options: {
|
||||
type: Array
|
||||
computed: {
|
||||
isShowingAllTerms() {
|
||||
return this.terms.length >= this.totalTerms;
|
||||
}
|
||||
},
|
||||
props: {
|
||||
value: [ Number, String, Array ],
|
||||
disabled: false,
|
||||
taxonomyId: Number
|
||||
taxonomyId: Number,
|
||||
metadatum: Object
|
||||
},
|
||||
methods: {
|
||||
clearInput() {
|
||||
this.value = '';
|
||||
this.onInput('');
|
||||
},
|
||||
onChecked() {
|
||||
this.$emit('blur');
|
||||
this.onInput(this.checked)
|
||||
},
|
||||
onInput($event) {
|
||||
this.inputValue = $event;
|
||||
this.$emit('input', this.inputValue);
|
||||
this.value = $event;
|
||||
this.$emit('input', this.value);
|
||||
},
|
||||
fetchSelectedLabels() {
|
||||
|
||||
if (this.value != null && this.value != undefined) {
|
||||
|
||||
this.isSelectedTermsLoading = true;
|
||||
let selected = this.value instanceof Array ? this.value : [this.value];
|
||||
const selected = this.value instanceof Array ? this.value : [this.value];
|
||||
|
||||
if (this.taxonomyId && selected.length > 0) {
|
||||
for (const term of selected) {
|
||||
|
||||
if(!this.isSelectedTermsLoading){
|
||||
this.isSelectedTermsLoading = true;
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/?${qs.stringify({ hideempty: 0, include: selected })}`)
|
||||
.then((res) => {
|
||||
let terms = res.data;
|
||||
|
||||
for (let term of terms) {
|
||||
if (!this.selectedTagsName[term.id])
|
||||
this.$set(this.selectedTagsName, term.id, term.name);
|
||||
}
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/${term}`)
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.name);
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -110,19 +153,103 @@
|
|||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.isSelectedTermsLoading = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
saveSelectedTagName(value, label){
|
||||
if(!this.selectedTagsName[value]) {
|
||||
this.$set(this.selectedTagsName, `${value}`, label);
|
||||
getTermsFromTaxonomy() {
|
||||
this.terms = [];
|
||||
|
||||
const endpoint = '/taxonomy/' + this.taxonomyId + '/terms?hideempty=0&order=asc&number=' + this.termsNumber + '&offset=' + this.offset;
|
||||
|
||||
axios.get(endpoint)
|
||||
.then( res => {
|
||||
this.totalTerms = Number(res.headers['x-wp-total']);
|
||||
this.offset += this.termsNumber;
|
||||
|
||||
for (let item of res.data)
|
||||
this.terms.push( item );
|
||||
|
||||
this.options = this.getOptions(0);
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
});
|
||||
},
|
||||
getOptions(parent, level = 0) { // retrieve only ids
|
||||
let result = [];
|
||||
if (this.terms) {
|
||||
for (let term of this.terms){
|
||||
if (term.parent == parent){
|
||||
term['level'] = level;
|
||||
result.push(term);
|
||||
const levelTerm = level + 1;
|
||||
const children = this.getOptions( term.id, levelTerm);
|
||||
result = result.concat(children);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
openCheckboxModal() {
|
||||
this.$buefy.modal.open({
|
||||
parent: this,
|
||||
component: CheckboxRadioModal,
|
||||
props: {
|
||||
isFilter: false,
|
||||
parent: 0,
|
||||
taxonomy_id: this.taxonomyId,
|
||||
selected: !this.value ? [] : this.value,
|
||||
metadatumId: this.metadatum.id,
|
||||
taxonomy: this.taxonomy,
|
||||
collectionId: this.metadatum.collection_id,
|
||||
isTaxonomy: true,
|
||||
query: '',
|
||||
metadatum: this.metadatum,
|
||||
isCheckbox: false
|
||||
},
|
||||
events: {
|
||||
input: (selected) => {
|
||||
this.value = selected;
|
||||
this.$emit('input', this.value);
|
||||
}
|
||||
},
|
||||
width: 'calc(100% - 8.333333333%)',
|
||||
trapFocus: true
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchSelectedLabels();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.selected-tags {
|
||||
margin-top: 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
position: relative;
|
||||
}
|
||||
.selected-tags .is-loading {
|
||||
margin-left: 2rem;
|
||||
margin-top: -0.4rem;
|
||||
}
|
||||
.selected-tags .is-loading::after {
|
||||
border: 2px solid #555758 !important;
|
||||
border-right-color: #dbdbdb !important;
|
||||
border-top-color: #dbdbdb !important;
|
||||
}
|
||||
.metadata-taxonomy-list {
|
||||
column-count: 2;
|
||||
margin: 10px;
|
||||
|
||||
label {
|
||||
break-inside: avoid;
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
.view-all {
|
||||
color: #898d8f;
|
||||
margin-bottom: 20px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
</style>
|
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<div class="block">
|
||||
<b-taginput
|
||||
:id="metadatumComponentId"
|
||||
:disabled="disabled"
|
||||
size="is-small"
|
||||
icon="magnify"
|
||||
|
@ -43,9 +44,7 @@
|
|||
}
|
||||
},
|
||||
props: {
|
||||
options: {
|
||||
type: Array
|
||||
},
|
||||
metadatumComponentId: '',
|
||||
value: [ Number, String, Array ],
|
||||
allowNew: true,
|
||||
taxonomyId: Number,
|
||||
|
@ -85,13 +84,11 @@
|
|||
}).then((res) => {
|
||||
this.termList = res.terms;
|
||||
|
||||
for(let term of this.termList){
|
||||
for (let term of this.termList)
|
||||
this.labels.push({label: term.name, value: term.id});
|
||||
}
|
||||
|
||||
if(this.termList.length <= 0 && this.allowSelectToCreate){
|
||||
if (this.termList.length <= 0 && this.allowSelectToCreate)
|
||||
this.labels.push({label: `${value} (${this.$i18n.get('select_to_create')})`, value: value})
|
||||
}
|
||||
|
||||
this.isFetching = false;
|
||||
}).catch((error) => {
|
||||
|
@ -102,9 +99,8 @@
|
|||
updateSelectedValues(){
|
||||
let selected = [];
|
||||
|
||||
for( let term of this.value){
|
||||
for( let term of this.value)
|
||||
selected.push({label: term.label, value: term.value})
|
||||
}
|
||||
|
||||
this.selected = selected;
|
||||
},
|
||||
|
@ -113,24 +109,20 @@
|
|||
let results = [];
|
||||
|
||||
if (val.length > 0) {
|
||||
for( let term of val ){
|
||||
for (let term of val)
|
||||
results.push( term.value );
|
||||
}
|
||||
|
||||
this.$emit('input', results);
|
||||
this.$emit('blur');
|
||||
}
|
||||
},
|
||||
emitRemove(){
|
||||
let val = this.selected;
|
||||
let results = [];
|
||||
|
||||
for( let term of val ){
|
||||
for (let term of val)
|
||||
results.push(term.value);
|
||||
}
|
||||
|
||||
this.$emit('input', results);
|
||||
this.$emit('blur');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue