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",
|
||||
|
|
|
@ -41,14 +41,14 @@ class Admin {
|
|||
array( &$this, 'admin_page' ),
|
||||
plugin_dir_url( __FILE__ ) . 'images/tainacan_logo_symbol.svg'
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
$this->menu_slug,
|
||||
__('System check', 'tainacan'),
|
||||
__('System check', 'tainacan'),
|
||||
'manage_options',
|
||||
'tainacan_systemcheck',
|
||||
array( &$this, 'systemcheck_page' )
|
||||
|
||||
add_submenu_page(
|
||||
$this->menu_slug,
|
||||
__('System check', 'tainacan'),
|
||||
__('System check', 'tainacan'),
|
||||
'manage_options',
|
||||
'tainacan_systemcheck',
|
||||
array( &$this, 'systemcheck_page' )
|
||||
);
|
||||
|
||||
add_action( 'load-' . $page_suffix, array( &$this, 'load_admin_page' ) );
|
||||
|
@ -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') );
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,18 +75,18 @@ class Admin {
|
|||
|
||||
function add_theme_files() {
|
||||
global $TAINACAN_BASE_URL;
|
||||
|
||||
|
||||
// wp_enqueue_style( 'style', $TAINACAN_BASE_URL . '/assets/css/fonts/materialdesignicons.css' );
|
||||
wp_enqueue_style( 'tainacan-fonts', $TAINACAN_BASE_URL . '/assets/css/fonts/tainacanicons.css', [], TAINACAN_VERSION );
|
||||
wp_enqueue_style( 'roboto-fonts', 'https://fonts.googleapis.com/css?family=Roboto:400,400i,500,500i,700,700i', [], TAINACAN_VERSION );
|
||||
wp_enqueue_script('underscore');
|
||||
}
|
||||
|
||||
|
||||
function add_admin_css() {
|
||||
global $TAINACAN_BASE_URL;
|
||||
|
||||
|
||||
wp_enqueue_style( 'tainacan-admin-page', $TAINACAN_BASE_URL . '/assets/css/tainacan-admin.css', [], TAINACAN_VERSION );
|
||||
|
||||
|
||||
// $undesired_wp_styles = [
|
||||
// 'admin-menu',
|
||||
// 'admin-bar',
|
||||
|
@ -119,14 +120,14 @@ class Admin {
|
|||
//
|
||||
// wp_dequeue_style( $undesired_wp_styles );
|
||||
// wp_deregister_style( $undesired_wp_styles );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function add_admin_js() {
|
||||
global $TAINACAN_BASE_URL;
|
||||
|
||||
wp_enqueue_script( 'tainacan-user-admin', $TAINACAN_BASE_URL . '/assets/user_admin-components.js', ['underscore', 'media-editor', 'media-views', 'customize-controls'], TAINACAN_VERSION, true );
|
||||
|
||||
|
||||
$settings = $this->get_admin_js_localization_params();
|
||||
|
||||
wp_localize_script( 'tainacan-user-admin', 'tainacan_plugin', $settings );
|
||||
|
@ -134,23 +135,23 @@ class Admin {
|
|||
wp_enqueue_script('underscore');
|
||||
wp_enqueue_script('jcrop');
|
||||
wp_enqueue_script( 'customize-controls' );
|
||||
|
||||
|
||||
do_action('tainacan-enqueue-admin-scripts');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Also used by DevInterface
|
||||
*/
|
||||
function get_admin_js_localization_params() {
|
||||
global $TAINACAN_BASE_URL, $TAINACAN_API_MAX_ITEMS_PER_PAGE;
|
||||
|
||||
|
||||
$Tainacan_Collections = \Tainacan\Repositories\Collections::get_instance();
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$Tainacan_Filters = \Tainacan\Repositories\Filters::get_instance();
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
$Tainacan_Taxonomies = \Tainacan\Repositories\Taxonomies::get_instance();
|
||||
|
||||
|
||||
$tainacan_admin_i18n = require( 'tainacan-admin-i18n.php' );
|
||||
|
||||
$entities_labels = [
|
||||
|
@ -222,33 +223,33 @@ class Admin {
|
|||
}
|
||||
|
||||
$filter_types = $Tainacan_Filters->fetch_filter_types();
|
||||
|
||||
|
||||
foreach ( $filter_types as $index => $filter_type){
|
||||
$class = new $filter_type;
|
||||
$settings['i18n']['helpers_label'][$class->get_component()] = $class->get_form_labels();
|
||||
}
|
||||
|
||||
|
||||
$settings['form_hooks'] = Admin_Hooks::get_instance()->get_registered_hooks();
|
||||
|
||||
|
||||
$wp_post_types = get_post_types(['show_ui' => true], 'objects');
|
||||
if (isset($wp_post_types['attachment'])) {
|
||||
unset($wp_post_types['attachment']);
|
||||
}
|
||||
|
||||
|
||||
$wp_post_types = array_map(function($i) {
|
||||
return [
|
||||
'slug' => $i->name,
|
||||
'label' => $i->label
|
||||
];
|
||||
}, $wp_post_types);
|
||||
|
||||
|
||||
$settings['wp_post_types'] = $wp_post_types;
|
||||
|
||||
|
||||
// add an alternative to enable select all items in all pages while we temporarly disable bulk edit for all (see #199)
|
||||
$settings['enable_select_all_items_pages'] = defined('TAINACAN_ENABLE_SELECT_ALL_ITEMS_PAGES') ? TAINACAN_ENABLE_SELECT_ALL_ITEMS_PAGES : false;
|
||||
|
||||
$settings['enable_select_all_items_pages'] = defined('TAINACAN_ENABLE_SELECT_ALL_ITEMS_PAGES') ? TAINACAN_ENABLE_SELECT_ALL_ITEMS_PAGES : false;
|
||||
|
||||
return $settings;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function admin_body_class( $classes ) {
|
||||
|
@ -334,7 +335,7 @@ class Admin {
|
|||
|
||||
wp_die();
|
||||
}
|
||||
|
||||
|
||||
public function systemcheck_page() {
|
||||
require_once('system-check/class-tainacan-system-check.php');
|
||||
$check = new System_Check();
|
||||
|
|
|
@ -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">
|
||||
|
@ -232,7 +232,7 @@
|
|||
</b-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Default View Mode -------------------------------- -->
|
||||
<b-field
|
||||
v-if="form.enabled_view_modes.length > 0"
|
||||
|
@ -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>
|
||||
|
@ -250,11 +252,11 @@
|
|||
:active.sync="isURLModalActive"
|
||||
:width="640"
|
||||
scroll="keep"
|
||||
trap-focus
|
||||
autofocus
|
||||
trap-focus
|
||||
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>
|
||||
|
||||
|
@ -22,7 +31,7 @@
|
|||
<span class="required-term-asterisk">*</span>
|
||||
<help-button
|
||||
:title="$i18n.get('label_name')"
|
||||
:message="$i18n.get('info_help_term_name')"/>
|
||||
:message="$i18n.get('info_help_term_name')"/>
|
||||
</label>
|
||||
<b-input
|
||||
:placeholder="$i18n.get('label_term_without_name')"
|
||||
|
@ -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">
|
||||
{{ props.option.name }}
|
||||
<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{
|
||||
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"
|
||||
|
@ -1172,6 +1174,10 @@ export default {
|
|||
font-size: 1rem;
|
||||
margin-left: -16px;
|
||||
}
|
||||
|
||||
.field .collapse-handle {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
input, select, textarea,
|
||||
.input, .tags, .tag {
|
||||
|
|
|
@ -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
|
||||
|
@ -247,11 +245,10 @@
|
|||
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-metadata"/>
|
||||
</span>
|
||||
</p>
|
||||
<p>{{ $i18n.get('info_there_is_no_metadatum') }}</p>
|
||||
<p>{{ $i18n.get('info_create_metadata') }}</p>
|
||||
<p>{{ $i18n.get('info_there_is_no_metadatum') }}</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,35 +363,35 @@
|
|||
let selected = this.selected instanceof Array ? this.selected : [this.selected];
|
||||
|
||||
if (this.taxonomy_id && selected.length) {
|
||||
for (const term of selected) {
|
||||
|
||||
this.isSelectedTermsLoading = true;
|
||||
this.isSelectedTermsLoading = true;
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomy_id}/terms/${term}`)
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.name);
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
axios.get(`/taxonomy/${this.taxonomy_id}/terms/?${qs.stringify({ hideempty: 0, include: selected})}`)
|
||||
.then((res) => {
|
||||
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/?${qs.stringify({ fetch_only: 'title', postin: selected})}`)
|
||||
.then((res) => {
|
||||
for (const item of res.data)
|
||||
this.saveSelectedTagName(item.id, item.title);
|
||||
|
||||
axios.get('/items/' + item + '?fetch_only=title')
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.title);
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
saveSelectedTagName(value, label){
|
||||
|
|
|
@ -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>
|
||||
|
||||
<b-loading
|
||||
<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,13 +54,9 @@ 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
|
||||
defaultTooltipAnimated: true
|
||||
});
|
||||
Vue.use(VTooltip);
|
||||
Vue.use(VueMasonry);
|
||||
|
@ -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 */
|
||||
|
@ -128,7 +126,7 @@ new Vue({
|
|||
render: h => h(AdminPage)
|
||||
});
|
||||
|
||||
// Display Icons only once everything is loaded
|
||||
// Display Icons only once everything is loaded
|
||||
function listen(evnt, elem, func) {
|
||||
if (elem.addEventListener) // W3C DOM
|
||||
elem.addEventListener(evnt,func,false);
|
||||
|
|
|
@ -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';
|
||||
|
@ -34,7 +33,7 @@ import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, StatusH
|
|||
|
||||
// Configure and Register Plugins
|
||||
Vue.use(Buefy, {
|
||||
defaultTooltipAnimated: true
|
||||
defaultTooltipAnimated: true
|
||||
});
|
||||
Vue.use(VTooltip);
|
||||
Vue.use(VueMasonry);
|
||||
|
@ -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);
|
||||
|
@ -79,7 +76,7 @@ import ThemeItemsList from '../theme-items-list.vue';
|
|||
export const ThemeItemsListing = new Vue({
|
||||
el: '#tainacan-items-page',
|
||||
store,
|
||||
router: routerTheme,
|
||||
router: routerTheme,
|
||||
data: {
|
||||
termId: '',
|
||||
taxonomy: '',
|
||||
|
@ -90,9 +87,9 @@ export const ThemeItemsListing = new Vue({
|
|||
},
|
||||
render: h => h(ThemeItemsList),
|
||||
beforeMount () {
|
||||
|
||||
|
||||
this.collectionId = this.$el.attributes['collection-id'] != undefined ? this.$el.attributes['collection-id'].value : undefined;
|
||||
|
||||
|
||||
if (this.$el.attributes['default-view-mode'] != undefined)
|
||||
this.defaultViewMode = this.$el.attributes['default-view-mode'].value;
|
||||
else
|
||||
|
@ -107,10 +104,10 @@ export const ThemeItemsListing = new Vue({
|
|||
this.taxonomy = this.$el.attributes['taxonomy'].value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// Display Icons only once everything is loaded
|
||||
// Display Icons only once everything is loaded
|
||||
function listen(evnt, elem, func) {
|
||||
if (elem.addEventListener) // W3C DOM
|
||||
elem.addEventListener(evnt,func,false);
|
||||
|
|
|
@ -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,25 +55,29 @@
|
|||
.is-small { color: $gray4; }
|
||||
&.is-active { background-color: $turquoise2; }
|
||||
|
||||
.media-left {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
.media-content {
|
||||
display: flex;
|
||||
width: 80%;
|
||||
.media {
|
||||
align-items: center;
|
||||
|
||||
.media-left {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
.media-content {
|
||||
display: flex;
|
||||
width: 80%;
|
||||
|
||||
.ellipsed-text {
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-right: 3px;
|
||||
.ellipsed-text {
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-right: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.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
|
||||
|
|
|
@ -8,4 +8,4 @@
|
|||
@import "../../../node_modules/bulma/sass/elements/button.sass"
|
||||
@import "../../../node_modules/bulma/sass/grid/columns.sass"
|
||||
@import "../../../node_modules/bulma/sass/components/dropdown.sass"
|
||||
@import "../../../node_modules/bulma/sass/components/modal.sass"
|
||||
@import "../../../node_modules/bulma/sass/components/modal.sass"
|
|
@ -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' ),
|
||||
|
@ -446,11 +450,12 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'instruction_image_upload_box' => __( 'Drop an image here or click to upload.', 'tainacan' ),
|
||||
'instruction_select_a_status' => __( 'Select a status:', 'tainacan' ),
|
||||
'instruction_select_a_status2' => __( 'Select a status', 'tainacan' ),
|
||||
'instruction_click_to_select_a_filter_type' => __( 'Click to select a filter type:', 'tainacan' ),
|
||||
'instruction_click_to_select_a_filter_type' => __( 'Click to select a filter type:', 'tainacan' ),
|
||||
'instruction_select_a_parent_term' => __( 'Select a parent term:', 'tainacan' ),
|
||||
'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',
|
||||
|
@ -148,37 +148,39 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
|
||||
return apply_filters('tainacan-api-prepare-items-args', $args, $request);
|
||||
}
|
||||
|
||||
|
||||
public function add_support_to_tax_query_like($args) {
|
||||
|
||||
|
||||
if (!isset($args['tax_query']) || !is_array($args['tax_query'])) {
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
||||
$new_tax_query = [];
|
||||
|
||||
|
||||
foreach ($args['tax_query'] as $index => $tax_query) {
|
||||
|
||||
|
||||
if ( isset($tax_query['operator']) && $tax_query['operator'] == 'LIKE' &&
|
||||
isset($tax_query['terms']) && is_string($tax_query['terms']) ) {
|
||||
|
||||
|
||||
$terms = get_terms([
|
||||
'taxonomy' => $tax_query['taxonomy'],
|
||||
'fields' => 'ids',
|
||||
'hide_empty' => isset($args['hide_empty']) ? $args['hide_empty'] : true,
|
||||
'search' => $tax_query['terms']
|
||||
]);
|
||||
|
||||
|
||||
$new_tax_query[] = [
|
||||
'taxonomy' => $tax_query['taxonomy'],
|
||||
'terms' => $terms,
|
||||
];
|
||||
|
||||
|
||||
} elseif ( isset($tax_query['operator']) && $tax_query['operator'] == 'NOT LIKE' &&
|
||||
isset($tax_query['terms']) && is_string($tax_query['terms']) ) {
|
||||
|
||||
|
||||
$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) {
|
||||
|
@ -188,18 +190,18 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'operator' => 'NOT IN'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
$new_tax_query[] = $tax_query;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$args['tax_query'] = $new_tax_query;
|
||||
|
||||
|
||||
return $args;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -229,7 +231,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
$args[ $mapped_v ][ $index1 ][ $meta_v ] = $request[ $mapped ][ $index1 ][ $meta_v ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -260,7 +262,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the fetch_only param
|
||||
*
|
||||
|
@ -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',
|
||||
),
|
||||
'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'
|
||||
|
@ -510,11 +588,11 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function get_repository_schema( \Tainacan\Repositories\Repository $repository ) {
|
||||
|
||||
|
||||
$schema = [];
|
||||
|
||||
|
||||
$map = $repository->get_map();
|
||||
|
||||
foreach ($map as $mapped => $value){
|
||||
|
@ -523,14 +601,14 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'type' => $value['type']
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
return $schema;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function get_permissions_schema() {
|
||||
|
||||
|
||||
return [
|
||||
'current_user_can_edit' => [
|
||||
'description' => esc_html__('Whether current user can edit this object', 'tainacan'),
|
||||
|
@ -543,12 +621,12 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'context' => 'edit'
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function get_base_properties_schema() {
|
||||
return [
|
||||
|
||||
|
||||
'id' => [
|
||||
'description' => esc_html__( 'Unique identifier for the object.', 'tainacan' ),
|
||||
'type' => 'integer',
|
||||
|
@ -557,7 +635,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -42,38 +42,48 @@ 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
|
||||
],
|
||||
],
|
||||
),
|
||||
));
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<id>[0-9]+)', array(
|
||||
|
||||
|
||||
array(
|
||||
'methods' => \WP_REST_Server::READABLE,
|
||||
'callback' => array($this, 'get_item'),
|
||||
'permission_callback' => array($this, 'bg_processes_permissions_check'),
|
||||
),
|
||||
|
||||
|
||||
));
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<id>[0-9]+)', array(
|
||||
|
||||
|
||||
array(
|
||||
'methods' => \WP_REST_Server::EDITABLE,
|
||||
'callback' => array($this, 'update_item'),
|
||||
|
@ -82,27 +92,31 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
'status' => [
|
||||
'type' => 'string',
|
||||
'description' => __( '"open" or "closed" ', 'tainacan' ),
|
||||
'enum' => array(
|
||||
'open',
|
||||
'closed'
|
||||
)
|
||||
]
|
||||
],
|
||||
),
|
||||
|
||||
|
||||
));
|
||||
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<id>[0-9]+)', array(
|
||||
|
||||
|
||||
array(
|
||||
'methods' => \WP_REST_Server::DELETABLE,
|
||||
'callback' => array($this, 'delete_item'),
|
||||
'permission_callback' => array($this, 'bg_processes_permissions_check'),
|
||||
|
||||
|
||||
),
|
||||
|
||||
|
||||
));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param \WP_REST_Request $request
|
||||
|
@ -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 = "";
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +168,7 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
$status_q = "AND done = 1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$recent_q = '';
|
||||
if ( isset($request['recent']) && $request['recent'] !== false ) {
|
||||
$recent_q = "AND (processed_last >= NOW() - INTERVAL 10 MINUTE OR queued_on >= NOW() - INTERVAL 10 MINUTE)";
|
||||
|
@ -180,7 +194,7 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
|
||||
$rest_response->header('X-WP-Total', (int) $total_items);
|
||||
$rest_response->header('X-WP-TotalPages', (int) $max_pages);
|
||||
|
||||
|
||||
return $rest_response;
|
||||
|
||||
}
|
||||
|
@ -314,9 +328,9 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
|
||||
public function get_log_url($id, $action, $type = '') {
|
||||
$suffix = $type ? '-' . $type : '';
|
||||
|
||||
|
||||
$filename = 'bg-' . $action . '-' . $id . $suffix . '.log';
|
||||
|
||||
|
||||
$upload_url = wp_upload_dir();
|
||||
|
||||
if (!file_exists( $upload_url['basedir'] . '/tainacan/' . $filename )) {
|
||||
|
@ -325,7 +339,7 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
|
||||
$upload_url = trailingslashit( $upload_url['baseurl'] );
|
||||
$logs_url = $upload_url . 'tainacan/' . $filename;
|
||||
|
||||
|
||||
return $logs_url;
|
||||
|
||||
}
|
||||
|
|
|
@ -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,11 +469,10 @@ 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' )
|
||||
'type' => 'string',
|
||||
'default' => 'view',
|
||||
'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,11 +361,10 @@ 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()
|
||||
);
|
||||
}
|
||||
|
||||
return $endpoint_args;
|
||||
|
|
|
@ -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,11 +582,10 @@ 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,16 +466,11 @@ 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,11 +421,10 @@ 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!
|
||||
]]];
|
||||
}
|
||||
|
|
|
@ -5,58 +5,78 @@ namespace Tainacan;
|
|||
* Class withe helpful methods to handle media in Tainacan
|
||||
*/
|
||||
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)) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
public static function get_instance() {
|
||||
if(!isset(self::$instance)) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
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.
|
||||
*
|
||||
* @param String $url
|
||||
* @param String $url
|
||||
* @param Int $post_id (optional) the post this attachement should be attached to. empty for none
|
||||
* @return Int|false Attachment ID. False on failure
|
||||
*/
|
||||
public function insert_attachment_from_url($url, $post_id = null) {
|
||||
$filename = $this->save_remote_file($url);
|
||||
|
||||
|
||||
if( !file_exists($filename) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$file = fopen($filename,'r');
|
||||
|
||||
|
||||
if (false === $file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->insert_attachment_from_blob($file, basename($url), $post_id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert an attachment from a local file.
|
||||
*
|
||||
* @param String $filename The path to the file
|
||||
* @param String $filename The path to the file
|
||||
* @param Int $post_id (optional) the post this attachement should be attached to. empty for none
|
||||
* @return Int|false Attachment ID. False on failure
|
||||
*/
|
||||
public function insert_attachment_from_file($filename, $post_id = null) {
|
||||
|
||||
|
||||
if( !file_exists($filename) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return $this->insert_attachment_from_blob(fopen($filename,'r'), basename($filename), $post_id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,7 +141,7 @@ class Media {
|
|||
public function insert_attachment_from_blob($blob, $filename, $post_id = null) {
|
||||
|
||||
do_action('tainacan-pre-insert-attachment', $blob, $filename, $post_id);
|
||||
|
||||
|
||||
$upload = wp_upload_bits( $filename, null, $blob );
|
||||
if( !empty( $upload['error'] ) ) {
|
||||
return false;
|
||||
|
@ -130,7 +150,7 @@ class Media {
|
|||
if( @filesize($upload['file']) == 0 && is_resource($blob) ){
|
||||
$file_wordpress_stream = fopen( $upload['file'], 'r+');
|
||||
stream_copy_to_stream($blob, $file_wordpress_stream);
|
||||
|
||||
|
||||
if( file_exists(self::$file_name) ) unlink(self::$file_name);
|
||||
}
|
||||
|
||||
|
@ -139,12 +159,12 @@ class Media {
|
|||
$file_type = wp_check_filetype( $file_name, null );
|
||||
$attachment_title = sanitize_file_name( pathinfo( $file_name, PATHINFO_FILENAME ) );
|
||||
$wp_upload_dir = wp_upload_dir();
|
||||
|
||||
|
||||
$guid = \str_replace($wp_upload_dir['basedir'], '', $file_path);
|
||||
$guid = $wp_upload_dir['baseurl'] . $guid;
|
||||
|
||||
$post_info = array(
|
||||
'guid' => $guid,
|
||||
'guid' => $guid,
|
||||
'post_mime_type' => $file_type['type'],
|
||||
'post_title' => $attachment_title,
|
||||
'post_content' => '',
|
||||
|
@ -162,12 +182,12 @@ class Media {
|
|||
|
||||
// Assign metadata to attachment
|
||||
wp_update_attachment_metadata( $attach_id, $attach_data );
|
||||
|
||||
|
||||
do_action('tainacan-post-insert-attachment', $attach_id, $attach_data, $post_id);
|
||||
|
||||
|
||||
return $attach_id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add support to get mime type content even when mime_content_type function is not available
|
||||
* @param string $filename The file name to check the mime type
|
||||
|
@ -183,10 +203,10 @@ class Media {
|
|||
return $mime_type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extract an image from the first page of a pdf file
|
||||
*
|
||||
*
|
||||
* @param string $filepath The pdf filepath in the server
|
||||
* @return blob bitstream of the image in jpg format
|
||||
*/
|
||||
|
@ -195,11 +215,11 @@ class Media {
|
|||
if ($blob) {
|
||||
return $blob;
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('\Imagick')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
if ( $this->get_mime_content_type($filepath) != 'application/pdf') {
|
||||
return null;
|
||||
}
|
||||
|
@ -207,10 +227,10 @@ class Media {
|
|||
if ( !is_readable( realpath($filepath) ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
register_shutdown_function(array($this, 'shutdown_function'));
|
||||
$this->THROW_EXCPTION_ON_FATAL_ERROR = true;
|
||||
$this->THROW_EXCPTION_ON_FATAL_ERROR = true;
|
||||
$imagick = new \Imagick();
|
||||
$imagick->setResolution(72,72);
|
||||
$imagick->readImage($filepath . '[0]');
|
||||
|
@ -227,23 +247,23 @@ class Media {
|
|||
|
||||
private $THROW_EXCPTION_ON_FATAL_ERROR = false;
|
||||
public function shutdown_function() {
|
||||
if( $this->THROW_EXCPTION_ON_FATAL_ERROR )
|
||||
if( $this->THROW_EXCPTION_ON_FATAL_ERROR )
|
||||
throw new \Exception("fatal error");
|
||||
}
|
||||
|
||||
|
||||
public function index_pdf_content($file, $item_id) {
|
||||
|
||||
|
||||
if ( ! defined('TAINACAN_INDEX_PDF_CONTENT') || true !== TAINACAN_INDEX_PDF_CONTENT ) {
|
||||
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 );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ( ! \file_exists($file) ) {
|
||||
return false;
|
||||
}
|
||||
|
@ -251,8 +271,8 @@ class Media {
|
|||
if ( $this->get_mime_content_type($file) != 'application/pdf') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Allow plugins to implement other approach to index pdf contents
|
||||
|
||||
// Allow plugins to implement other approach to index pdf contents
|
||||
$alternate = apply_filters('tainacan-index-pdf', null, $file, $item_id);
|
||||
if ( ! \is_null($alternate) ) {
|
||||
return $alternate;
|
||||
|
@ -260,7 +280,7 @@ class Media {
|
|||
|
||||
try {
|
||||
$parser = new \Smalot\PdfParser\Parser();
|
||||
$content = $parser->parseFile($file)->getText();
|
||||
$content = $parser->parseFile($file)->getText();
|
||||
|
||||
$wp_charset = get_bloginfo('charset');
|
||||
$content_charset = mb_detect_encoding($content);
|
||||
|
@ -272,5 +292,71 @@ class Media {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,9 +8,11 @@ use Tainacan\Entities;
|
|||
* Class withe helpful methods to handle media in Tainacan
|
||||
*/
|
||||
class Private_Files {
|
||||
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
public $dir_separator;
|
||||
|
||||
public static function get_instance() {
|
||||
if(!isset(self::$instance)) {
|
||||
self::$instance = new self();
|
||||
|
@ -18,26 +20,31 @@ class Private_Files {
|
|||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
|
||||
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']);
|
||||
|
||||
|
||||
add_action('tainacan-pre-insert-attachment', [$this, 'pre_tainacan_upload'], 10, 3);
|
||||
add_action('tainacan-post-insert-attachment', [$this, 'post_tainacan_upload'], 10, 3);
|
||||
|
||||
|
||||
add_action('template_redirect', [$this, 'template_redirect']);
|
||||
add_filter('image_get_intermediate_size', [$this, 'image_get_intermediate_size'], 10, 3);
|
||||
add_filter('wp_get_attachment_url', [$this, 'wp_get_attachment_url'], 10, 2);
|
||||
|
||||
|
||||
add_action('tainacan-insert', [$this, 'update_item_and_collection']);
|
||||
|
||||
|
||||
add_action('tainacan-bulk-edit-set-status', [$this, 'bulk_edit'], 10, 4);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function pre_tainacan_upload($blob, $filename, $post_id) {
|
||||
if (is_numeric($post_id)) {
|
||||
global $TAINACAN_UPLOADING_ATTACHMENT_TO_POST;
|
||||
|
@ -45,33 +52,33 @@ class Private_Files {
|
|||
add_filter('upload_dir', [$this, 'change_upload_dir']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function post_tainacan_upload($attach_id, $attach_data, $post_id) {
|
||||
remove_filter('upload_dir', [$this, 'change_upload_dir']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds a filter to the upload_dir hook when uploading a new file
|
||||
*
|
||||
* Adds a filter to the upload_dir hook when uploading a new file
|
||||
*
|
||||
*/
|
||||
function pre_upload($file){
|
||||
add_filter('upload_dir', [$this, 'change_upload_dir']);
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes a filter to the upload_dir hook after uploading a new file
|
||||
*
|
||||
* Removes a filter to the upload_dir hook after uploading a new file
|
||||
*
|
||||
*/
|
||||
function post_upload($fileinfo){
|
||||
remove_filter('upload_dir', [$this, 'change_upload_dir']);
|
||||
return $fileinfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the base directory inside the uploads folder where
|
||||
* attachments and documents for items will be uploaded
|
||||
*
|
||||
* Gets the base directory inside the uploads folder where
|
||||
* attachments and documents for items will be uploaded
|
||||
*
|
||||
* @return string The folder name
|
||||
*/
|
||||
function get_items_uploads_folder() {
|
||||
|
@ -80,11 +87,11 @@ class Private_Files {
|
|||
}
|
||||
return 'tainacan-items';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the directory prefix to be added to folders holding
|
||||
* attachments and documents for private items or collections
|
||||
*
|
||||
* attachments and documents for private items or collections
|
||||
*
|
||||
* @return string The folder prefix
|
||||
*/
|
||||
function get_private_folder_prefix() {
|
||||
|
@ -93,140 +100,140 @@ class Private_Files {
|
|||
}
|
||||
return '_x_';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change the upload directory for items attachments and documents
|
||||
* Change the upload directory for items attachments and documents
|
||||
*
|
||||
* It replaces the default WordPress strucutre, which is YYYY/MM/file
|
||||
* with a path containing the collection id and the item id inside the @see get_items_uploads_folder():
|
||||
* It replaces the default WordPress strucutre, which is YYYY/MM/file
|
||||
* with a path containing the collection id and the item id inside the @see get_items_uploads_folder():
|
||||
* ex: * tainacan-items/$collection_id/$item_id
|
||||
*
|
||||
* It also add a prefix in the folder name of private items or collections:
|
||||
* It also add a prefix in the folder name of private items or collections:
|
||||
* tainacan-items/$collection_id/_x_$item_id ($item_id is a private item)
|
||||
*
|
||||
*
|
||||
*/
|
||||
function change_upload_dir($path) {
|
||||
$post_id = false;
|
||||
|
||||
|
||||
// regular ajax uploads via Admin Panel will send post_id
|
||||
if ( isset($_REQUEST['post_id']) && $_REQUEST['post_id'] ) {
|
||||
$post_id = $_REQUEST['post_id'];
|
||||
}
|
||||
|
||||
|
||||
// API requests to media endpoint will send post
|
||||
if ( false === $post_id && isset($_REQUEST['post']) && is_numeric($_REQUEST['post']) ) {
|
||||
$post_id = $_REQUEST['post'];
|
||||
}
|
||||
|
||||
// tainacan internals, scripts and tests, will set this global
|
||||
|
||||
// tainacan internals, scripts and tests, will set this global
|
||||
if (false === $post_id) {
|
||||
global $TAINACAN_UPLOADING_ATTACHMENT_TO_POST;
|
||||
if ( isset($TAINACAN_UPLOADING_ATTACHMENT_TO_POST) && is_numeric($TAINACAN_UPLOADING_ATTACHMENT_TO_POST) ) {
|
||||
$post_id = $TAINACAN_UPLOADING_ATTACHMENT_TO_POST;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (false === $post_id) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
||||
$theme_helper = \Tainacan\Theme_Helper::get_instance();
|
||||
|
||||
|
||||
$post = get_post($post_id);
|
||||
|
||||
|
||||
if ( !$theme_helper->is_post_an_item($post) ) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
||||
$item = \Tainacan\Repositories\Items::get_instance()->fetch( (int) $post_id );
|
||||
|
||||
|
||||
if ($item instanceof \Tainacan\Entities\Item) {
|
||||
|
||||
|
||||
$tainacan_basepath = $this->get_items_uploads_folder();
|
||||
$col_id_url = $item->get_collection_id();
|
||||
$col_id = $item->get_collection_id();
|
||||
$item_id_url = $item->get_id();
|
||||
$item_id = $item->get_id();
|
||||
|
||||
|
||||
$col_status = get_post_status_object($item->get_collection()->get_status());
|
||||
$item_status = get_post_status_object($item->get_status());
|
||||
|
||||
|
||||
if ( ! $col_status->public ) {
|
||||
$col_id = $this->get_private_folder_prefix() . $col_id;
|
||||
}
|
||||
if ( ! $item_status->public ) {
|
||||
$item_id = $this->get_private_folder_prefix() . $item_id;
|
||||
}
|
||||
|
||||
|
||||
$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['url'] = str_replace($path['subdir'], '/' . $tainacan_basepath . '/' . $col_id_url . '/' . $item_id_url, $path['url']);
|
||||
$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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $path;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handles 404 returns looking for attachments inside the tainacan items uploads folder
|
||||
* Handles 404 returns looking for attachments inside the tainacan items uploads folder
|
||||
*
|
||||
* When looking for a file that does not exists, it checks for relative prefixed folders.
|
||||
* When looking for a file that does not exists, it checks for relative prefixed folders.
|
||||
* If it finds the file, it then checks to see if current user have permission to see this file, based on
|
||||
* the permission he/she have to read the related item.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function template_redirect() {
|
||||
|
||||
|
||||
if (is_404()) {
|
||||
|
||||
|
||||
$upload_dir = wp_get_upload_dir();
|
||||
$base_upload_url = preg_replace('/^https?:\/\//', '', $upload_dir['baseurl']);
|
||||
|
||||
|
||||
$requested_uri = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
|
||||
|
||||
|
||||
if ( strpos($requested_uri, $base_upload_url) === false ) {
|
||||
// Not uploads
|
||||
// Not uploads
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
// private item
|
||||
$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);
|
||||
// private collection
|
||||
$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);
|
||||
// private both
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
if ($existing_file) {
|
||||
|
||||
|
||||
$item = \Tainacan\Repositories\Items::get_instance()->fetch( (int) $item_id, (int) $collection_id );
|
||||
$mime_type = \Tainacan\Media::get_instance()->get_mime_content_type($existing_file);
|
||||
|
||||
|
||||
if ($item instanceof \Tainacan\Entities\Item && $item->can_read()) {
|
||||
//header('Content-Description: File Transfer');
|
||||
//header('Content-Type: application/octet-stream');
|
||||
|
@ -237,137 +244,137 @@ class Private_Files {
|
|||
// header('Pragma: public');
|
||||
// header('Content-Length: ' . filesize($file));
|
||||
\readfile($existing_file);
|
||||
|
||||
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Filters the image_get_intermediate_size hook to strip out the
|
||||
* Filters the image_get_intermediate_size hook to strip out the
|
||||
* private uploads folder prefix from the attachments URLs
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Filters the wp_get_attachment_url hook to strip out the
|
||||
* Filters the wp_get_attachment_url hook to strip out the
|
||||
* private uploads folder prefix from the attachments URLs
|
||||
*/
|
||||
function wp_get_attachment_url($url, $post_id) {
|
||||
$url = str_replace('/' . $this->get_private_folder_prefix(), '/', $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* When an item or collection is saved, it checks if the satus was changed and
|
||||
* if the items upload directory mus be renamed to add or remove the
|
||||
* private folder prefix
|
||||
* When an item or collection is saved, it checks if the satus was changed and
|
||||
* if the items upload directory mus be renamed to add or remove the
|
||||
* private folder prefix
|
||||
*/
|
||||
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 ) {
|
||||
|
||||
|
||||
$status_obj = get_post_status_object($obj->get_status());
|
||||
|
||||
|
||||
$folder .= $status_obj->public ? $obj->get_id() : $this->get_private_folder_prefix() . $obj->get_id();
|
||||
$check_folder .= ! $status_obj->public ? $obj->get_id() : $this->get_private_folder_prefix() . $obj->get_id();
|
||||
|
||||
|
||||
$check = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( $obj instanceof \Tainacan\Entities\Item ) {
|
||||
|
||||
|
||||
$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 .= DIRECTORY_SEPARATOR;
|
||||
$check_folder .= 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 .= $this->dir_separator;
|
||||
$check_folder .= $this->dir_separator;
|
||||
|
||||
$status_obj = get_post_status_object($obj->get_status());
|
||||
|
||||
|
||||
$folder .= $status_obj->public ? $obj->get_id() : $this->get_private_folder_prefix() . $obj->get_id();
|
||||
$check_folder .= ! $status_obj->public ? $obj->get_id() : $this->get_private_folder_prefix() . $obj->get_id();
|
||||
|
||||
|
||||
$check = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($check) {
|
||||
|
||||
|
||||
$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);
|
||||
do_action('tainacan-upload-folder-renamed', $full_path_check, $full_path);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rename all folders from items after a bulk edit operation move their statuses
|
||||
* Rename all folders from items after a bulk edit operation move their statuses
|
||||
*
|
||||
* TODO: In the upcoming bulk edit refactor this must be handled as there are performance issues
|
||||
*
|
||||
*
|
||||
*/
|
||||
function bulk_edit($status, $group, $select_query, $query) {
|
||||
global $wpdb;
|
||||
|
||||
|
||||
$ids = $wpdb->get_col($select_query);
|
||||
|
||||
|
||||
$status_obj = get_post_status_object($status);
|
||||
$prefix = $status_obj->public ? $this->get_private_folder_prefix() : '';
|
||||
|
||||
|
||||
$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;
|
||||
$found = glob($folder);
|
||||
|
||||
|
||||
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);
|
||||
do_action('tainacan-upload-folder-renamed', $found[0], $target);
|
||||
|
||||
|
||||
}
|
||||
if (\file_exists($folder)) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -125,7 +133,7 @@ class Log extends Entity {
|
|||
public function get_old_value() {
|
||||
return $this->get_mapped_property( 'old_value' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get new value of log entry object
|
||||
*
|
||||
|
@ -183,7 +191,7 @@ class Log extends Entity {
|
|||
public function set_old_value( $value ) {
|
||||
$this->set_mapped_property( 'old_value', $value );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set new value of log entry
|
||||
*
|
||||
|
@ -201,19 +209,19 @@ class Log extends Entity {
|
|||
public function get_log_diffs(){
|
||||
return $this->get_mapped_property('log_diffs');
|
||||
}
|
||||
|
||||
|
||||
public function get_object_type() {
|
||||
$this->get_mapped_property('object_type');
|
||||
return $this->get_mapped_property('object_type');
|
||||
}
|
||||
|
||||
|
||||
public function set_object_type($value) {
|
||||
$this->set_mapped_property('object_type', $value);
|
||||
}
|
||||
|
||||
|
||||
public function get_object_id() {
|
||||
$this->get_mapped_property('object_id');
|
||||
return $this->get_mapped_property('object_id');
|
||||
}
|
||||
|
||||
|
||||
public function set_object_id($value) {
|
||||
$this->set_mapped_property('object_id', $value);
|
||||
}
|
||||
|
@ -231,11 +239,11 @@ class Log extends Entity {
|
|||
public function get_item_id(){
|
||||
return $this->get_mapped_property('item_id');
|
||||
}
|
||||
|
||||
|
||||
public function get_action() {
|
||||
$this->get_mapped_property('action');
|
||||
return $this->get_mapped_property('action');
|
||||
}
|
||||
|
||||
|
||||
public function set_action($value) {
|
||||
$this->set_mapped_property('action', $value);
|
||||
}
|
||||
|
@ -249,4 +257,4 @@ class Log extends Entity {
|
|||
|
||||
return $repository->approve( $this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,28 +22,28 @@ class Taxonomy extends Entity {
|
|||
* @var string
|
||||
*/
|
||||
static $post_type = 'tainacan-taxonomy';
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Tainacan\Entities\Entity::capability_type
|
||||
* @var string
|
||||
*/
|
||||
protected static $capability_type = ['tainacan-taxonomy', 'tainacan-taxonomies'];
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Tainacan\Entities\Entity::repository
|
||||
* @var string
|
||||
*/
|
||||
protected $repository = 'Taxonomies';
|
||||
|
||||
|
||||
/**
|
||||
* Prefix used to create the db_identifier
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $db_identifier_prefix = 'tnc_tax_';
|
||||
|
||||
|
||||
public function __toString(){
|
||||
return apply_filters("tainacan-taxonomy-to-string", $this->get_name(), $this);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class Taxonomy extends Entity {
|
|||
'new_item_name' => __( 'New Genre term', 'tainacan' ),
|
||||
'menu_name' => $this->get_name(),
|
||||
);
|
||||
|
||||
|
||||
$enabled_post_types = $this->get_enabled_post_types();
|
||||
$enabled_post_types = sizeof($enabled_post_types) ? $enabled_post_types : null;
|
||||
$show_ui = is_array($enabled_post_types) ? true : false;
|
||||
|
@ -80,21 +80,22 @@ class Taxonomy extends Entity {
|
|||
'show_admin_column' => false,
|
||||
'rewrite' => [
|
||||
'slug' => $this->get_slug()
|
||||
],
|
||||
],
|
||||
'update_count_callback' => '_update_generic_term_count'
|
||||
);
|
||||
|
||||
|
||||
if (taxonomy_exists($this->get_db_identifier())){
|
||||
unregister_taxonomy($this->get_db_identifier());
|
||||
}
|
||||
|
||||
|
||||
|
||||
register_taxonomy(
|
||||
$this->get_db_identifier(),
|
||||
$enabled_post_types,
|
||||
$args
|
||||
|
||||
|
||||
|
||||
register_taxonomy(
|
||||
$this->get_db_identifier(),
|
||||
$enabled_post_types,
|
||||
$args
|
||||
);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -135,7 +136,7 @@ class Taxonomy extends Entity {
|
|||
function get_slug() {
|
||||
return $this->get_mapped_property('slug');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the enabled post types
|
||||
*
|
||||
|
@ -144,7 +145,7 @@ class Taxonomy extends Entity {
|
|||
function get_enabled_post_types() {
|
||||
return $this->get_mapped_property('enabled_post_types');
|
||||
}
|
||||
|
||||
|
||||
// special Getters
|
||||
|
||||
/**
|
||||
|
@ -194,7 +195,7 @@ class Taxonomy extends Entity {
|
|||
function set_allow_insert($value) {
|
||||
$this->set_mapped_property('allow_insert', $value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets enabled post types
|
||||
*
|
||||
|
@ -221,19 +222,19 @@ class Taxonomy extends Entity {
|
|||
return parent::validate();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a term already exists
|
||||
* Check if a term already exists
|
||||
*
|
||||
* @param string $term_name The term name
|
||||
* @param int|null $parent The ID of the parent term to look for children or null to look for terms in any hierarchical position. Default is null
|
||||
* @param bool $return_term wether to return the term object if it exists. default is to false
|
||||
*
|
||||
* @return bool|WP_Term return boolean indicating if term exists. If $return_term is true and term exists, return WP_Term object
|
||||
* @param string $term_name The term name
|
||||
* @param int|null $parent The ID of the parent term to look for children or null to look for terms in any hierarchical position. Default is null
|
||||
* @param bool $return_term wether to return the term object if it exists. default is to false
|
||||
*
|
||||
* @return bool|WP_Term return boolean indicating if term exists. If $return_term is true and term exists, return WP_Term object
|
||||
*/
|
||||
function term_exists($term_name, $parent = null, $return_term = false) {
|
||||
$repo = $this->get_repository();
|
||||
return $repo->term_exists($this, $term_name, $parent, $return_term);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
|
@ -131,14 +121,12 @@
|
|||
let metadata = this.query.metaquery[ index ];
|
||||
|
||||
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship') {
|
||||
|
||||
let endpoint = '/items/' + metadata.value + '?fetch_only=title,thumbnail';
|
||||
|
||||
if (this.relatedCollectionId != '')
|
||||
endpoint = '/collection/' + this.relatedCollectionId + endpoint;
|
||||
let endpoint = '/items/' + metadata.value + '?fetch_only=title,thumbnail';
|
||||
|
||||
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>
|
||||
</script>
|
|
@ -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;
|
||||
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: {
|
||||
|
@ -71,11 +72,10 @@
|
|||
if ( this.query && this.query.metaquery && Array.isArray( this.query.metaquery ) ) {
|
||||
|
||||
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key == this.metadatumId );
|
||||
if ( index >= 0){
|
||||
if ( index >= 0) {
|
||||
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,20 +211,19 @@
|
|||
max-width: 165px !important;
|
||||
}
|
||||
.pagination .pagination-list .control {
|
||||
width: 74px !important;
|
||||
width: 77px !important;
|
||||
|
||||
.select {
|
||||
min-width: 100% !important;
|
||||
min-width: 100% !important;
|
||||
|
||||
select {
|
||||
padding-left: 1px !important;
|
||||
font-size: 0.75rem !important;
|
||||
height: 24px !important;
|
||||
min-width: 100% !important;
|
||||
|
||||
&:not(.is-loading)::after {
|
||||
margin-top: -13px !important;
|
||||
}
|
||||
}
|
||||
&:not(.is-loading)::after {
|
||||
margin-top: -13px !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:'',
|
||||
|
@ -122,7 +125,7 @@
|
|||
|
||||
let index = this.query.taxquery.findIndex(newMetadatum => newMetadatum.taxonomy == this.taxonomy);
|
||||
|
||||
if ( index >= 0){
|
||||
if (index >= 0) {
|
||||
let metadata = this.query.taxquery[ index ];
|
||||
this.selected = [];
|
||||
|
||||
|
@ -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' )
|
||||
.then( res => {
|
||||
this.selected.push({ label: res.data.name, value: res.data.id });
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
return all(promises);
|
||||
|
||||
let params = {
|
||||
'include': metadata.terms,
|
||||
'order': 'asc',
|
||||
'fetchonly': 0
|
||||
};
|
||||
|
||||
return axios.get('/taxonomy/' + this.taxonomyId + '/terms/?' + qs.stringify(params) )
|
||||
.then( res => {
|
||||
this.selected = res.data.map(term => { return { label: term.name, value: term.id } });
|
||||
})
|
||||
.catch(error => {
|
||||
this.$console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,41 +1,34 @@
|
|||
<template>
|
||||
<div>
|
||||
<div
|
||||
:class="{'has-content': dateValue !== undefined && dateValue !== ''}"
|
||||
class="control is-inline">
|
||||
<input
|
||||
:disabled="disabled"
|
||||
class="input"
|
||||
:class="{'is-danger': isInvalidDate && dateValue}"
|
||||
type="text"
|
||||
v-mask="dateMask"
|
||||
v-model="dateValue"
|
||||
@blur="onBlur"
|
||||
@input="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>
|
||||
<!--<b-collapse-->
|
||||
<!--position="is-bottom-right">-->
|
||||
<!--<span class="icon"-->
|
||||
<!--icon="calendar-today"-->
|
||||
<!--size="is-small"-->
|
||||
<!--slot="trigger" />-->
|
||||
<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"
|
||||
@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>
|
||||
<!--<b-collapse-->
|
||||
<!--position="is-bottom-right">-->
|
||||
<!--<span class="icon"-->
|
||||
<!--icon="calendar-today"-->
|
||||
<!--size="is-small"-->
|
||||
<!--slot="trigger" />-->
|
||||
|
||||
<!--<div class="field">-->
|
||||
<!--<b-datepicker-->
|
||||
<!--:class="{'has-content': dateValue !== undefined && dateValue !== ''}"-->
|
||||
<!--:id="id"-->
|
||||
<!--v-model="dateValue"-->
|
||||
<!--@blur="onBlur"-->
|
||||
<!--:readonly="false"-->
|
||||
<!--inline-->
|
||||
<!--@input="onInput($event)"-->
|
||||
<!--:placeholder="datePlaceHolder"/>-->
|
||||
<!--</div>-->
|
||||
<!--</b-collapse>-->
|
||||
</div>
|
||||
<!--<div class="field">-->
|
||||
<!--<b-datepicker-->
|
||||
<!--v-model="dateValue"-->
|
||||
<!--:readonly="false"-->
|
||||
<!--inline-->
|
||||
<!--@input="onInput($event)"-->
|
||||
<!--:placeholder="datePlaceHolder"/>-->
|
||||
<!--</div>-->
|
||||
<!--</b-collapse>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -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,
|
||||
},
|
||||
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;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onBlur() {
|
||||
this.$emit('blur');
|
||||
},
|
||||
onInput($event) {
|
||||
this.inputValue = $event;
|
||||
this.$emit('input', this.inputValue);
|
||||
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>
|
||||
|
||||
|
@ -22,17 +46,20 @@
|
|||
import qs from 'qs';
|
||||
|
||||
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;
|
||||
if ( this.metadatum.value && (Array.isArray( this.metadatum.value ) ? this.metadatum.value.length > 0 : true )){
|
||||
created() {
|
||||
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 => {
|
||||
|
@ -40,100 +67,78 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
data(){
|
||||
data() {
|
||||
return {
|
||||
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 = [];
|
||||
|
||||
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 ))
|
||||
.then( res => {
|
||||
this.loading = false;
|
||||
this.options = [];
|
||||
let result = res.data;
|
||||
this.isLoading = true;
|
||||
|
||||
if (result.items) {
|
||||
for (let item of result.items) {
|
||||
this.options.push({ label: this.getItemLabel(item), value: item.id })
|
||||
}
|
||||
axios.get('/collection/' + this.collectionId + '/items?' + this.getQueryString(query))
|
||||
.then( res => {
|
||||
this.isLoading = false;
|
||||
this.options = [];
|
||||
|
||||
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 &&
|
||||
if (this.metadatum.metadatum.metadata_type_options &&
|
||||
this.metadatum.metadatum.metadata_type_options.search)
|
||||
{
|
||||
query['metaquery'] = [];
|
||||
|
@ -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,8 +148,8 @@ class Relationship extends Metadata_Type {
|
|||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
// item not found
|
||||
} 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"
|
||||
:placeholder="$i18n.get('label_selectbox_init')"
|
||||
:value="value"
|
||||
:class="{'is-empty': value == undefined || value == ''}"
|
||||
@blur="$emit('blur')"
|
||||
@input="onChecked($event)">
|
||||
<option
|
||||
v-for="(option, index) in getOptions"
|
||||
:key="index"
|
||||
:label="option"
|
||||
:value="option"
|
||||
border>{{ option }}</option>
|
||||
</b-select>
|
||||
</div>
|
||||
<b-select
|
||||
expanded
|
||||
:disabled="disabled"
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:placeholder="$i18n.get('label_selectbox_init')"
|
||||
:value="value"
|
||||
@input="onSelected($event)">
|
||||
<option value="">{{ $i18n.get('label_selectbox_init') }}...</option>
|
||||
<option
|
||||
v-for="(option, index) in getOptions"
|
||||
:key="index"
|
||||
:label="option"
|
||||
:value="option">
|
||||
{{ option }}
|
||||
</option>
|
||||
</b-select>
|
||||
</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">
|
||||
<component
|
||||
:id="metadatum.metadatum.metadata_type_object.component + '-' + metadatum.metadatum.slug"
|
||||
:is="metadatum.metadatum.metadata_type_object.component"
|
||||
v-model="inputs[index]"
|
||||
:metadatum="metadatum"
|
||||
@input="emitIsChangingValue()"/>
|
||||
<template v-for="(input, index) of inputs">
|
||||
<component
|
||||
v-if="index > 0"
|
||||
:key="index"
|
||||
:is="metadatum.metadatum.metadata_type_object.component"
|
||||
v-model="inputs[index]"
|
||||
:metadatum="metadatum"
|
||||
@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');
|
||||
if (errors) {
|
||||
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();
|
||||
created() {
|
||||
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.metadatum.value instanceof Array){
|
||||
let eq = [];
|
||||
|
||||
for(let meta of terms){
|
||||
let found = this.metadatum.value.find((element) => {
|
||||
return meta == element.id;
|
||||
});
|
||||
|
||||
if(found){
|
||||
eq.push(found);
|
||||
}
|
||||
}
|
||||
|
||||
if(eq.length == terms.length && this.metadatum.value.length <= eq.length){
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if(this.metadatum.value.constructor.name == 'Object'){
|
||||
|
||||
if(this.metadatum.value.id == this.inputs){
|
||||
return;
|
||||
}
|
||||
} else if(this.metadatum.value instanceof Array){
|
||||
let eq = [];
|
||||
|
||||
for(let meta of this.inputs){
|
||||
let found = this.metadatum.value.find((element) => {
|
||||
return meta == element.id;
|
||||
});
|
||||
|
||||
if(found){
|
||||
eq.push(found);
|
||||
}
|
||||
}
|
||||
|
||||
if(eq.length == this.inputs.length && this.metadatum.value.length <= eq.length){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
this.inputs = this.metadatum.value.slice(0);
|
||||
if (this.inputs && this.inputs.length > 0 && this.inputs[0] && this.inputs[0].value) {
|
||||
let terms = this.inputs.map(term => term.value)
|
||||
|
||||
if (this.inputs.length === 0){
|
||||
this.inputs.push('');
|
||||
if (this.metadatum.value instanceof Array){
|
||||
let equal = [];
|
||||
|
||||
for (let meta of terms) {
|
||||
let foundIndex = this.metadatum.value.findIndex(element => meta == element.id);
|
||||
if (foundIndex >= 0)
|
||||
equal.push(this.metadatum.value[foundIndex]);
|
||||
}
|
||||
|
||||
if (equal.length == terms.length && this.metadatum.value.length <= equal.length)
|
||||
return;
|
||||
|
||||
}
|
||||
} else {
|
||||
this.metadatum.value == null || this.metadatum.value == undefined ? this.inputs.push('') : this.inputs.push(this.metadatum.value);
|
||||
} else if (this.metadatum.value.constructor.name == 'Object') {
|
||||
|
||||
if (this.metadatum.value.id == this.inputs)
|
||||
return;
|
||||
|
||||
} else if (this.metadatum.value instanceof Array) {
|
||||
|
||||
let equal = [];
|
||||
|
||||
for (let meta of this.inputs) {
|
||||
let foundIndex = this.metadatum.value.findIndex(element => meta == element.id);
|
||||
|
||||
if (foundIndex >= 0)
|
||||
equal.push(this.metadatum.value[foundIndex]);
|
||||
}
|
||||
|
||||
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 : ''
|
||||
});
|
||||
|
||||
}, 900),
|
||||
createInputs() {
|
||||
if (this.metadatum.value instanceof Array)
|
||||
this.inputs = this.metadatum.value.slice(0);
|
||||
else
|
||||
this.metadatum.value == null || this.metadatum.value == undefined ? this.inputs = [] : this.inputs.push(this.metadatum.value);
|
||||
},
|
||||
addInput(){
|
||||
this.inputs.push('');
|
||||
|
@ -213,12 +192,9 @@
|
|||
this.inputs.splice(index, 1);
|
||||
this.changeValue();
|
||||
},
|
||||
isTextInputComponent( component ){
|
||||
let array = ['tainacan-relationship','tainacan-taxonomy'];
|
||||
return !( array.indexOf( component ) >= 0 );
|
||||
},
|
||||
setMetadatumTypeMessage( message ){
|
||||
this.metadatumTypeMessage = message;
|
||||
isTextInputComponent(component) {
|
||||
const array = ['tainacan-relationship','tainacan-taxonomy'];
|
||||
return !(array.indexOf(component) >= 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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' : ''"
|
||||
|
@ -25,26 +25,12 @@
|
|||
:title="$i18n.get('label_name')"
|
||||
:message="$i18n.get('info_help_term_name')"/>
|
||||
</label>
|
||||
<b-input
|
||||
:class="{'has-content': name != undefined && name != ''}"
|
||||
<b-input
|
||||
: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,22 +71,22 @@
|
|||
</p>
|
||||
</transition>
|
||||
</b-field>
|
||||
|
||||
<button
|
||||
:class="{ 'is-loading': isAddingNewTerm }"
|
||||
class="button is-outlined"
|
||||
@click="toggleForm()"
|
||||
type="button">
|
||||
{{ $i18n.get('cancel') }}
|
||||
</button>
|
||||
|
||||
<button
|
||||
:class="{ 'is-loading': isAddingNewTerm }"
|
||||
class="button is-secondary"
|
||||
@click="save"
|
||||
type="button">
|
||||
{{ $i18n.get('save') }}
|
||||
</button>
|
||||
<div class="field is-grouped form-submit">
|
||||
<button
|
||||
:class="{ 'is-loading': isAddingNewTerm }"
|
||||
class="button is-outlined"
|
||||
@click="toggleForm()"
|
||||
type="button">
|
||||
{{ $i18n.get('cancel') }}
|
||||
</button>
|
||||
<button
|
||||
:class="{ 'is-loading': isAddingNewTerm }"
|
||||
class="button is-secondary"
|
||||
@click="save"
|
||||
type="button">
|
||||
{{ $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],
|
||||
value:[ Array, Boolean, Number ],
|
||||
options: {
|
||||
type: Array
|
||||
},
|
||||
taxonomyId: [Number,String],
|
||||
value: [ Array, Boolean, Number ],
|
||||
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,21 +155,21 @@
|
|||
this.clearErrors('parent');
|
||||
},
|
||||
onSelectParentTerm(selectedParentTerm) {
|
||||
this.parent = selectedParentTerm.id;
|
||||
this.selectedParentTerm = selectedParentTerm;
|
||||
this.parentTermName = selectedParentTerm.name;
|
||||
if (selectedParentTerm) {
|
||||
this.parent = selectedParentTerm.id;
|
||||
this.parentTermName = selectedParentTerm.name;
|
||||
}
|
||||
},
|
||||
clearErrors(attributes) {
|
||||
if(attributes instanceof Object){
|
||||
for(let attribute in attributes){
|
||||
if (attributes instanceof Object) {
|
||||
for(let attribute in attributes)
|
||||
this.formErrors[attribute] = undefined;
|
||||
}
|
||||
} else {
|
||||
this.formErrors[attributes] = undefined;
|
||||
}
|
||||
},
|
||||
save(){
|
||||
if( this.name.trim() === ''){
|
||||
save() {
|
||||
if (this.name.trim() === '') {
|
||||
this.$buefy.toast.open({
|
||||
duration: 2000,
|
||||
message: this.$i18n.get('info_name_is_required'),
|
||||
|
@ -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 => {
|
||||
.then(res => {
|
||||
|
||||
this.isAddingNewTerm = false;
|
||||
|
||||
if( res.data && res.data.id || res.id ){
|
||||
let id = ( res.id ) ? res.id : res.data.id;
|
||||
if (res.data && res.data.id || res.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}`, {
|
||||
if (!Array.isArray(val) && this.metadatum.metadatum.multiple === 'no') {
|
||||
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});
|
||||
}
|
||||
|
||||
getTermsId() {
|
||||
let values = [];
|
||||
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) {
|
||||
reload($event) {
|
||||
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>
|
|
@ -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_terms') + ':' }}
|
||||
</p>
|
||||
<b-field
|
||||
v-if="value instanceof Array ? value.length > 0 : (value != undefined && value != '')"
|
||||
|
@ -24,97 +24,187 @@
|
|||
v-if="isSelectedTermsLoading"
|
||||
class="control has-icons-right is-loading is-clearfix" />
|
||||
</b-field>
|
||||
|
||||
<div
|
||||
v-for="(option, index) in options"
|
||||
:key="index">
|
||||
<b-checkbox
|
||||
:disabled="disabled"
|
||||
:id="id"
|
||||
:style="{ paddingLeft: (option.level * 30) + 'px' }"
|
||||
:key="index"
|
||||
v-model="checked"
|
||||
@input="onChecked(option)"
|
||||
:native-value="option.id"
|
||||
border>
|
||||
{{ option.name }}
|
||||
</b-checkbox>
|
||||
<br>
|
||||
<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"
|
||||
:id="metadatum.metadata_type_object.component + '-' + metadatum.slug">
|
||||
<template v-for="(option, index) in options">
|
||||
<b-checkbox
|
||||
: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 :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)
|
||||
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(){
|
||||
data() {
|
||||
return {
|
||||
checked: [],
|
||||
selectedTagsName: {},
|
||||
isSelectedTermsLoading: false,
|
||||
options: [],
|
||||
terms: [],
|
||||
termsNumber: 12,
|
||||
offset: 0,
|
||||
totalTerms: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value( val ){
|
||||
value(val){
|
||||
this.checked = val;
|
||||
this.fetchSelectedLabels();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowingAllTerms() {
|
||||
return this.terms.length >= this.totalTerms;
|
||||
}
|
||||
},
|
||||
props: {
|
||||
options: {
|
||||
type: Array
|
||||
},
|
||||
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.taxonomyId) {
|
||||
this.isSelectedTermsLoading = true;
|
||||
|
||||
if(!this.isSelectedTermsLoading){
|
||||
this.isSelectedTermsLoading = true;
|
||||
}
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/?${qs.stringify({ hideempty: 0, include: selected })}`)
|
||||
.then((res) => {
|
||||
let terms = res.data;
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/${term}`)
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.name);
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.isSelectedTermsLoading = false;
|
||||
for (let term of terms) {
|
||||
if (!this.selectedTagsName[term.id])
|
||||
this.$set(this.selectedTagsName, term.id, term.name);
|
||||
}
|
||||
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
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() {
|
||||
|
@ -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,43 +24,79 @@
|
|||
v-if="isSelectedTermsLoading"
|
||||
class="control has-icons-right is-loading is-clearfix" />
|
||||
</b-field>
|
||||
<b-radio
|
||||
:disabled="disabled"
|
||||
:id="id"
|
||||
v-model="checked"
|
||||
@input="onChecked()"
|
||||
:native-value="''"
|
||||
border>
|
||||
{{ $i18n.get('clear_radio') }}
|
||||
</b-radio>
|
||||
<div
|
||||
v-for="(option, index) in options"
|
||||
:key="index">
|
||||
<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"
|
||||
:style="{ paddingLeft: (option.level * 30) + 'px' }"
|
||||
:key="index"
|
||||
:id="metadatum.metadata_type_object.component + '-' + metadatum.slug"
|
||||
v-model="checked"
|
||||
@input="onChecked(option)"
|
||||
:native-value="option.id"
|
||||
@input="onChecked('')"
|
||||
:native-value="''"
|
||||
border>
|
||||
{{ option.name }}
|
||||
{{ $i18n.get('clear_radio') }}
|
||||
</b-radio>
|
||||
<br>
|
||||
<template
|
||||
:id="metadatum.metadata_type_object.component + '-' + metadatum.slug"
|
||||
v-for="(option, index) in options">
|
||||
<b-radio
|
||||
:disabled="disabled"
|
||||
:style="{ marginLeft: 0, paddingLeft: (option.level * 30) + 'px' }"
|
||||
:key="index"
|
||||
v-model="checked"
|
||||
@input="onChecked(option)"
|
||||
:native-value="option.id"
|
||||
border>
|
||||
{{ option.name }}
|
||||
</b-radio>
|
||||
<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 {
|
||||
data(){
|
||||
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,60 +105,151 @@
|
|||
this.fetchSelectedLabels();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowingAllTerms() {
|
||||
return this.terms.length >= this.totalTerms;
|
||||
}
|
||||
},
|
||||
props: {
|
||||
options: {
|
||||
type: Array
|
||||
},
|
||||
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) {
|
||||
this.isSelectedTermsLoading = true;
|
||||
|
||||
if(!this.isSelectedTermsLoading){
|
||||
this.isSelectedTermsLoading = true;
|
||||
}
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/?${qs.stringify({ hideempty: 0, include: selected })}`)
|
||||
.then((res) => {
|
||||
let terms = res.data;
|
||||
|
||||
axios.get(`/taxonomy/${this.taxonomyId}/terms/${term}`)
|
||||
.then((res) => {
|
||||
this.saveSelectedTagName(res.data.id, res.data.name);
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
this.isSelectedTermsLoading = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.isSelectedTermsLoading = false;
|
||||
for (let term of terms) {
|
||||
if (!this.selectedTagsName[term.id])
|
||||
this.$set(this.selectedTagsName, term.id, term.name);
|
||||
}
|
||||
|
||||
this.isSelectedTermsLoading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.log(error);
|
||||
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>
|
||||
</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>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue