Merge and fix conflicts with develop.

This commit is contained in:
Mateus Machado Luna 2019-08-22 11:48:34 -03:00
commit 19443d7f6e
96 changed files with 2931 additions and 622 deletions

View File

@ -21,11 +21,15 @@ sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/gutenberg-blocks/tainacan
sass -E 'UTF-8' --cache-location .tmp/sass-cache-6 src/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list.scss:src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-7 src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-7 src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss:src/assets/css/tainacan-gutenberg-block-search-bar.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-8 src/gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-8 src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-9 src/gutenberg-blocks/tainacan-facets/facets-list/facets-list.scss:src/assets/css/tainacan-gutenberg-block-facets-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-9 src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-10 src/gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-11 src/gutenberg-blocks/tainacan-facets/facets-list/facets-list.scss:src/assets/css/tainacan-gutenberg-block-facets-list.css
echo "Compilação do Sass Concluído!"
exit 0

View File

@ -509,14 +509,16 @@
style="margin-left: calc(4.666667% + 12px)"
type="button"
class="button is-secondary"
@click.prevent="attachmentMediaFrame.openFrame($event)">
@click.prevent="attachmentMediaFrame.openFrame($event)"
:disabled="isLoadingAttachments">
{{ $i18n.get("label_edit_attachments") }}
</button>
<attachments-list
v-if="item != undefined && item.id != undefined"
:item="item"
:is-editable="true"
:is-loading.sync="isLoadingAttachments"
@isLoadingAttachments="(isLoading) => isLoadingAttachments = isLoading"
@onDeleteAttachment="deleteAttachment($event)"/>
</div>
</b-tab-item>
@ -753,6 +755,7 @@ export default {
collectionAllowComments: '',
entityName: 'item',
activeTab: 0,
isLoadingAttachments: false
}
},
computed: {
@ -927,8 +930,12 @@ export default {
this.form.document_type = this.item.document_type;
this.form.comment_status = this.item.comment_status;
// Loads metadata and attachments
this.loadMetadata();
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId });
this.isLoadingAttachments = true;
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId })
.then(() => this.isLoadingAttachments = false)
.catch(() => this.isLoadingAttachments = false);
})
.catch(error => this.$console.error(error));
@ -1030,7 +1037,10 @@ export default {
document_type: this.form.document_type
})
.then(() => {
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document });
this.isLoadingAttachments = true;
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document })
.then(() => this.isLoadingAttachments = false)
.catch(() => this.isLoadingAttachments = false);
})
.catch((errors) => {
for (let error of errors.errors) {
@ -1061,7 +1071,10 @@ export default {
onConfirm: () => {
this.removeAttachmentFromItem(attachment.id)
.then(() => {
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document });
this.isLoadingAttachments = true;
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document })
.then(() => this.isLoadingAttachments = false)
.catch(() => this.isLoadingAttachments = false);
})
.catch((error) => {
this.$console.error(error);
@ -1132,7 +1145,10 @@ export default {
relatedPostId: this.itemId,
onSave: () => {
// Fetch current existing attachments
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document });
this.isLoadingAttachments = true;
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document })
.then(() => this.isLoadingAttachments = false)
.catch(() => this.isLoadingAttachments = false);
}
}
);
@ -1410,8 +1426,13 @@ export default {
padding-left: 0;
padding-right: $page-side-padding;
.columns .column {
padding: 1rem $page-side-padding 0 24px;
.columns {
flex-wrap: wrap;
justify-content: space-between;
.column {
padding: 1rem 12px 0 12px;
}
}
.field {

View File

@ -495,7 +495,7 @@
}
}
</script>
<style>
<style scoped>
.tab-content {
overflow: visible !important;
}

View File

@ -485,7 +485,8 @@
margin-right: auto;
width: 100%;
top: 35%;
font-size: 1.25rem;
padding: 0 8px;
font-size: 95%;
font-weight: bold;
z-index: 99;
text-align: center;

View File

@ -1,6 +1,11 @@
<template>
<div>
<div class="table-container">
<div
style="position: relative;"
class="table-container">
<b-loading
is-full-page="false"
:active.sync="isLoading" />
<div
v-if="attachments.length > 0"
class="table-wrapper">
@ -99,14 +104,14 @@
},
data() {
return {
isLoading: false,
attachmentsPage: 1,
attachmentsPerPage: 24
}
},
props: {
item: Object,
isEditable: Boolean
isLoading: Boolean,
isEditable: Boolean,
},
computed: {
attachments() {
@ -148,6 +153,7 @@
},
loadAttachments() {
this.isLoading = true;
this.$emit('isLoadingAttachments', true);
this.fetchAttachments({
page: this.attachmentsPage,
@ -157,10 +163,12 @@
})
.then((response) => {
this.isLoading = false;
this.$emit('isLoadingAttachments', false);
this.totalAttachments = response.total;
})
.catch((error) => {
this.isLoading = false;
this.$emit('isLoadingAttachments', false);
this.$console.error(error);
})
},
@ -178,10 +186,11 @@
<style lang="scss" scoped>
.uploaded-files {
display: flex;
flex-flow: wrap;
display: block;
text-align: center;
.file-item-container {
display: inline-block;
margin: 15px;
position: relative;

View File

@ -220,9 +220,9 @@
<a
:href="collection.url"
target="_blank"
:aria-label="$i18n.get('label_view_collection')">
:aria-label="$i18n.get('label_view_collection_on_website')">
<b-tooltip
:label="$i18n.get('label_view_collection')"
:label="$i18n.get('label_view_collection_on_website')"
position="is-bottom">
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-see"/>

View File

@ -804,7 +804,7 @@
column.metadatum !== 'row_author' &&
column.metadatum !== 'row_title' &&
column.metadatum !== 'row_description'"
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column, column.metadata_type_object.component) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
<span v-if="column.metadatum == 'row_thumbnail'">
<img
@ -948,7 +948,9 @@ export default {
return this.getSelectedItems();
},
selectedItems () {
if (this.$route.query.iframemode)
this.$eventBusSearch.setSelectedItemsForIframe(this.getSelectedItems());
return this.getSelectedItems();
},
isSelectingItems () {
@ -1213,7 +1215,7 @@ export default {
if ($event.ctrlKey || $event.shiftKey) {
this.setSelectedItemChecked(item.id);
} else {
if (!this.$route.query.iframemode && this.$route.query.iframemode) {
if (this.$route.query.iframemode && !this.$route.query.readmode) {
this.setSelectedItemChecked(item.id)
} else if (!this.$route.query.iframemode && !this.$route.query.readmode) {
if(this.isOnTrash){
@ -1246,16 +1248,13 @@ export default {
goToItemEditPage(item) {
this.$router.push(this.$routerHelper.getItemEditPath(item.collection_id, item.id));
},
renderMetadata(itemMetadata, column, component) {
renderMetadata(itemMetadata, column) {
let metadata = (itemMetadata != undefined && itemMetadata[column.slug] != undefined) ? itemMetadata[column.slug] : false;
if (!metadata || itemMetadata == undefined) {
return '';
} else {
if ((component != undefined && component == 'tainacan-textarea') || this.$route.query.iframemode)
return this.viewMode == 'table' ? ('<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_string) : metadata.value_as_string;
else
return this.viewMode == 'table' ? ('<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_html) : metadata.value_as_html;
}
},

View File

@ -229,8 +229,8 @@ export default {
padding: 9px 15px;
line-height: 1.5em;
border-radius: 0px;
-webkit-transition: padding 0.2s linear; /* Safari */
transition: padding 0.2s linear;
-webkit-transition: padding 0.2s linear, background-color 0.3s ease; /* Safari */
transition: padding 0.2s linear, background-color 0.3s ease;
.icon {
height: auto;

View File

@ -211,12 +211,18 @@
.level-left {
margin-left: -12px;
.home-area {
font-size: 24px;
width: 50px;
height: $header-height;
background-color: $gray1;
padding-bottom: 0.4rem;
transition: background-color 0.2s ease;
&:hover {
background-color: $gray2;
}
}
.logo-area {
height: $header-height;

View File

@ -34,7 +34,7 @@
show: 500,
hide: 300,
},
content: $i18n.get('label_view_collection'),
content: $i18n.get('label_view_collection_on_website'),
autoHide: false,
placement: 'bottom-end',
classes: ['header-tooltips']
@ -48,7 +48,7 @@
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-see"/>
</span>
<!-- {{ $i18n.get('label_view_collection') }} -->
<!-- {{ $i18n.get('label_view_collection_on_website') }} -->
</a>
</li>
<li
@ -71,7 +71,7 @@
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-see"/>
</span>
<!-- {{ $i18n.get('label_view_collection') }} -->
<!-- {{ $i18n.get('label_view_collection_on_website') }} -->
</a>
</li>
</ul>

View File

@ -91,6 +91,7 @@
border-bottom: 1px solid $gray2;
padding: 15px 8.3333333%;
cursor: pointer;
transition: background-color 0.3s ease;
&:first-child {
margin-top: 15px;

View File

@ -94,6 +94,7 @@ export default {
border-bottom: 1px solid $gray2;
padding: 15px 8.3333333%;
cursor: pointer;
transition: background-color 0.3s ease;
&:first-child {
margin-top: 15px;

View File

@ -195,7 +195,6 @@
:value="getExposerFullURL(pagedLink, exposerMapper)">
</div>
<a
:download="(collectionId != undefined ? collectionName : $i18n.get('repository')) + ' ' + $i18n.get('items') + ' ' + $i18n.get('label_page') + ' ' + pagedLink"
v-tooltip="{
delay: {
show: 500,
@ -205,6 +204,7 @@
autoHide: false,
placement: 'bottom'
}"
target="_blank"
:href="getExposerFullURL(pagedLink, exposerMapper)">
<span class="icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-openurl"/>
@ -501,7 +501,7 @@ export default {
p {
font-size: 0.875rem;
color: $gray5;
padding: 0rem 1rem;
padding: 0rem 1.25rem;
margin-top: 0.75rem;
margin-bottom: 0;
}
@ -517,6 +517,7 @@ export default {
cursor: pointer;
max-width: 50%;
flex-grow: 1;
transition: border 0.3s ease;
h4 {
font-size: 1rem;
@ -529,6 +530,10 @@ export default {
padding: 0rem 0.5rem;
margin-bottom: 0;
}
&:hover {
border: 1px solid $gray3;
}
}
}
}

View File

@ -39,7 +39,7 @@
min="1"
:value="copyCount"
step="1"
@input.native="copyCount = $event.target.value"/>
@input="copyCount = $event"/>
</b-field>
</div>
</section>

View File

@ -50,7 +50,9 @@ import termsListBus from './terms-list-bus.js';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, UserCapabilitiesPlugin, StatusHelperPlugin } from './utilities';
// Configure and Register Plugins
Vue.use(Buefy);
Vue.use(Buefy, {
defaultTooltipAnimated: true
});
Vue.use(VTooltip);
Vue.use(VueMasonry);
Vue.use(I18NPlugin);

View File

@ -32,7 +32,9 @@ import eventBusSearch from '../../js/event-bus-search';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, StatusHelperPlugin } from './utilities';
// Configure and Register Plugins
Vue.use(Buefy);
Vue.use(Buefy, {
defaultTooltipAnimated: true
});
Vue.use(VTooltip);
Vue.use(VueMasonry);
Vue.use(I18NPlugin);

View File

@ -316,6 +316,7 @@ export default {
color: $turquoise5;
float: right;
width: calc(100% - 20px);
transition: background-color 0.3s ease;
@media screen and (min-width: 768px) {
width: calc(50% - 20px);
@ -354,6 +355,7 @@ export default {
min-width: 13%;
flex-basis: 13%;
max-width: 15%;
transition: background-color 0.3s ease;
@media screen and (max-width: 580px) {
max-width: calc(100% - 52px);

View File

@ -70,6 +70,11 @@
padding: 15px;
margin: 20px;
cursor: pointer;
transition: border 0.3s ease;
&:hover {
border: 1px solid $gray3;
}
}
}

View File

@ -73,6 +73,11 @@ export default {
max-width: 20%;
flex-grow: 1;
flex-basis: 20%;
transition: border 0.3s ease;
&:hover {
border: 1px solid $gray3;
}
}
}

View File

@ -565,7 +565,7 @@
:value="viewModeOption"
v-if="registeredViewModes[viewModeOption] != undefined && registeredViewModes[viewModeOption].full_screen == true ">
<span
class="gray-icon"
class="gray-icon view-mode-icon"
v-html="registeredViewModes[viewModeOption].icon"/>
<span class="is-hidden-touch">{{ registeredViewModes[viewModeOption].label }}</span>
</button>
@ -577,13 +577,13 @@
class="search-control-item">
<button
class="button is-white"
:aria-label="$i18n.get('label_urls')"
:aria-label="$i18n.get('label_view_as')"
:disabled="totalItems == undefined || totalItems <= 0"
@click="openExposersModal()">
<span class="gray-icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-url"/>
</span>
<span class="is-hidden-touch">{{ $i18n.get('label_urls') }}</span>
<span class="is-hidden-touch">{{ $i18n.get('label_view_as') }}</span>
</button>
</div>
@ -1864,8 +1864,9 @@
.view-mode-icon {
margin-right: 3px !important;
margin-top: 1px;
margin-top: -4px;
margin-left: 6px !important;
width: 1.25rem;
}
.dropdown-menu {

View File

@ -542,7 +542,7 @@
:value="viewModeOption"
v-if="registeredViewModes[viewModeOption] != undefined && registeredViewModes[viewModeOption].full_screen == true ">
<span
class="gray-icon"
class="gray-icon view-mode-icon"
v-html="registeredViewModes[viewModeOption].icon"/>
<span class="is-hidden-touch">{{ registeredViewModes[viewModeOption].label }}</span>
</button>
@ -554,13 +554,13 @@
class="search-control-item">
<button
class="button is-white"
:aria-label="$i18n.get('label_urls')"
:aria-label="$i18n.get('label_view_as')"
:disabled="totalItems == undefined || totalItems <= 0"
@click="openExposersModal()">
<span class="gray-icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-url"/>
</span>
<span class="is-hidden-touch">{{ $i18n.get('label_urls') }}</span>
<span class="is-hidden-touch">{{ $i18n.get('label_view_as') }}</span>
</button>
</div>
@ -1797,8 +1797,9 @@
.view-mode-icon {
margin-right: 3px !important;
margin-top: 1px;
margin-top: -4px;
margin-left: 6px !important;
width: 1.25rem;
}
.dropdown-menu {

View File

@ -253,7 +253,9 @@
<span>{{ $i18n.get('activities') }}</span>
</template>
<activities-page />
<activities-page
:is-loading.sync="isLoadingAttachments"
@isLoadingAttachments="(isLoading) => isLoadingAttachments = isLoading"/>
</b-tab-item>
</b-tabs>
</div>
@ -281,13 +283,13 @@
</router-link>
<button
class="button sequence-button"
:aria-label="$i18n.get('label_urls')"
:aria-label="$i18n.get('label_view_as')"
:disabled="isLoading"
@click="openExposersModal()">
<span class="icon is-large">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-url"/>
</span>
<span class="is-hidden-touch">{{ $i18n.get('label_urls') }}</span>
<span class="is-hidden-touch">{{ $i18n.get('label_view_as') }}</span>
</button>
<a
target="_blank"
@ -334,6 +336,7 @@
urls_open: false,
collectionAllowComments: '',
activeTab: 0,
isLoadingAttachments: false
}
},
computed: {
@ -498,10 +501,14 @@
padding-left: 0;
padding-right: $page-side-padding;
.columns .column {
padding: 1rem $page-side-padding 0 24px;
}
.columns {
flex-wrap: wrap;
justify-content: space-between;
.column {
padding: 1rem 12px 0 12px;
}
}
.field {
padding: 10px 0 14px 0px;
margin-left: -3px;
@ -538,15 +545,6 @@
}
}
@media screen and (min-width: 1367px){
column-count: 2;
column-gap: $page-side-padding;
.field {
break-inside: avoid;
}
}
}
.section-label {

View File

@ -91,6 +91,7 @@
display: flex;
justify-content: space-between;
flex-wrap: nowrap;
transition: background-color 0.3s ease;
li {
text-align: center;
@ -100,6 +101,7 @@
padding: 0.5em 0.5em;
border-radius: 0;
transition: none;
transition: background-color 0.3s ease;
}
}
}

View File

@ -41,6 +41,7 @@
padding: 0.375rem 1rem;
font-size: 0.8125rem;
color: $tainacan-input-color !important;
transition: background-color 0.3s ease;
label { margin-bottom: 0; }
&.control { font-size: 0.8125rem !important; }

View File

@ -1,7 +1,7 @@
.pagination-area {
display: flex;
justify-content: space-between;
align-items: center;
align-items: baseline;
font-size: 0.85em !important;
font-weight: normal !important;
border-top: 1px solid $gray3;
@ -9,6 +9,7 @@
padding-bottom: 0;
margin-left: $page-side-padding;
margin-right: $page-side-padding;
margin-bottom: 12px;
padding-left: 0.75rem;
padding-right: 0.75rem;
color: $gray4;
@ -33,7 +34,7 @@
.items-per-page {
flex-grow: 1;
margin-top: 0.35em;
margin-top: 0.5rem;
@media screen and (max-width: 768px) {
flex-grow: 2;
@ -41,29 +42,39 @@
.field {
display: inline-flex;
align-items: baseline;
align-items: center;
}
}
.field-label {
flex-grow: 5;
margin-right: 0.5em;
padding-top: 0.3rem;
.label {
font-size: 0.85rem !important;
font-weight: normal !important;
margin-bottom: 0;
color: $gray4;
}
}
.select {
select {
font-size: 0.85rem;
border: none !important;
}
}
}
.pagination {
// flex-grow: 1;
&.is-small {
top: -3px;
position: relative;
border: none;
}
ul {
margin-bottom: 0px;
padding: 0px;
@ -76,10 +87,14 @@
a[disabled="disabled"] {
color: $gray4;
}
.pagination-list {
flex-wrap: nowrap;
}
.pagination-link, .pagination-previous, .pagination-next {
background-color: transparent;
color: $secondary;
border: none;
align-items: inherit;
}
.pagination-link:active {
box-shadow: none;
@ -114,6 +129,7 @@
}
@media screen and (max-width: 768px) {
&.is-small { top: 0px; }
.pagination-list { order: 2; }
.pagination-next { order: 3; }
}

View File

@ -1,5 +1,10 @@
.select {
padding-top: 0px !important;
&,
&:not(.is-multiple) {
height: 30px;
}
select {
border: none;
border-radius: 1px !important;
@ -31,6 +36,7 @@
color: $secondary !important;
display: flex !important;
align-items: initial;
margin-top: -10px !important;
}
&.is-loading.is-small::after {
font-size: 0.875rem;

View File

@ -66,6 +66,7 @@
height: 100%;
display: flex;
justify-content: center;
transition: background-color 0.15s ease;
}
.b-checkbox.checkbox .control-label {
display: none;
@ -161,11 +162,13 @@
tr {
cursor: pointer;
background-color: transparent;
transition: background-color 0.15s ease;
&.selected-row {
background-color: $turquoise1;
.checkbox-cell .checkbox, .actions-cell .actions-container {
background-color: $turquoise2;
.checkbox-cell .checkbox,
.actions-cell .actions-container {
transition: background-color 0.15s ease;
}
}
td {
@ -193,7 +196,7 @@
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-height: 1.25rem;
max-height: 1.125rem;
}
a:hover {
text-decoration: none !important;
@ -224,6 +227,7 @@
float: right;
justify-content: center;
align-items: center;
transition: background-color 0.15s ease;
}
a {

View File

@ -30,6 +30,7 @@
max-height: 210px;
cursor: pointer;
text-decoration: none !important;
transition: background-color 0.2s ease;
@media screen and (max-width: 480px) {
max-width: 100%;
@ -63,18 +64,28 @@
.actions-area {
position: relative;
float: right;
top: -7px;
top: -25px;
padding-right: 12px;
//width: 80px;
display: flex;
justify-content: space-between;
visibility: hidden;
opacity: 0;
transition: visibility 0.2s, opacity 0.2s;
transition: visibility 0.2s ease, opacity 0.3s ease, top 0.2s ease;
a {
opacity: 0;
margin-left: 12px;
transition: opacity 0.3s ease;
}
}
&:hover .actions-area {
visibility: visible;
opacity: 1.0;
top: -7px;
a {
opacity: 1;
}
}
.card-line {
@ -108,14 +119,16 @@
}
.metadata-title {
flex-shrink: 0;
padding: 0.6rem 4.75rem 0.5rem 2.75rem;
margin-bottom: -25px;
padding: 0.6rem 5rem 0.5rem 2.75rem;
margin-bottom: -26px;
min-height: 40px;
font-size: 0.875rem !important;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: black !important;
transition: background-color 0.3s ease;
p {
color: black !important;
font-size: 0.875rem !important;

View File

@ -20,6 +20,7 @@
flex-basis: 0;
margin: 15px;
text-align: center;
transition: background-color 0.2s ease;
&:hover {
background-color: $gray2;
@ -34,24 +35,33 @@
position: relative;
float: right;
width: 100%;
height: 30px;
height: 0px;
display: flex;
justify-content: flex-end;
visibility: hidden;
overflow: hidden;
opacity: 0;
padding: 3px 8px;
transition: visibility 0.2s, opacity 0.2s;
margin-top: -29px;
margin-top: 0px;
background-color: $gray2;
transition: visibility 0.2s ease, opacity 0.2s ease, height 0.2s ease, margin-top 0.2s ease;
a {
margin-left: 12px;
opacity: 0;
transition: opacity 0.3s ease-in;
}
}
&:hover .actions-area {
visibility: visible;
opacity: 1.0;
height: 32px;
margin-top: -30px;
background-color: $gray2 !important;
a {
opacity: 1;
}
}
.grid-item-thumbnail {
@ -96,7 +106,7 @@
white-space: nowrap;
overflow: hidden;
text-align: left;
color: #454647;
color: black;
}
}

View File

@ -20,7 +20,7 @@
margin-bottom: 25px;
text-align: center;
text-decoration: none;
transition: background-color 0.3s;
transition: background-color 0.2s ease;
&:hover {
background-color: $gray2;
@ -35,22 +35,34 @@
position: relative;
float: right;
width: 100%;
height: 0px;
display: flex;
justify-content: flex-end;
visibility: hidden;
overflow: hidden;
opacity: 0;
padding: 2px 8px;
transition: visibility 0.2s, opacity 0.2s;
margin-top: -29px;
margin-top: 0px;
background-color: $gray2;
transition: visibility 0.2s ease, opacity 0.2s ease, height 0.2s ease, margin-top 0.2s ease;
a {
margin-left: 12px;
opacity: 0;
transition: opacity 0.3s ease-in;
}
}
&:hover .actions-area {
visibility: visible;
opacity: 1.0;
height: 32px;
margin-top: -30px;
background-color: $gray2 !important;
a {
opacity: 1;
}
}
&.selected-grid-item {
.actions-area {

View File

@ -30,6 +30,7 @@
cursor: pointer;
text-decoration: none;
display: block;
transition: background-color 0.2s ease;
&:hover {
background-color: $gray1 !important;
@ -43,22 +44,29 @@
.actions-area {
position: relative;
float: right;
top: -7px;
top: -25px;
padding-right: 12px;
//width: 80px;
display: flex;
justify-content: space-between;
visibility: hidden;
opacity: 0;
transition: visibility 0.2s, opacity 0.2s;
transition: visibility 0.2s, opacity 0.3s ease, top 0.2s ease;
a {
margin-left: 12px;
opacity: 0;
transition: opacity 0.3s ease;
}
}
&:hover .actions-area {
visibility: visible;
opacity: 1.0;
top: -7px;
a {
opacity: 1;
}
}
.record-line {
@ -93,6 +101,7 @@
white-space: nowrap;
overflow: hidden;
color: black;
transition: background-color 0.3s ease;
p {
line-height: 1.7;
@ -113,6 +122,7 @@
.media {
width: 100%;
display: flex;
transition: background-color 0.2s ease;
.list-metadata {
padding: 25px;

View File

@ -323,7 +323,7 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_max_options_to_show' => __( 'Max options to show', 'tainacan' ),
'label_unamed_process' => __( 'Unamed process', 'tainacan' ),
'label_semantic_uri' => __( 'Semantic Uri', 'tainacan' ),
'label_view_collection' => __( 'View collection', 'tainacan' ),
'label_view_collection_on_website' => __( 'View collection on website', 'tainacan' ),
'label_view_more' => __( 'View more', 'tainacan' ),
'label_log_file' => __( 'Log file', 'tainacan' ),
'label_error_log_file' => __( 'Error Log file', 'tainacan' ),
@ -430,6 +430,7 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_expose_only_displayed_metadata' => __( 'Expose only displayed metadata', 'tainacan' ),
'label_allowed' => __( 'Allowed', 'tainacan' ),
'label_not_allowed' => __( 'Not allowed', 'tainacan' ),
'label_view_as' => __( 'View as...', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),
@ -497,8 +498,8 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_taxonomies_tab_trash' => __( 'Taxonomies that were sent to trash.', 'tainacan' ),
'info_error_invalid_date' => __( 'Invalid date', 'tainacan' ),
'info_search_results' => __( 'Search Results', 'tainacan' ),
'info_search_criteria' => __( 'Search Criteria', 'tainacan' ),
'info_search_results' => __( 'Advanced Search Results', 'tainacan' ),
'info_search_criteria' => __( 'Advanced Search Criteria', 'tainacan' ),
'info_name_is_required' => __( 'Name is required.', 'tainacan' ),
'info_no_collection_created' => __( 'No collection was created in this repository.', 'tainacan' ),

View File

@ -182,8 +182,9 @@ export default {
}
.view-mode-icon {
margin-right: 0px !important;
margin-top: 1px;
margin-top: -4px;
margin-left: 4px;
width: 1.25rem;
&.icon i::before, .gray-icon i::before {
font-size: 1.1875px !important;

View File

@ -400,7 +400,7 @@ class REST_Filters_Controller extends REST_Controller {
*/
public function get_items_permissions_check( $request ) {
if(!isset($request['collection_id'])) {
if ( 'edit' === $request['context'] && ! $this->filter_repository->can_read( new Entities\Filter() ) ) {
if ( 'edit' === $request['context'] && ! $this->filter_repository->can_edit( new Entities\Filter() ) ) {
return false;
}

View File

@ -378,6 +378,8 @@ class REST_Metadata_Controller extends REST_Controller {
* @throws \Exception
*/
public function get_items_permissions_check( $request ) {
if(!isset($request['collection_id'])) {
if ( 'edit' === $request['context'] && ! $this->metadatum_repository->can_edit( new Entities\Metadatum() ) ) {
return false;
}
@ -385,6 +387,19 @@ class REST_Metadata_Controller extends REST_Controller {
return true;
}
$collection = $this->collection_repository->fetch($request['collection_id']);
if($collection instanceof Entities\Collection){
if ( 'edit' === $request['context'] && ! $collection->can_read() ) {
return false;
}
return true;
}
return false;
}
/**
* @param \WP_REST_Request $request
*

View File

@ -64,19 +64,33 @@
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .components-modal__header .components-icon-button {
padding-right: 0; }
.wp-block-tainacan-modal hr {
margin: 5px 0.75rem; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px; }
margin-bottom: 14px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
.wp-block-tainacan-modal .modal-search-area .components-base-control:nth-child(2) {
flex-shrink: 2; }
.wp-block-tainacan-modal .modal-search-area .components-base-control .components-base-control__field {
flex-wrap: wrap; }
.wp-block-tainacan-modal .modal-search-area .components-base-control label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center; }
.wp-block-tainacan-modal .modal-search-area .components-base-control input.components-text-control__input {
padding: 5px 8px;
height: 28px; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
font-weight: 500;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
@ -89,7 +103,8 @@
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto; }
overflow-y: auto;
overflow-x: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }

File diff suppressed because one or more lines are too long

View File

@ -64,19 +64,33 @@
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .components-modal__header .components-icon-button {
padding-right: 0; }
.wp-block-tainacan-modal hr {
margin: 5px 0.75rem; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px; }
margin-bottom: 14px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
.wp-block-tainacan-modal .modal-search-area .components-base-control:nth-child(2) {
flex-shrink: 2; }
.wp-block-tainacan-modal .modal-search-area .components-base-control .components-base-control__field {
flex-wrap: wrap; }
.wp-block-tainacan-modal .modal-search-area .components-base-control label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center; }
.wp-block-tainacan-modal .modal-search-area .components-base-control input.components-text-control__input {
padding: 5px 8px;
height: 28px; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
font-weight: 500;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
@ -89,7 +103,8 @@
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto; }
overflow-y: auto;
overflow-x: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }
@ -237,23 +252,26 @@
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none; }
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list li.collection-list-item,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list li.collection-list-item {
position: relative;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%; }
min-width: calc(20% - 24px);
width: calc(20% - 24px); }
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list li.collection-list-item a,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list li.collection-list-item a {
color: #454647;
height: auto;
display: flex;
align-items: center;
height: 54px; }
word-break: break-all;
word-break: break-word; }
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list li.collection-list-item img,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list li.collection-list-item img {
height: auto;
@ -271,17 +289,22 @@
@media only screen and (max-width: 1600px) {
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list li.collection-list-item,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list li.collection-list-item {
min-width: 30%;
width: 30%; } }
min-width: calc(25% - 24px);
width: calc(25% - 24px); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list li.collection-list-item,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list li.collection-list-item {
min-width: 45%;
width: 45%; } }
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list li.collection-list-item,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list li.collection-list-item {
min-width: 100%;
width: 100%; } }
min-width: calc(50% - 24px);
width: calc(50% - 24px); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-collections-list ul.collections-list.collections-layout-list li.collection-list-item,
.wp-block-tainacan-collections-list ul.collections-list-edit.collections-layout-list li.collection-list-item {
min-width: calc(100% - 24px);
width: calc(100% - 24px); } }
/*# sourceMappingURL=tainacan-gutenberg-block-collections-list.css.map */

File diff suppressed because one or more lines are too long

View File

@ -64,19 +64,33 @@
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .components-modal__header .components-icon-button {
padding-right: 0; }
.wp-block-tainacan-modal hr {
margin: 5px 0.75rem; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px; }
margin-bottom: 14px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
.wp-block-tainacan-modal .modal-search-area .components-base-control:nth-child(2) {
flex-shrink: 2; }
.wp-block-tainacan-modal .modal-search-area .components-base-control .components-base-control__field {
flex-wrap: wrap; }
.wp-block-tainacan-modal .modal-search-area .components-base-control label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center; }
.wp-block-tainacan-modal .modal-search-area .components-base-control input.components-text-control__input {
padding: 5px 8px;
height: 28px; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
font-weight: 500;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
@ -89,7 +103,8 @@
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto; }
overflow-y: auto;
overflow-x: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }
@ -412,23 +427,26 @@
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none; }
.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;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%; }
min-width: calc(20% - 24px);
width: calc(20% - 24px); }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item a,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item a {
color: #454647;
height: auto;
display: flex;
align-items: center;
height: 54px; }
word-break: break-all;
word-break: break-word; }
.wp-block-tainacan-dynamic-items-list ul.items-list.items-layout-list li.item-list-item img,
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item img {
height: auto;
@ -443,5 +461,25 @@
.wp-block-tainacan-dynamic-items-list ul.items-list-edit.items-layout-list li.item-list-item:hover a {
color: #454647;
text-decoration: none; }
@media only screen and (max-width: 1600px) {
.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 {
min-width: calc(25% - 24px);
width: calc(25% - 24px); } }
@media only screen and (max-width: 1024px) {
.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 {
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px); } }
@media only screen and (max-width: 768px) {
.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 {
min-width: calc(50% - 24px);
width: calc(50% - 24px); } }
@media only screen and (max-width: 498px) {
.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 {
min-width: calc(100% - 24px);
width: calc(100% - 24px); } }
/*# sourceMappingURL=tainacan-gutenberg-block-dynamic-items-list.css.map */

File diff suppressed because one or more lines are too long

View File

@ -64,19 +64,33 @@
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .components-modal__header .components-icon-button {
padding-right: 0; }
.wp-block-tainacan-modal hr {
margin: 5px 0.75rem; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px; }
margin-bottom: 14px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
.wp-block-tainacan-modal .modal-search-area .components-base-control:nth-child(2) {
flex-shrink: 2; }
.wp-block-tainacan-modal .modal-search-area .components-base-control .components-base-control__field {
flex-wrap: wrap; }
.wp-block-tainacan-modal .modal-search-area .components-base-control label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center; }
.wp-block-tainacan-modal .modal-search-area .components-base-control input.components-text-control__input {
padding: 5px 8px;
height: 28px; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
font-weight: 500;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
@ -89,7 +103,8 @@
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto; }
overflow-y: auto;
overflow-x: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }
@ -398,22 +413,26 @@
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
position: relative;
display: inline-block;
margin: 12px;
min-height: 24px;
min-width: 22%;
width: 22%; }
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: calc(20% - 24px);
width: calc(20% - 24px); }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item a {
color: #454647;
height: auto;
display: flex;
align-items: center;
height: 54px; }
word-break: break-all;
word-break: break-word; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item img {
height: auto;
@ -432,11 +451,32 @@
display: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item span.facet-item-count,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item span.facet-item-count {
color: #cbcbcb; }
color: #cbcbcb;
word-break: break-all; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item:hover a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item:hover a {
color: #454647;
text-decoration: none; }
@media only screen and (max-width: 1600px) {
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
min-width: calc(25% - 24px);
width: calc(25% - 24px); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
min-width: calc(50% - 24px);
width: calc(50% - 24px); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
min-width: calc(100% - 24px);
width: calc(100% - 24px); } }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud {
padding: 0;

File diff suppressed because one or more lines are too long

View File

@ -64,19 +64,33 @@
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .components-modal__header .components-icon-button {
padding-right: 0; }
.wp-block-tainacan-modal hr {
margin: 5px 0.75rem; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px; }
margin-bottom: 14px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
.wp-block-tainacan-modal .modal-search-area .components-base-control:nth-child(2) {
flex-shrink: 2; }
.wp-block-tainacan-modal .modal-search-area .components-base-control .components-base-control__field {
flex-wrap: wrap; }
.wp-block-tainacan-modal .modal-search-area .components-base-control label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center; }
.wp-block-tainacan-modal .modal-search-area .components-base-control input.components-text-control__input {
padding: 5px 8px;
height: 28px; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
font-weight: 500;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
@ -89,7 +103,8 @@
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto; }
overflow-y: auto;
overflow-x: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }
@ -181,6 +196,9 @@
color: #454647;
font-weight: bold;
line-height: normal; }
.wp-block-tainacan-items-list ul.items-list.items-layout-grid li.item-list-item a span,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-grid li.item-list-item a span {
line-height: normal; }
.wp-block-tainacan-items-list ul.items-list.items-layout-grid li.item-list-item img,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-grid li.item-list-item img {
height: auto;
@ -237,23 +255,26 @@
.wp-block-tainacan-items-list ul.items-list.items-layout-list,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none; }
.wp-block-tainacan-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item {
position: relative;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%; }
min-width: calc(20% - 24px);
width: calc(20% - 24px); }
.wp-block-tainacan-items-list ul.items-list.items-layout-list li.item-list-item a,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item a {
color: #454647;
height: auto;
display: flex;
align-items: center;
height: 54px; }
word-break: break-all;
word-break: break-word; }
.wp-block-tainacan-items-list ul.items-list.items-layout-list li.item-list-item img,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item img {
height: auto;
@ -268,5 +289,25 @@
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item:hover a {
color: #454647;
text-decoration: none; }
@media only screen and (max-width: 1600px) {
.wp-block-tainacan-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(25% - 24px);
width: calc(25% - 24px); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(50% - 24px);
width: calc(50% - 24px); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-items-list ul.items-list.items-layout-list li.item-list-item,
.wp-block-tainacan-items-list ul.items-list-edit.items-layout-list li.item-list-item {
min-width: calc(100% - 24px);
width: calc(100% - 24px); } }
/*# sourceMappingURL=tainacan-gutenberg-block-items-list.css.map */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,414 @@
[data-align='full'] .block-control {
width: calc(100% + 14px); }
.block-control {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px;
position: relative;
top: -14px;
left: -14px;
width: calc(100% + 28px);
background: #f2f2f2; }
.block-control p {
font-size: 0.875rem !important;
margin: 12px 1.5rem 16px 0;
fill: #555758; }
.block-control p svg {
top: 4px;
margin-right: 0.75rem;
position: relative;
fill: #555758; }
.components-placeholder__fieldset p {
font-size: 0.875rem !important;
margin-top: -2px;
fill: #555758; }
.components-placeholder__fieldset p svg {
margin-right: 1rem;
top: 4px;
position: relative;
fill: #555758; }
.wp-block-tainacan-modal {
width: 50%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal {
width: 75%; } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-modal {
width: 100%; } }
.wp-block-tainacan-modal.dynamic-modal {
width: 90%;
height: 90%;
width: 80vw;
height: 80vh; }
.wp-block-tainacan-modal.dynamic-modal iframe {
width: calc(100% + 32px);
height: calc(100% - 128px);
margin-left: -16px; }
.wp-block-tainacan-modal.dynamic-modal .modal-footer-area {
height: 68px;
width: calc(100% + 32px);
margin-left: -16px !important;
padding: 1.2rem 1.2rem !important;
border-top: 1px solid #cbcbcb; }
.wp-block-tainacan-modal .spinner-container {
min-height: 56px;
padding: 1rem;
display: flex;
justify-content: center;
align-items: center;
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .components-modal__header .components-icon-button {
padding-right: 0; }
.wp-block-tainacan-modal hr {
margin: 5px 0.75rem; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 14px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control:nth-child(2) {
flex-shrink: 2; }
.wp-block-tainacan-modal .modal-search-area .components-base-control .components-base-control__field {
flex-wrap: wrap; }
.wp-block-tainacan-modal .modal-search-area .components-base-control label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center; }
.wp-block-tainacan-modal .modal-search-area .components-base-control input.components-text-control__input {
padding: 5px 8px;
height: 28px; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: 500;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0;
display: -ms-grid;
display: grid;
grid-template-columns: repeat(auto-fill, 250px);
grid-gap: 0px;
justify-content: space-evenly;
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto;
overflow-x: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option {
display: flex;
justify-content: flex-start; }
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item img,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option img,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item img,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option img {
width: 24px;
height: 24px;
margin-right: 10px; }
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option label {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inline-block;
max-width: 85%; }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option label {
max-width: 80%; } }
.wp-block-tainacan-modal .modal-loadmore-section {
display: flex;
align-items: baseline;
justify-content: center; }
.wp-block-tainacan-modal .modal-loadmore-section p {
color: #555758;
margin-right: 12px;
margin-top: 2px; }
.wp-block-tainacan-modal .modal-footer-area {
border-top: 1px solid #e2e4e7;
display: flex;
align-items: baseline;
justify-content: space-between;
padding: 16px 16px 0 16px;
margin: 0 -16px; }
.wp-block-tainacan-modal .modal-footer-area p {
padding: 0 12px;
color: #454647; }
.edit-post-sidebar div.components-toolbar {
border: none;
justify-content: center; }
.wp-block-tainacan-search-bar {
margin: 2rem 0px; }
.wp-block-tainacan-search-bar .tainacan-search-container {
width: 100%; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block {
height: 32px;
max-width: 100%;
display: flex;
justify-content: center;
align-items: stretch;
margin: 0 auto;
border: 1px solid #dbdbdb;
transition: border-color ease 0.3s; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block.is-aligned-left {
margin-left: 0;
justify-content: flex-start; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block.is-aligned-right {
margin-right: 0;
justify-content: flex-end; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block:hover, .wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block:focus, .wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block:active {
border: 1px solid #545758; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input {
width: 100%;
min-width: 28px;
margin: 0;
border: none;
padding: 4px 0.75rem;
text-overflow: ellipsis; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block button {
height: auto;
display: flex;
align-items: center;
border: none;
box-shadow: none;
border-radius: 0;
background: white;
padding: 4px 1rem;
font-size: 1rem; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block button .icon {
height: 28px; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block button .icon svg {
fill: #298596; }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block {
margin-left: 0px;
margin-right: 0px;
max-width: 100% !important; }
.wp-block-tainacan-search-bar .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input {
width: 100% !important; } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-search-bar .search-bar-collection-header-container {
flex-wrap: wrap !important; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title {
text-align: center !important; } }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block {
width: 100%;
display: flex;
flex-direction: row-reverse;
border: none; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block.is-aligned-left {
margin-left: 0;
justify-content: flex-end; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block.is-aligned-right {
margin-right: 0;
justify-content: flex-start; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block:focus, .wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block:active, .wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block:hover {
border: none; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block input#taincan-search-bar-block_input {
width: 35%;
border-radius: 0;
margin-left: -52px;
padding-left: 52px;
border: 1px solid transparent;
background: rgba(250, 250, 250, 0.2);
transition: border-color 0.4s ease, width 0.5s ease-in, background-color 0.3s ease, color 0.3s ease; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block input#taincan-search-bar-block_input:hover {
width: 100%;
border-color: #cbcbcb;
background: #fafafa;
box-shadow: none; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block button {
margin-right: 0.75rem;
padding: 0 0.35rem;
min-height: 28px;
z-index: 2;
border: none;
background: transparent;
cursor: pointer; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block button .icon svg {
fill: #cbcbcb;
transition: fill 0.4s ease; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block button:hover {
background: transparent; }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block {
margin-left: 0px;
margin-right: 0px;
max-width: 100% !important; }
.wp-block-tainacan-search-bar.is-style-alternate #taincan-search-bar-block input#taincan-search-bar-block_input {
width: 100% !important; } }
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:focus input,
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:focus input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:active input,
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:active input::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:hover input,
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:hover input::placeholder {
color: #454647;
border-width: 0; }
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:focus button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:active button .icon svg, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block:hover button .icon svg {
fill: #cbcbcb !important; }
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input {
color: white; }
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input::placeholder {
color: white; }
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input:hover, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input:focus::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input:active::placeholder, .wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input:hover::placeholder {
color: #454647; }
.wp-block-tainacan-search-bar.is-style-alternate .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block button .icon svg {
fill: #dbdbdb !important; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block {
width: 100%;
height: 53px;
display: flex;
flex-direction: row;
border: none; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block:focus, .wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block:active, .wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block:hover {
border: none; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block:hover input#taincan-search-bar-block_input {
width: 100%;
padding-right: 52px;
padding-left: 24px;
border-width: 0; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block input#taincan-search-bar-block_input {
width: 0%;
min-width: 0%;
border-radius: 28px;
margin-right: -56px;
padding-right: 27px;
padding-left: 26px;
font-size: 1rem;
border-width: 0;
background: #f2f2f2;
transition: width 0.5s ease-in; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block input#taincan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block input#taincan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block input#taincan-search-bar-block_input:hover {
width: 100%;
padding-right: 52px;
padding-left: 24px;
border-width: 0; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block button {
margin-left: 0.75rem;
padding: 0 0.35rem;
min-height: 28px;
z-index: 2;
border: none;
background: transparent;
cursor: pointer; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block button .icon svg {
fill: black;
transition: fill 0.4s ease; }
.wp-block-tainacan-search-bar.is-style-stylish #taincan-search-bar-block button:hover {
background: transparent; }
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .tainacan-search-container {
width: calc(100% - 4.1667% - 53px);
width: calc(100% - 4.1667vw - 53px);
bottom: calc(-50% + 38px);
position: absolute; }
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .search-bar-collection-header-title {
margin-bottom: 26px; }
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-right .tainacan-search-container {
width: calc(100% - 4.1667% - 26px);
width: calc(100% - 4.1667vw - 26px);
top: calc(-50% + 26px);
right: calc(4.1667% + 26px);
right: calc(4.1667vw + 26px);
position: absolute; }
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-left .tainacan-search-container {
width: calc(100% - 1rem - 26px);
top: calc(-50% + 26px);
left: calc(4.1667% + 26px);
left: calc(4.1667vw + 26px);
position: absolute; }
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input {
background: white;
border-width: 3px;
border-style: solid;
margin-right: -56px;
padding-right: 24px;
padding-left: 24px; }
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input:hover {
border-width: 3px !important; }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container {
width: calc(100% - 4.1667% - 53px) !important;
width: calc(100% - 4.1667vw - 53px) !important;
bottom: calc(-50% + 38px) !important;
position: absolute !important; }
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-right .search-bar-collection-header-title, .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-left .search-bar-collection-header-title {
margin-bottom: 0px !important; } }
.wp-block-tainacan-search-bar .search-bar-collection-header-image {
width: 100%;
min-width: 160px;
min-height: 125px;
background-size: cover;
background-position: center;
background-color: #dbdbdb; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container {
width: 100%;
min-height: 125px;
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
flex-grow: 2;
padding: 0.5rem 4.1667%;
padding: 0.5rem 4.1667vw;
text-align: center;
text-decoration: none !important; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left {
min-height: 100px;
text-align: left;
flex-direction: row-reverse;
flex-wrap: nowrap;
justify-content: space-between; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-left .search-bar-collection-header-title {
text-align: right; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right {
min-height: 100px;
text-align: right;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container.is-aligned-right .search-bar-collection-header-title {
text-align: left; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title {
width: 100%;
color: white; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title h3 {
margin: 0 auto;
text-decoration: none;
font-size: 1.3rem;
line-height: 1.5rem;
text-overflow: ellipsis;
color: inherit; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title h3:hover {
text-decoration: none; }
.wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title span.label {
width: 100%;
display: block;
margin-top: -12px;
font-weight: normal;
font-size: 1rem; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-search-bar .search-bar-collection-header-container .search-bar-collection-header-title {
margin-bottom: 1rem; } }
/*# sourceMappingURL=tainacan-gutenberg-block-search-bar.css.map */

File diff suppressed because one or more lines are too long

View File

@ -64,19 +64,33 @@
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .components-modal__header .components-icon-button {
padding-right: 0; }
.wp-block-tainacan-modal hr {
margin: 5px 0.75rem; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px; }
margin-bottom: 14px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
.wp-block-tainacan-modal .modal-search-area .components-base-control:nth-child(2) {
flex-shrink: 2; }
.wp-block-tainacan-modal .modal-search-area .components-base-control .components-base-control__field {
flex-wrap: wrap; }
.wp-block-tainacan-modal .modal-search-area .components-base-control label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center; }
.wp-block-tainacan-modal .modal-search-area .components-base-control input.components-text-control__input {
padding: 5px 8px;
height: 28px; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
font-weight: 500;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
@ -89,7 +103,8 @@
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto; }
overflow-y: auto;
overflow-x: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }
@ -222,23 +237,26 @@
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none; }
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list li.term-list-item,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list li.term-list-item {
position: relative;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%; }
min-width: calc(20% - 24px);
width: calc(20% - 24px); }
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list li.term-list-item a,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list li.term-list-item a {
color: #454647;
height: auto;
display: flex;
align-items: center;
height: 54px; }
word-break: break-all;
word-break: break-word; }
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list li.term-list-item img,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list li.term-list-item img {
height: auto;
@ -256,17 +274,22 @@
@media only screen and (max-width: 1600px) {
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list li.term-list-item,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list li.term-list-item {
min-width: 30%;
width: 30%; } }
min-width: calc(25% - 24px);
width: calc(25% - 24px); } }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list li.term-list-item,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list li.term-list-item {
min-width: 45%;
width: 45%; } }
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px); } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list li.term-list-item,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list li.term-list-item {
min-width: 100%;
width: 100%; } }
min-width: calc(50% - 24px);
width: calc(50% - 24px); } }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-terms-list ul.terms-list.terms-layout-list li.term-list-item,
.wp-block-tainacan-terms-list ul.terms-list-edit.terms-layout-list li.term-list-item {
min-width: calc(100% - 24px);
width: calc(100% - 24px); } }
/*# sourceMappingURL=tainacan-gutenberg-block-terms-list.css.map */

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "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",
"mappings": "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",
"sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss"],
"names": [],
"file": "tainacan-gutenberg-block-terms-list.css"

View File

@ -34,7 +34,7 @@ class Collections extends Repository {
* {@inheritDoc}
* @see \Tainacan\Repositories\Repository::get_map()
*/
public function get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'name' => [
'map' => 'post_title',

View File

@ -27,7 +27,7 @@ class Filters extends Repository {
add_action( 'tainacan-deleted-tainacan-metadatum', array( &$this, 'hook_delete_when_metadata_deleted' ), 10, 2 );
}
public function get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'name' => [
'map' => 'post_title',

View File

@ -413,7 +413,7 @@ class Item_Metadata extends Repository {
public function register_post_type() {
}
public function get_map() {
protected function _get_map() {
return [];
}

View File

@ -30,7 +30,7 @@ class Items extends Repository {
add_filter( 'map_meta_cap', array( $this, 'map_meta_cap' ), 10, 4 );
}
public function get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'title' => [
'map' => 'post_title',

View File

@ -32,7 +32,7 @@ class Logs extends Repository {
add_action( 'add_attachment', array( $this, 'prepare_attachment_log_before_insert' ), 10 );
}
public function get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'title' => [
'map' => 'post_title',

View File

@ -46,7 +46,7 @@ class Metadata extends Repository {
* {@inheritDoc}
* @see \Tainacan\Repositories\Repository::get_map()
*/
public function get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'name' => [
'map' => 'post_title',

View File

@ -29,6 +29,8 @@ abstract class Repository {
*/
protected $logs_repository;
private $map = [];
/**
* Disable creation of logs while inerting and updating entities
*/
@ -85,7 +87,15 @@ abstract class Repository {
* 'validation' => v::stringType(),
* ],
*/
public abstract function get_map();
protected abstract function _get_map();
public function get_map() {
if (isset($this->map) && !empty($this->map)) {
return $this->map;
}
$this->map = $this->_get_map();
return $this->map;
}
/**
* Return repository name

View File

@ -31,7 +31,7 @@ class Taxonomies extends Repository {
add_action( 'tainacan-taxonomy-added-to-collection', array( $this, 'added_collection' ), 10, 2 );
}
public function get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'name' => [
'map' => 'post_title',

View File

@ -29,7 +29,7 @@ class Terms extends Repository {
parent::__construct();
}
public function get_map() {
protected function _get_map() {
return apply_filters( 'tainacan-get-map-' . $this->get_name(), [
'term_id' => [
'map' => 'term_id',

View File

@ -47,18 +47,18 @@ class Cli_Collection {
* remove items of specific collection.
*
* ## OPTIONS
* [--collection-id=<value>]
* : <value> ID of specifies the collection that will have your items removed.
* <collection_id>
* : specifies the collection that will have your items removed.
*
* [--permanently]
* : if items do not need to be trashed, if present permanently deletes items.
* : skip trash and permanently delete items.
*
* [--dry-run]
* : only count the total of item which will remove, just output a report
*
* ## EXAMPLES
*
* wp tainacan collection clean --collection-id=1201 --permanently
* wp tainacan collection clean 1201 --permanently
*
* cleaning collection items
* 100% [============================================================================================] 0:00 / 0:00
@ -69,10 +69,10 @@ class Cli_Collection {
*/
public function clean($args, $assoc_args) {
$permanently = false;
if( empty($assoc_args['collection-id']) ) {
if( empty($args[0]) || !is_numeric($args[0]) ) {
\WP_CLI::error( 'Wrong parameters', true );
}
$collection_id = $assoc_args['collection-id'];
$collection_id = $args[0];
if( !empty($assoc_args['permanently']) ) {
$permanently = true;

View File

@ -12,8 +12,8 @@ class Cli_Garbage_Collector {
*
* ## OPTIONS
*
* [--dry-run]
* : Look for garbage but do not delete anything, just output a report
* [--run]
* : By default, this command only looks for garbage and output a report, but does not delete anything. If you want to really delete the garbage, pass --run
*
* [--deep]
* : More aressive approach finding garbage. In some cases it could delete something related to other parts of the website. Currently, deep mode deletes all attachments with broken parent IDs, regardless whether they were uploaded via tainacan or not
@ -30,12 +30,20 @@ class Cli_Garbage_Collector {
* [--skip-metadata]
* : Do not try to find orphan and unused metadata
*
* [--yes]
* : Skip confirmation before execution
*
*/
public function __invoke($args, $assoc_args) {
$dry_run = isset($assoc_args['dry-run']);
$dry_run = ! isset($assoc_args['run']);
$deep = isset($assoc_args['deep']);
if (!$dry_run) {
\WP_CLI::warning( 'It is strongly recommended you do a backup before running this command, as there is no way to undo it.' );
\WP_CLI::confirm( 'Are you sure you want to look for and DELETE all the garbage? ', $assoc_args );
}
// delete attachments
if (!isset($assoc_args['skip-attachments'])) {
$this->delete_attachments($dry_run, $deep);
@ -59,6 +67,10 @@ class Cli_Garbage_Collector {
// delete bulk post meta
if ($dry_run) {
\WP_CLI::warning( 'Nothing was done. If you want to delete all the found garbage, run the command with --run option.' );
}
}
@ -268,11 +280,10 @@ class Cli_Garbage_Collector {
$orphan_metadata = $wpdb->get_col( "SELECT p.ID FROM $wpdb->postmeta pm JOIN $wpdb->posts p ON p.ID = pm.post_id
WHERE p.post_type = 'tainacan-metadatum' AND
pm.meta_key = 'collection_id' AND
pm.meta_value NOT IN (SELECT ID FROM $wpdb->posts WHERE post_type = 'tainacan-collection')
pm.meta_value NOT IN (SELECT ID FROM $wpdb->posts WHERE post_type = 'tainacan-collection') AND
pm.meta_value <> 'default'
" );
var_dump(count($orphan_metadata));
$meta_to_delete = array_merge($deleted_metadata, $orphan_metadata);
$meta_to_delete_count = count($meta_to_delete);

View File

@ -29,7 +29,7 @@ class Export_Handler {
'manual_collection' => false
]);
do_action('tainacan_register_exporters');
do_action('tainacan-register-exporters');
add_action( 'tainacan-enqueue-admin-scripts', array($this, 'enqueue_scripts') );
}

View File

@ -22,9 +22,29 @@ class Csv extends Exposer {
*/
public function rest_request_after_callbacks( $response, $handler, $request ) {
$response->set_headers( [
'Content-Type: text/csv; charset=' . get_option( 'blog_charset' ),
'Content-disposition: attachment;filename=tainacan.csv'] // TODO filter/optional
);
'Content-Type: text/csv; charset=' . get_option( 'blog_charset' )
]);
if (isset($request['collection_id'])) {
$collection = \Tainacan\Repositories\Collections::get_instance()->fetch( (int) $request['collection_id'] );
if ($collection) {
$filename = sanitize_title($collection->get_name());
}
} else {
$filename = sanitize_title(get_option('blogname'));
}
if (empty($filename)) {
$filename = sanitize_title( __('items', 'tainacan') );
}
if ( isset($request['paged']) ) {
$filename .= '-' . $request['paged'];
}
$filename .= '.csv';
header('Content-Disposition: attachment; filename="'.$filename.'"');
$items = $response->get_data();
$items = is_array($items) && isset($items['items']) ? $items['items'] : [];

View File

@ -29,18 +29,23 @@ class Exposers_Handler {
public function __construct() {
self::$instance = $this;
add_action('init', array(&$this, 'init'));
add_filter( 'rest_request_after_callbacks', [$this, 'rest_request_after_callbacks'], 10, 3 ); //exposer types
add_filter( 'tainacan-api-get-items-alternate', [$this, 'filter_check_items_request'], 10, 2 );
}
function init() {
//$this->register_exposer('Tainacan\Exposers\Xml');
//$this->register_exposer('Tainacan\Exposers\Txt');
$this->register_exposer('Tainacan\Exposers\Html');
$this->register_exposer('Tainacan\Exposers\Csv');
//$this->register_exposer('Tainacan\Exposers\OAI_PMH');
//$this->register_exposer('Tainacan\Exposers\JSON_LD');
do_action('tainacan-register-exposer', $this);
add_filter( 'rest_request_after_callbacks', [$this, 'rest_request_after_callbacks'], 10, 3 ); //exposer types
add_filter( 'tainacan-api-get-items-alternate', [$this, 'filter_check_items_request'], 10, 2 );
do_action('tainacan-register-exposers', $this);
}
/**

View File

@ -17,6 +17,7 @@ function tainacan_blocks_add_gutenberg_blocks_actions() {
add_action('init', 'tainacan_blocks_register_tainacan_items_list');
add_action('init', 'tainacan_blocks_register_tainacan_dynamic_items_list');
add_action('init', 'tainacan_blocks_register_tainacan_carousel_items_list');
add_action('init', 'tainacan_blocks_register_tainacan_search_bar');
add_action('init', 'tainacan_blocks_register_tainacan_collections_list');
add_action('init', 'tainacan_blocks_register_tainacan_carousel_collections_list');
add_action('init', 'tainacan_blocks_register_tainacan_facets_list');
@ -175,6 +176,35 @@ function tainacan_blocks_register_tainacan_carousel_items_list(){
}
}
function tainacan_blocks_register_tainacan_search_bar(){
global $TAINACAN_BASE_URL;
wp_enqueue_script(
'search-bar-theme-script',
$TAINACAN_BASE_URL . '/assets/gutenberg_search_bar_script-components.js',
array('wp-components')
);
wp_register_script(
'search-bar',
$TAINACAN_BASE_URL . '/assets/gutenberg_search_bar-components.js',
array('wp-blocks', 'wp-element', 'wp-components', 'wp-editor')
);
wp_register_style(
'search-bar',
$TAINACAN_BASE_URL . '/assets/css/tainacan-gutenberg-block-search-bar.css',
array('wp-edit-blocks')
);
if (function_exists('register_block_type')) {
register_block_type( 'tainacan/search-bar', array(
'editor_script' => 'search-bar',
'style' => 'search-bar'
) );
}
}
function tainacan_blocks_register_tainacan_collections_list(){
global $TAINACAN_BASE_URL;
@ -251,6 +281,7 @@ function tainacan_blocks_add_plugin_settings() {
wp_localize_script( 'items-list', 'tainacan_plugin', $settings );
wp_localize_script( 'dynamic-items-list', 'tainacan_plugin', $settings );
wp_localize_script( 'carousel-items-list', 'tainacan_plugin', $settings );
wp_localize_script( 'search-bar', 'tainacan_plugin', $settings );
wp_localize_script( 'collections-list', 'tainacan_plugin', $settings );
wp_localize_script( 'carousel-collections-list', 'tainacan_plugin', $settings );
wp_localize_script( 'facets-list', 'tainacan_plugin', $settings );

View File

@ -81,24 +81,44 @@
.components-spineer { margin: 8px; }
}
.components-modal__header .components-icon-button {
padding-right: 0;
}
hr {
margin: 5px 0.75rem;
}
.modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px;
margin-bottom: 14px;
.components-base-control {
width: 60%;
@media only screen and (max-width: 1024px) { width: 95% }
label {
&:nth-child(2) {
flex-shrink: 2;
}
.components-base-control__field {
flex-wrap: wrap;
}
label.components-base-control__label {
font-weight: 500;
color: #454647;
font-size: 0.875rem;
text-align: center;
}
input.components-text-control__input {
padding: 5px 8px;
height: 28px;
}
}
}
.modal-radio-area-label {
font-weight: bold;
font-weight: 500;
margin-left: 1.75rem;
}
@ -114,6 +134,7 @@
margin: 12px;
max-height: 50vh;
overflow-y: auto;
overflow-x: hidden;
.components-base-control {
overflow: hidden;

View File

@ -121,26 +121,26 @@
ul.collections-list.collections-layout-list,
ul.collections-list-edit.collections-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none;
li.collection-list-item {
position: relative;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%;
min-width: calc(20% - 24px);
width: calc(20% - 24px);
a {
color: #454647;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
height: auto;
display: flex;
align-items: center;
height: 54px;
word-break: break-all;
word-break: break-word;
}
img {
@ -151,6 +151,7 @@
margin-right: 20px;
}
a.collection-without-image img {
display: none;
}
@ -159,31 +160,26 @@
color: #454647;
text-decoration: none;
}
}
}
@media only screen and (max-width: 1600px) {
ul.collections-list.collections-layout-list li.collection-list-item,
ul.collections-list-edit.collections-layout-list li.collection-list-item {
min-width: 30%;
width: 30%;
}
min-width: calc(25% - 24px);
width: calc(25% - 24px);
}
@media only screen and (max-width: 1024px) {
ul.collections-list.collections-layout-list li.collection-list-item,
ul.collections-list-edit.collections-layout-list li.collection-list-item {
min-width: 45%;
width: 45%;
}
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px);
}
@media only screen and (max-width: 768px) {
ul.collections-list.collections-layout-list li.collection-list-item,
ul.collections-list-edit.collections-layout-list li.collection-list-item {
min-width: 100%;
width: 100%;
}
min-width: calc(50% - 24px);
width: calc(50% - 24px);
}
@media only screen and (max-width: 498px) {
min-width: calc(100% - 24px);
width: calc(100% - 24px);
}
}
}
}

View File

@ -201,6 +201,7 @@ export default class CollectionsModal extends React.Component {
<div>
<div className="modal-search-area">
<TextControl
placeholder={ __('Search by collection\'s name', 'tainacan') }
label={__('Search for a collection', 'tainacan')}
value={ this.state.searchCollectionName }
onInput={(value) => {

View File

@ -312,25 +312,26 @@
ul.facets-list.facets-layout-list,
ul.facets-list-edit.facets-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none;
li.facet-list-item {
position: relative;
display: inline-block;
margin: 12px;
min-height: 24px;
min-width: 22%;
width: 22%;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: calc(20% - 24px);
width: calc(20% - 24px);
a {
color: #454647;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
height: auto;
display: flex;
align-items: center;
height: 54px;
word-break: break-all;
word-break: break-word;
}
img {
@ -352,12 +353,34 @@
}
span.facet-item-count {
color: #cbcbcb;
word-break: break-all;
}
&:hover a {
color: #454647;
text-decoration: none;
}
@media only screen and (max-width: 1600px) {
min-width: calc(25% - 24px);
width: calc(25% - 24px);
}
@media only screen and (max-width: 1024px) {
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px);
}
@media only screen and (max-width: 768px) {
min-width: calc(50% - 24px);
width: calc(50% - 24px);
}
@media only screen and (max-width: 498px) {
min-width: calc(100% - 24px);
width: calc(100% - 24px);
}
}
}

View File

@ -380,7 +380,7 @@ registerBlockType('tainacan/facets-list', {
<div>
<RangeControl
label={__('Maximum number of facets', 'tainacan')}
value={ maxFacetsNumber }
value={ maxFacetsNumber ? maxFacetsNumber : 12}
onChange={ ( aMaxFacetsNumber ) => {
maxFacetsNumber = aMaxFacetsNumber;
setAttributes( { maxFacetsNumber: aMaxFacetsNumber } )

View File

@ -3,7 +3,7 @@ import axios from 'axios';
const { __ } = wp.i18n;
const { TextControl, Button, Modal, RadioControl, Spinner } = wp.components;
const { TextControl, Button, Modal, RadioControl, SelectControl, Spinner } = wp.components;
export default class MetadataModal extends React.Component {
constructor(props) {
@ -20,6 +20,7 @@ export default class MetadataModal extends React.Component {
collectionPage: 1,
temporaryCollectionId: '',
searchCollectionName: '',
collectionOrderBy: 'date-desc',
metadatumId: undefined,
metadatumType: undefined,
isLoadingMetadata: false,
@ -65,7 +66,16 @@ export default class MetadataModal extends React.Component {
if (this.state.collectionPage <= 1)
someModalCollections = [];
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
this.setState({
isLoadingCollections: true,
@ -133,10 +143,19 @@ export default class MetadataModal extends React.Component {
metadata: []
});
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage;
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage;
if (name != undefined && name != '')
endpoint += '&search=' + name;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
tainacan.get(endpoint, { cancelToken: aCollectionRequestSource.token })
.then(response => {
let someCollections = response.data.map((collection) => ({ name: collection.name, id: collection.id + '', slug: collection.slug }));
@ -299,6 +318,7 @@ export default class MetadataModal extends React.Component {
<div className="modal-search-area">
<TextControl
label={__('Search for a collection', 'tainacan')}
placeholder={ __('Search by collection\'s name', 'tainacan') }
value={ this.state.searchCollectionName }
onChange={(value) => {
this.setState({
@ -306,6 +326,28 @@ export default class MetadataModal extends React.Component {
});
_.debounce(this.fetchCollections(value), 300);
}}/>
<SelectControl
label={__('Order by', 'tainacan')}
value={ this.state.collectionOrderBy }
options={ [
{ label: __('Latest', 'tainacan'), value: 'date-desc' },
{ label: __('Oldest', 'tainacan'), value: 'date' },
{ label: __('Name (A-Z)', 'tainacan'), value: 'title' },
{ label: __('Name (Z-A)', 'tainacan'), value: 'title-desc' }
] }
onChange={ ( aCollectionOrderBy ) => {
this.state.collectionOrderBy = aCollectionOrderBy;
this.state.collectionPage = 1;
this.setState({
collectionOrderBy: this.state.collectionOrderBy,
collectionPage: this.state.collectionPage
});
if (this.state.searchCollectionName && this.state.searchCollectionName != '') {
this.fetchCollections(this.state.searchCollectionName);
} else {
this.fetchModalCollections();
}
}}/>
</div>
{(
this.state.searchCollectionName != '' ? (

View File

@ -23,8 +23,7 @@ document.addEventListener("DOMContentLoaded", () => {
collectionTextColor: '#ffffff',
tainacanApiRoot: '',
tainacanBaseUrl: '',
className: '',
extraParams: {}
className: ''
},
render(h){
return h(CarouselItemsListTheme, {
@ -45,8 +44,7 @@ document.addEventListener("DOMContentLoaded", () => {
collectionTextColor: this.collectionTextColor,
tainacanApiRoot: this.tainacanApiRoot,
tainacanBaseUrl: this.tainacanBaseUrl,
className: this.className,
extraParams: this.extraParams
className: this.className
}
});
},
@ -68,7 +66,6 @@ document.addEventListener("DOMContentLoaded", () => {
this.collectionTextColor = this.$el.attributes['collection-text-color'] != undefined ? this.$el.attributes['collection-text-color'].value : undefined;
this.tainacanApiRoot = this.$el.attributes['tainacan-api-root'] != undefined ? this.$el.attributes['tainacan-api-root'].value : undefined;
this.tainacanBaseUrl = this.$el.attributes['tainacan-base-url'] != undefined ? this.$el.attributes['tainacan-base-url'].value : undefined;
this.extraParams = this.$el.attributes['extra-params'] != undefined ? JSON.parse(this.$el.attributes['extra-params'].value) : undefined;
},
methods: {
__(text, domain) {

View File

@ -3,7 +3,7 @@ import axios from 'axios';
const { __ } = wp.i18n;
const { TextControl, Button, Modal, RadioControl, Spinner } = wp.components;
const { TextControl, Button, Modal, RadioControl, SelectControl, Spinner } = wp.components;
export default class CarouselItemsModal extends React.Component {
constructor(props) {
@ -17,6 +17,7 @@ export default class CarouselItemsModal extends React.Component {
isLoadingCollections: false,
modalCollections: [],
totalModalCollections: 0,
collectionOrderBy: 'date-desc',
collectionPage: 1,
temporaryCollectionId: '',
searchCollectionName: '',
@ -60,7 +61,16 @@ export default class CarouselItemsModal extends React.Component {
if (this.state.collectionPage <= 1)
someModalCollections = [];
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
this.setState({
isLoadingCollections: true,
@ -125,10 +135,19 @@ export default class CarouselItemsModal extends React.Component {
items: []
});
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage;
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage;
if (name != undefined && name != '')
endpoint += '&search=' + name;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
tainacan.get(endpoint, { cancelToken: aCollectionRequestSource.token })
.then(response => {
let someCollections = response.data.map((collection) => ({ name: collection.name, id: collection.id + '' }));
@ -228,6 +247,7 @@ export default class CarouselItemsModal extends React.Component {
<div className="modal-search-area">
<TextControl
label={__('Search for a collection', 'tainacan')}
placeholder={ __('Search by collection\'s name', 'tainacan') }
value={ this.state.searchCollectionName }
onChange={(value) => {
this.setState({
@ -235,6 +255,28 @@ export default class CarouselItemsModal extends React.Component {
});
_.debounce(this.fetchCollections(value), 300);
}}/>
<SelectControl
label={__('Order by', 'tainacan')}
value={ this.state.collectionOrderBy }
options={ [
{ label: __('Latest', 'tainacan'), value: 'date-desc' },
{ label: __('Oldest', 'tainacan'), value: 'date' },
{ label: __('Name (A-Z)', 'tainacan'), value: 'title' },
{ label: __('Name (Z-A)', 'tainacan'), value: 'title-desc' }
] }
onChange={ ( aCollectionOrderBy ) => {
this.state.collectionOrderBy = aCollectionOrderBy;
this.state.collectionPage = 1;
this.setState({
collectionOrderBy: this.state.collectionOrderBy,
collectionPage: this.state.collectionPage
});
if (this.state.searchCollectionName && this.state.searchCollectionName != '') {
this.fetchCollections(this.state.searchCollectionName);
} else {
this.fetchModalCollections();
}
}}/>
</div>
{(
this.state.searchCollectionName != '' ? (

View File

@ -114,10 +114,6 @@ registerBlockType('tainacan/carousel-items-list', {
collectionTextColor: {
type: String,
default: "#ffffff"
},
extraParams: {
type: Object,
default: {}
}
},
supports: {
@ -147,8 +143,7 @@ registerBlockType('tainacan/carousel-items-list', {
isLoadingCollection,
collection,
collectionBackgroundColor,
collectionTextColor,
extraParams
collectionTextColor
} = attributes;
// Obtains block's client id to render it on save function
@ -417,7 +412,7 @@ registerBlockType('tainacan/carousel-items-list', {
/>
<ToggleControl
label={__('Auto play', 'tainacan')}
help={ !autoPlay ? __('Toggle to automatically slide to next item', 'tainacan') : __('Do not automatically slide to next item', 'tainacan')}
help={ !autoPlay ? __('Toggle to automatically slide to the next item', 'tainacan') : __('Do not automatically slide to the next item', 'tainacan')}
checked={ autoPlay }
onChange={ ( isChecked ) => {
autoPlay = isChecked;
@ -428,7 +423,7 @@ registerBlockType('tainacan/carousel-items-list', {
{
autoPlay ?
<RangeControl
label={__('Seconds before translating to next', 'tainacan')}
label={__('Seconds before sliding to the next', 'tainacan')}
value={ autoPlaySpeed }
onChange={ ( aAutoPlaySpeed ) => {
autoPlaySpeed = aAutoPlaySpeed;
@ -713,8 +708,7 @@ registerBlockType('tainacan/carousel-items-list', {
showCollectionHeader,
showCollectionLabel,
collectionBackgroundColor,
collectionTextColor,
extraParams
collectionTextColor
} = attributes;
return <div
className={ className }
@ -734,7 +728,6 @@ registerBlockType('tainacan/carousel-items-list', {
max-items-number={ maxItemsNumber }
tainacan-api-root={ tainacan_plugin.root }
tainacan-base-url={ tainacan_plugin.base_url }
extraParams={ JSON.stringify(extraParams) }
id={ 'wp-block-tainacan-carousel-items-list_' + blockId }>
{ content }
</div>

View File

@ -328,26 +328,26 @@
ul.items-list.items-layout-list,
ul.items-list-edit.items-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none;
li.item-list-item {
position: relative;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%;
min-width: calc(20% - 24px);
width: calc(20% - 24px);
a {
color: #454647;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
height: auto;
display: flex;
align-items: center;
height: 54px;
word-break: break-all;
word-break: break-word;
}
img {
@ -366,6 +366,26 @@
color: #454647;
text-decoration: none;
}
@media only screen and (max-width: 1600px) {
min-width: calc(25% - 24px);
width: calc(25% - 24px);
}
@media only screen and (max-width: 1024px) {
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px);
}
@media only screen and (max-width: 768px) {
min-width: calc(50% - 24px);
width: calc(50% - 24px);
}
@media only screen and (max-width: 498px) {
min-width: calc(100% - 24px);
width: calc(100% - 24px);
}
}
}
}

View File

@ -2,7 +2,7 @@ const { registerBlockType } = wp.blocks;
const { __ } = wp.i18n;
const { RangeControl, Spinner, Button, ToggleControl, Tooltip, Placeholder, Toolbar, ColorPicker, ColorPalette, BaseControl, Panel, PanelBody, PanelRow } = wp.components;
const { RangeControl, Spinner, Button, ToggleControl, Tooltip, Placeholder, Toolbar, ColorPicker, ColorPalette, BaseControl, PanelBody } = wp.components;
const { InspectorControls, BlockControls } = wp.editor;
@ -140,7 +140,6 @@ registerBlockType('tainacan/dynamic-items-list', {
showCollectionHeader,
showCollectionLabel,
isLoadingCollection,
collection,
collectionBackgroundColor,
collectionTextColor
} = attributes;
@ -429,7 +428,7 @@ registerBlockType('tainacan/dynamic-items-list', {
<div>
<RangeControl
label={__('Maximum number of items', 'tainacan')}
value={ maxItemsNumber }
value={ maxItemsNumber ? maxItemsNumber : 12 }
onChange={ ( aMaxItemsNumber ) => {
maxItemsNumber = aMaxItemsNumber;
setAttributes( { maxItemsNumber: aMaxItemsNumber } )

View File

@ -269,13 +269,12 @@ registerBlockType('tainacan/items-list', {
{ isModalOpen ?
<ItemsModal
existingCollectionId={ collectionId }
selectedItemsObject={ selectedItemsObject }
onSelectCollection={ (selectedCollectionId) => {
collectionId = selectedCollectionId;
setAttributes({ collectionId: collectionId });
}}
onApplySelection={ (aSelectedItemsObject) =>{
selectedItemsObject = aSelectedItemsObject
selectedItemsObject = selectedItemsObject.concat(aSelectedItemsObject);
setAttributes({
selectedItemsObject: selectedItemsObject,
isModalOpen: false
@ -299,7 +298,7 @@ registerBlockType('tainacan/items-list', {
isPrimary
type="submit"
onClick={ () => openItemsModal() }>
{__('Select items', 'tainacan')}
{__('Add more items', 'tainacan')}
</Button>
</div>
): null

View File

@ -49,6 +49,10 @@
color: #454647;
font-weight: bold;
line-height: normal;
span {
line-height: normal;
}
}
img {
@ -121,26 +125,26 @@
ul.items-list.items-layout-list,
ul.items-list-edit.items-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none;
li.item-list-item {
position: relative;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%;
min-width: calc(20% - 24px);
width: calc(20% - 24px);
a {
color: #454647;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
height: auto;
display: flex;
align-items: center;
height: 54px;
word-break: break-all;
word-break: break-word;
}
img {
@ -159,6 +163,26 @@
color: #454647;
text-decoration: none;
}
@media only screen and (max-width: 1600px) {
min-width: calc(25% - 24px);
width: calc(25% - 24px);
}
@media only screen and (max-width: 1024px) {
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px);
}
@media only screen and (max-width: 768px) {
min-width: calc(50% - 24px);
width: calc(50% - 24px);
}
@media only screen and (max-width: 498px) {
min-width: calc(100% - 24px);
width: calc(100% - 24px);
}
}
}
}

View File

@ -1,9 +1,10 @@
import tainacan from '../../api-client/axios.js';
import axios from 'axios';
import qs from 'qs';
const { __ } = wp.i18n;
const { TextControl, Button, Modal, CheckboxControl, RadioControl, Spinner } = wp.components;
const { TextControl, Button, Modal, SelectControl, RadioControl, Spinner } = wp.components;
export default class ItemsModal extends React.Component {
constructor(props) {
@ -11,11 +12,7 @@ export default class ItemsModal extends React.Component {
// Initialize state
this.state = {
modalItems: [],
totalModalItems: 0,
itemsPerPage: 24,
searchItemName: '',
temporarySelectedItems: [],
collectionsPerPage: 24,
items: [],
isLoadingItems: false,
itemsRequestSource: undefined,
@ -25,20 +22,16 @@ export default class ItemsModal extends React.Component {
modalCollections: [],
totalModalCollections: 0,
collectionPage: 1,
itemsPage: 1,
collectionOrderBy: 'date-desc',
temporaryCollectionId: '',
searchCollectionName: '',
collections: [],
collectionsRequestSource: undefined,
searchURL: '',
};
// Bind events
this.fetchItems = this.fetchItems.bind(this);
this.fetchModalItems = this.fetchModalItems.bind(this);
this.isTemporaryItemSelected = this.isTemporaryItemSelected.bind(this);
this.toggleSelectTemporaryItem = this.toggleSelectTemporaryItem.bind(this);
this.selectTemporaryItem = this.selectTemporaryItem.bind(this);
this.removeTemporaryItemOfId = this.removeTemporaryItemOfId.bind(this);
this.applySelectedItems = this.applySelectedItems.bind(this);
this.resetCollections = this.resetCollections.bind(this);
this.selectCollection = this.selectCollection.bind(this);
@ -51,12 +44,12 @@ export default class ItemsModal extends React.Component {
this.setState({
collectionId: this.props.existingCollectionId,
temporarySelectedItems: JSON.parse(JSON.stringify(this.props.selectedItemsObject))
});
if (this.props.existingCollectionId != null && this.props.existingCollectionId != undefined) {
this.fetchCollection(this.props.existingCollectionId);
this.fetchModalItems(this.props.existingCollectionId);
this.setState({
searchURL: this.props.existingSearchURL ? this.props.existingSearchURL : tainacan_plugin.admin_url + 'admin.php?page=tainacan_admin#/collections/'+ this.props.existingCollectionId + '/items/?iframemode=true' });
} else {
this.setState({ collectionPage: 1 });
this.fetchModalCollections();
@ -64,81 +57,42 @@ export default class ItemsModal extends React.Component {
}
// ITEMS RELATED --------------------------------------------------
selectTemporaryItem(item) {
let existingItemIndex = this.state.temporarySelectedItems.findIndex((existingItem) => (existingItem.id == 'item-id-' + item.id) || (existingItem.id == item.id));
if (existingItemIndex < 0) {
let itemId = isNaN(item.id) ? item.id : 'item-id-' + item.id;
let aTemporarySelectedItems = this.state.temporarySelectedItems;
aTemporarySelectedItems.push({
id: itemId,
title: item.title,
url: item.url,
thumbnail: item.thumbnail
});
this.setState({ temporarySelectedItems: aTemporarySelectedItems });
}
}
removeTemporaryItemOfId(itemId) {
let existingItemIndex = this.state.temporarySelectedItems.findIndex((existingItem) => ((existingItem.id == 'item-id-' + itemId) || (existingItem.id == itemId)));
if (existingItemIndex >= 0) {
let aTemporarySelectedItems = this.state.temporarySelectedItems;
aTemporarySelectedItems.splice(existingItemIndex, 1);
this.setState({ temporarySelectedItems: aTemporarySelectedItems });
}
}
applySelectedItems() {
let aSelectedItemsObject = JSON.parse(JSON.stringify(this.state.temporarySelectedItems));
this.props.onApplySelection(aSelectedItemsObject);
let iframe = document.getElementById("itemsFrame");
if (iframe) {
let params = new URLSearchParams(iframe.contentWindow.location.search);
let selectedItems = params.getAll('selecteditems');
params.delete('selecteditems')
this.fetchItems(selectedItems);
}
}
cancelSelection() {
this.setState({
modalItems: [],
modalCollections: []
});
this.props.onCancelSelection();
}
isTemporaryItemSelected(itemId) {
return this.state.temporarySelectedItems.findIndex(item => (item.id == itemId) || (item.id == 'item-id-' + itemId)) >= 0;
}
fetchItems(selectedItems) {
toggleSelectTemporaryItem(item, isChecked) {
if (isChecked)
this.selectTemporaryItem(item);
else
this.removeTemporaryItemOfId(item.id);
this.setState({ temporarySelectedItems: this.state.temporarySelectedItems });
// setContent();
}
fetchItems(name) {
this.setState({ isLoadingItems: true });
if (this.state.itemsRequestSource != undefined)
this.state.itemsRequestSource.cancel('Previous items search canceled.');
let anItemsRequestSource = axios.CancelToken.source();
let endpoint = '/collection/'+ this.state.collectionId + '/items/?orderby=title&order=asc&fetch_only=title,thumbnail&perpage=' + this.state.itemsPerPage;
if (name != undefined && name != '')
endpoint += '&search=' + name;
let endpoint = '/collection/' + this.state.collectionId + '/items?'+ qs.stringify({ postin: selectedItems }) + '&fetch_only=title,url,thumbnail';
tainacan.get(endpoint, { cancelToken: anItemsRequestSource.token })
.then(response => {
let someItems = response.data.items.map((item) => ({
title: item.title,
id: item.id,
id: isNaN(item.id) ? item.id : 'item-id-' + item.id,
url: item.url,
thumbnail: [{
src: item.thumbnail['tainacan-medium'] != undefined ? item.thumbnail['tainacan-medium'][0] : item.thumbnail['medium'][0],
@ -151,6 +105,8 @@ export default class ItemsModal extends React.Component {
items: someItems
});
this.props.onApplySelection(someItems);
return someItems;
})
.catch(error => {
@ -158,49 +114,6 @@ export default class ItemsModal extends React.Component {
});
}
fetchModalItems(collectionId) {
let someModalItems = this.state.modalItems;
if (this.state.itemsPage <= 1)
someModalItems = [];
let endpoint = '/collection/'+ collectionId + '/items/?orderby=title&order=asc&fetch_only=title,thumbnail&perpage=' + this.state.itemsPerPage + '&paged=' + this.state.itemsPage;
this.setState({
isLoadingItems: true,
modalItems: someModalItems,
itemsPage: this.state.itemsPage + 1
});
tainacan.get(endpoint)
.then(response => {
someModalItems = this.state.modalItems;
for (let item of response.data.items) {
someModalItems.push({
title: item.title,
id: item.id,
url: item.url,
thumbnail: [{
src: item.thumbnail['tainacan-medium'] != undefined ? item.thumbnail['tainacan-medium'][0] : item.thumbnail['medium'][0],
alt: item.title
}]
});
}
this.setState({
isLoadingItems: false,
modalItems: someModalItems,
totalModalItems: response.headers['x-wp-total']
});
return someModalItems;
})
.catch(error => {
console.log('Error trying to fetch items: ' + error);
});
}
// COLLECTIONS RELATED --------------------------------------------------
fetchModalCollections() {
@ -208,7 +121,16 @@ export default class ItemsModal extends React.Component {
if (this.state.collectionPage <= 1)
someModalCollections = [];
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.itemsPerPage + '&paged=' + this.state.collectionPage;
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
this.setState({
isLoadingCollections: true,
@ -251,11 +173,12 @@ export default class ItemsModal extends React.Component {
selectCollection(selectedCollectionId) {
this.setState({
collectionId: selectedCollectionId
collectionId: selectedCollectionId,
searchURL: tainacan_plugin.admin_url + 'admin.php?page=tainacan_admin#/collections/' + selectedCollectionId + '/items/?iframemode=true'
});
this.props.onSelectCollection(selectedCollectionId);
this.fetchCollection(selectedCollectionId);
this.fetchModalItems(selectedCollectionId);
}
fetchCollections(name) {
@ -272,10 +195,19 @@ export default class ItemsModal extends React.Component {
items: []
});
let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.itemsPerPage;
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage;
if (name != undefined && name != '')
endpoint += '&search=' + name;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
tainacan.get(endpoint, { cancelToken: aCollectionRequestSource.token })
.then(response => {
let someCollections = response.data.map((collection) => ({ name: collection.name, id: collection.id + '' }));
@ -295,11 +227,9 @@ export default class ItemsModal extends React.Component {
resetCollections() {
this.setState({
itemsPage: 1,
collectionId: null,
collectionPage: 1,
modalCollections: [],
modalItems: []
modalCollections: []
});
this.fetchModalCollections();
}
@ -308,116 +238,26 @@ export default class ItemsModal extends React.Component {
return this.state.collectionId != null && this.state.collectionId != undefined ? (
// Items modal
<Modal
className="wp-block-tainacan-modal"
title={__('Select the desired items from collection ' + this.state.collectionName, 'tainacan')}
className="wp-block-tainacan-modal dynamic-modal"
title={ __('Select items to add on block', 'tainacan', 'tainacan')}
onRequestClose={ () => this.cancelSelection() }
contentLabel={__('Select items', 'tainacan')}>
<div>
<div className="modal-search-area">
<TextControl
label={__('Search for a item', 'tainacan')}
value={ this.state.searchItemName }
onChange={(value) => {
this.setState({
searchItemName: value
});
_.debounce(this.fetchItems(value), 300);
}}/>
</div>
{(
this.state.searchItemName != '' ? (
this.state.items.length > 0 ?
(
<div>
<ul className="modal-checkbox-list">
{
this.state.items.map((item) =>
<li
key={ item.id }
className="modal-checkbox-list-item">
{ item.thumbnail ?
<img
aria-hidden
src={ item.thumbnail && item.thumbnail[0] && item.thumbnail[0].src ? item.thumbnail[0].src : `${tainacan_plugin.base_url}/admin/images/placeholder_square.png`}
alt={ item.thumbnail && item.thumbnail[0] ? item.thumbnail[0].alt : item.title }/>
: null
}
<CheckboxControl
label={ item.title }
checked={ this.isTemporaryItemSelected(item.id) }
onChange={ ( isChecked ) => { this.toggleSelectTemporaryItem(item, isChecked) } }
/>
</li>
)
}
</ul>
{ this.state.isLoadingItems ? <Spinner /> : null }
</div>
)
: this.state.isLoadingItems ? <div class="spinner-container"><Spinner /></div> :
<div className="modal-loadmore-section">
<p>{ __('Sorry, no items found.', 'tainacan') }</p>
</div>
) :
this.state.modalItems.length > 0 ?
(
<div>
<ul className="modal-checkbox-list">
{
this.state.modalItems.map((item) =>
<li
key={ item.id }
className="modal-checkbox-list-item">
{ item.thumbnail ?
<img
aria-hidden
src={ item.thumbnail && item.thumbnail[0] && item.thumbnail[0].src ? item.thumbnail[0].src : `${tainacan_plugin.base_url}/admin/images/placeholder_square.png`}
alt={ item.thumbnail && item.thumbnail[0] ? item.thumbnail[0].alt : item.title }/>
: null
}
<CheckboxControl
label={ item.title }
checked={ this.isTemporaryItemSelected(item.id) }
onChange={ ( isChecked ) => { this.toggleSelectTemporaryItem(item, isChecked) } } />
</li>
)
}
</ul>
{ this.state.isLoadingItems ? <Spinner /> : null }
<div className="modal-loadmore-section">
<p>{ __('Showing', 'tainacan') + " " + this.state.modalItems.length + " " + __('of', 'tainacan') + " " + this.state.totalModalItems + " " + __('items', 'tainacan') + "."}</p>
{
this.state.modalItems.length < this.state.totalModalItems ? (
<Button
isDefault
isSmall
onClick={ () => this.fetchModalItems(this.state.collectionId) }>
{__('Load more', 'tainacan')}
</Button>
) : null
}
</div>
</div>
) : this.state.isLoadingItems ? <Spinner /> :
<div className="modal-loadmore-section">
<p>{ __('Sorry, no items found.', 'tainacan') }</p>
</div>
)}
contentLabel={ __('Select items that will be added on block', 'tainacan', 'tainacan')}>
<iframe
id="itemsFrame"
src={ this.state.searchURL } />
<div className="modal-footer-area">
<Button
isDefault
onClick={ () => this.resetCollections() }>
onClick={ () => { this.resetCollections() }}>
{__('Switch collection', 'tainacan')}
</Button>
<Button
style={{ marginLeft: 'auto' }}
isPrimary
onClick={ () => this.applySelectedItems() }>
{__('Finish', 'tainacan')}
{__('Add the selected items', 'tainacan')}
</Button>
</div>
</div>
</Modal>
) : (
// Collections modal
@ -429,6 +269,7 @@ export default class ItemsModal extends React.Component {
<div>
<div className="modal-search-area">
<TextControl
placeholder={ __('Search by collection\'s name', 'tainacan') }
label={__('Search for a collection', 'tainacan')}
value={ this.state.searchCollectionName }
onChange={(value) => {
@ -437,6 +278,28 @@ export default class ItemsModal extends React.Component {
});
_.debounce(this.fetchCollections(value), 300);
}}/>
<SelectControl
label={__('Order by', 'tainacan')}
value={ this.state.collectionOrderBy }
options={ [
{ label: __('Latest', 'tainacan'), value: 'date-desc' },
{ label: __('Oldest', 'tainacan'), value: 'date' },
{ label: __('Name (A-Z)', 'tainacan'), value: 'title' },
{ label: __('Name (Z-A)', 'tainacan'), value: 'title-desc' }
] }
onChange={ ( aCollectionOrderBy ) => {
this.state.collectionOrderBy = aCollectionOrderBy;
this.state.collectionPage = 1;
this.setState({
collectionOrderBy: this.state.collectionOrderBy,
collectionPage: this.state.collectionPage
});
if (this.state.searchCollectionName && this.state.searchCollectionName != '') {
this.fetchCollections(this.state.searchCollectionName);
} else {
this.fetchModalCollections();
}
}}/>
</div>
{(
this.state.searchCollectionName != '' ? (
@ -514,6 +377,11 @@ export default class ItemsModal extends React.Component {
onClick={ () => this.selectCollection(this.state.temporaryCollectionId) }>
{__('Select items', 'tainacan')}
</Button>
{
this.state.isLoadingItems ? (
<Spinner />
) : null
}
</div>
</div>
</Modal>

View File

@ -0,0 +1,647 @@
const { registerBlockType } = wp.blocks;
const { __ } = wp.i18n;
const { RangeControl, TextControl, Toolbar, SelectControl, Button, ToggleControl, Placeholder, ColorPicker, ColorPalette, BaseControl, PanelBody } = wp.components;
const { InspectorControls, BlockControls } = wp.editor;
import SearchBarModal from './search-bar-modal.js';
registerBlockType('tainacan/search-bar', {
title: __('Tainacan Search Bar', 'tainacan'),
icon:
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="-2 -2 20 20"
height="24px"
width="24px">
<path
fill="#298596"
d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5
c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6
c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2
c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2
C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3
c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2
c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/>
</svg>,
category: 'tainacan-blocks',
keywords: [ __( 'items', 'tainacan' ), __( 'search', 'tainacan' ), __( 'bar', 'tainacan' ) ],
attributes: {
content: {
type: 'array',
source: 'children',
selector: 'div'
},
collectionId: {
type: String,
default: undefined
},
collectionSlug: {
type: String,
default: undefined
},
alignment: {
type: String,
default: 'center'
},
isModalOpen: {
type: Boolean,
default: false
},
maxWidth: {
type: Number,
value: 80
},
placeholderText: {
type: String,
default: __('Search', 'taincan')
},
showCollectionHeader: {
type: Boolean,
value: false
},
showCollectionLabel: {
type: Boolean,
value: false
},
collectionHeaderHeight: {
type: Number,
value: 165
},
collectionBackgroundColor: {
type: String,
default: "#454647"
},
collectionTextColor: {
type: String,
default: "#ffffff"
},
collectionHeaderImage: {
type: String,
default: undefined
},
collectionName: {
type: String,
default: undefined
},
collectionTextSize: {
type: Number,
default: 2
},
},
supports: {
align: ['full', 'wide', 'left', 'center', 'right'],
html: true,
multiple: false
},
styles: [
{
name: 'default',
label: __('Default', 'tainacan'),
isDefault: true,
},{
name: 'alternate',
label: __('alternate', 'tainacan'),
},{
name: 'stylish',
label: __('stylish', 'tainacan'),
}
],
edit({ attributes, setAttributes, className, isSelected }){
let {
content,
collectionId,
collectionSlug,
collectionHeaderHeight,
collectionTextSize,
alignment,
placeholderText,
isModalOpen,
maxWidth,
showCollectionHeader,
showCollectionLabel,
collectionBackgroundColor,
collectionTextColor,
collectionHeaderImage,
collectionName
} = attributes;
function setContent(){
setAttributes({
content: (
showCollectionHeader ?
<div>
{ collectionHeaderImage ?
<div
className={ 'search-bar-collection-header-image' }
style={{
backgroundImage: 'url(' + collectionHeaderImage + ')',
height: collectionHeaderHeight ? collectionHeaderHeight + 'px' : '160px'
}}>
</div> : null
}
<div
className={
(showCollectionHeader ? 'search-bar-collection-header-container' : '') +
(alignment == 'left' ? ' is-aligned-left' : '') +
(alignment == 'right' ? ' is-aligned-right' : '')
}
style={{
backgroundColor: collectionBackgroundColor
}}>
<div
style={{ color: collectionTextColor ? collectionTextColor : '' }}
class="search-bar-collection-header-title">
{ showCollectionLabel ? <span class="label">{ __('Collection', 'tainacan') }</span> : null }
<h3 style={{ fontSize: collectionTextSize ? collectionTextSize + 'rem' : '2rem' }}>
{ collectionName ? collectionName : '' }
</h3>
</div>
{ collectionId && collectionSlug ?
<div class="tainacan-search-container">
<form
style={{ maxWidth: maxWidth ? maxWidth + '%' : '80%' }}
className={
(alignment == 'left' ? ' is-aligned-left' : '') +
(alignment == 'right' ? ' is-aligned-right' : '')
}
id="taincan-search-bar-block"
action={ tainacan_plugin.site_url + '/' + collectionSlug + '/#/' }
method='get'>
<input
style={{ borderColor: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
id="taincan-search-bar-block_input"
label={ __('Search', 'taincan')}
name='search'
placeholder={ placeholderText }
/>
<button
class="button"
type="submit">
<span class="icon">
<i>
<svg
style={{ fill: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
width="24"
height="24"
viewBox="-2 -3 20 20">
<path d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5
c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6
c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2
c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2
C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3
c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2
c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/>
</svg>
</i>
</span>
</button>
</form>
</div>
: null
}
</div>
</div>
:
<div class="tainacan-search-container">
<form
style={{ maxWidth: maxWidth ? maxWidth + '%' : '80%' }}
className={
(alignment == 'left' ? ' is-aligned-left' : '') +
(alignment == 'right' ? ' is-aligned-right' : '')
}
id="taincan-search-bar-block"
action={ tainacan_plugin.site_url + '/' + collectionSlug + '/#/' }
method='get'>
<input
style={{ borderColor: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
id="taincan-search-bar-block_input"
label={ __('Search', 'taincan')}
name='search'
placeholder={ placeholderText }
/>
<button
class="button"
type="submit">
<span class="icon">
<i>
<svg
style={{ fill: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
width="24"
height="24"
viewBox="-2 -3 20 20">
<path d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5
c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6
c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2
c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2
C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3
c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2
c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/>
</svg>
</i>
</span>
</button>
</form>
</div>
)
});
}
function openSearchBarModal() {
isModalOpen = true;
setAttributes({ isModalOpen: isModalOpen });
}
function updateAlignment(newAlignment) {
alignment = newAlignment;
setAttributes({ alignment: alignment });
setContent();
}
// function getCurrentStyle() {
// if (isSelected) {
// if (className.split(' ').find((aClass) => aClass == 'is-style-alternate')) {
// return 'alternate'
// } else if (className.split(' ').find((aClass) => aClass == 'is-style-stylish')) {
// return 'stylish'
// }
// }
// return 'default'
// }
// Executed only on the first load of page
if (content && content.length && content[0].type)
setContent();
const alignmentControls = [
{
icon: 'editor-alignleft',
title: __( 'Left' ),
onClick: () => updateAlignment('left'),
isActive: alignment === 'left',
},
{
icon: 'editor-aligncenter',
title: __( 'Center' ),
onClick: () => updateAlignment('center'),
isActive: alignment === 'center',
},
{
icon: 'editor-alignright',
title: __( 'Right' ),
onClick: () => updateAlignment('right'),
isActive: alignment === 'right',
},
];
return (
<div className={className}>
<div>
<BlockControls>
<Toolbar controls={ alignmentControls } />
</BlockControls>
</div>
<div>
<InspectorControls>
<hr />
<div style={{ marginTop: '24px' }}>
<TextControl
label={ __('Placeholder text', 'tainacan') }
value={ placeholderText }
onChange={ ( aPlaceholderText ) => {
placeholderText = aPlaceholderText
setAttributes( { placeholderText: placeholderText } );
setContent();
}}
/>
</div>
<br />
<div style={{ marginBottom: '12px' }}>
<RangeControl
label={__('Maximum width size (%)', 'tainacan')}
value={ maxWidth ? maxWidth : 80 }
onChange={ ( aMaxWidth ) => {
maxWidth = aMaxWidth;
setAttributes( { maxWidth: aMaxWidth } )
setContent();
}}
min={ 15 }
max={ 100 }
/>
</div>
<br />
<PanelBody
title={__('Collection header', 'tainacan')}
initialOpen={ false }
>
<ToggleControl
label={__('Display header', 'tainacan')}
help={ !showCollectionHeader ? __('Toggle to show collection header', 'tainacan') : __('Do not show collection header', 'tainacan')}
checked={ showCollectionHeader }
onChange={ ( isChecked ) => {
showCollectionHeader = isChecked;
setAttributes({ showCollectionHeader: showCollectionHeader });
setContent();
}
}
/>
{ showCollectionHeader ?
<div style={{ margin: '5px' }}>
{ collectionHeaderImage ?
<RangeControl
label={__('Header image height (px)', 'tainacan')}
value={ collectionHeaderHeight ? collectionHeaderHeight : 125 }
onChange={ ( aHeight ) => {
collectionHeaderHeight = aHeight;
setAttributes( { collectionHeaderHeight: collectionHeaderHeight } )
setContent();
}}
min={ 100 }
max={ 300 } /> : null
}
<ToggleControl
label={__('Display "Collection" label', 'tainacan')}
help={ !showCollectionLabel ? __('Toggle to show "Collection" label above header', 'tainacan') : __('Do not show "Collection" label', 'tainacan')}
checked={ showCollectionLabel }
onChange={ ( isChecked ) => {
showCollectionLabel = isChecked;
setAttributes({ showCollectionLabel: showCollectionLabel });
setContent();
}
}
/>
<BaseControl
id="colorpicker"
label={ __('Background color', 'tainacan')}>
<ColorPicker
color={ collectionBackgroundColor }
onChangeComplete={ ( value ) => {
collectionBackgroundColor = value.hex;
setAttributes({ collectionBackgroundColor: collectionBackgroundColor }) ;
setContent();
}}
disableAlpha
/>
</BaseControl>
<BaseControl
id="colorpallete"
label={ __('Collection name color', 'tainacan')}>
<ColorPalette
colors={ [{ name: __('Black', 'tainacan'), color: '#000000'}, { name: __('White', 'tainacan'), color: '#ffffff'} ] }
value={ collectionTextColor }
onChange={ ( color ) => {
collectionTextColor = color;
setAttributes({ collectionTextColor: collectionTextColor });
setContent();
}}
/>
</BaseControl>
<SelectControl
label={__('Collection name size', 'tainacan')}
value={ collectionTextSize ? collectionTextSize : 2 }
options={ [
{ label: __('Large', 'tainacan'), value: 2.5 },
{ label: __('Medium', 'tainacan'), value: 2 },
{ label: __('Small', 'tainacan'), value: 1.5 },
] }
onChange={ ( size ) => {
collectionTextSize = size;
setAttributes({ collectionTextSize: collectionTextSize });
}}
/>
</div>
: null
}
</PanelBody>
</InspectorControls>
</div>
{ isSelected ?
(
<div>
{ isModalOpen ?
<SearchBarModal
existingCollectionId={ collectionId }
existingCollectionSlug={ collectionSlug }
onSelectCollection={ (selectedCollection) => {
collectionId = selectedCollection.id;
collectionSlug = selectedCollection.slug;
collectionName = selectedCollection.name;
collectionHeaderImage = selectedCollection.header_image;
collectionBackgroundColor = selectedCollection.tainacan_theme_collection_background_color ? selectedCollection.tainacan_theme_collection_background_color : '#454647'
collectionTextColor = selectedCollection.tainacan_theme_collection_color ? selectedCollection.tainacan_theme_collection_color : '#ffffff';
setAttributes({
collectionId: collectionId,
collectionSlug: collectionSlug,
collectionHeaderImage: collectionHeaderImage,
collectionName: collectionName,
collectionBackgroundColor: collectionBackgroundColor,
collectionTextColor: collectionTextColor,
isModalOpen: false
});
setContent();
}}
onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/>
: null
}
{ collectionId ? (
<div className="block-control">
<p>
<span class="icon">
<i>
<svg width="24" height="24" viewBox="-2 -2 20 20">
<path d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5
c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6
c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2
c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2
C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3
c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2
c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/>
</svg>
</i>
</span>
{__('Set up a custom search bar to redirect to an item\'s list', 'tainacan')}
</p>
<Button
isPrimary
type="submit"
onClick={ () => openSearchBarModal() }>
{__('Configure search source', 'tainacan')}
</Button>
</div>
): null
}
</div>
) : null
}
{ !collectionId ? (
<Placeholder
icon={(
<img
width={148}
src={ `${tainacan_plugin.base_url}/admin/images/tainacan_logo_header.svg` }
alt="Tainacan Logo"/>
)}>
<p>
<span class="icon">
<i>
<svg width="24" height="24" viewBox="-2 -2 20 20">
<path d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5
c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6
c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2
c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2
C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3
c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2
c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/>
</svg>
</i>
</span>
{__('Set up a custom search bar to redirect to an item\'s list', 'tainacan')}
</p>
<Button
isPrimary
type="submit"
onClick={ () => openSearchBarModal() }>
{__('Select search source', 'tainacan')}
</Button>
</Placeholder>
) : null
}
{
showCollectionHeader ?
<div>
{ collectionHeaderImage ?
<div
className={ 'search-bar-collection-header-image' }
style={{
backgroundImage: 'url(' + collectionHeaderImage + ')',
height: collectionHeaderHeight ? collectionHeaderHeight + 'px' : '160px'
}}>
</div> : null
}
<div
className={
(showCollectionHeader ? 'search-bar-collection-header-container' : '') +
(alignment == 'left' ? ' is-aligned-left' : '') +
(alignment == 'right' ? ' is-aligned-right' : '')
}
style={{
backgroundColor: collectionBackgroundColor
}}>
<div
style={{ color: collectionTextColor ? collectionTextColor : '' }}
class="search-bar-collection-header-title">
{ showCollectionLabel ? <span class="label">{ __('Collection', 'tainacan') }</span> : null }
<h3 style={{ fontSize: collectionTextSize ? collectionTextSize + 'rem' : '2rem' }}>
{ collectionName ? collectionName : '' }
</h3>
</div>
{ collectionId && collectionSlug ?
<div class="tainacan-search-container">
<div
style={{ maxWidth: maxWidth ? maxWidth + '%' : '80%' }}
className={
(alignment == 'left' ? ' is-aligned-left' : '') +
(alignment == 'right' ? ' is-aligned-right' : '')
}
id="taincan-search-bar-block">
<input
style={{ borderColor: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
id="taincan-search-bar-block_input"
label={ __('Search', 'taincan')}
name='search'
placeholder={ placeholderText }
/>
<button
class="button"
onClick={(event) => { event.preventDefault(); return false; }}>
<span class="icon">
<i>
<svg
style={{ fill: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
width="24"
height="24"
viewBox="-2 -4 20 20">
<path d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5
c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6
c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2
c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2
C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3
c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2
c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/>
</svg>
</i>
</span>
</button>
</div>
</div>
: null
}
</div>
</div>
: null
}
{ collectionId && collectionSlug && !showCollectionHeader ?
<div class="tainacan-search-container">
<div
style={{ maxWidth: maxWidth ? maxWidth + '%' : '80%' }}
className={
(alignment == 'left' ? ' is-aligned-left' : '') +
(alignment == 'right' ? ' is-aligned-right' : '')
}
id="taincan-search-bar-block">
<input
style={{ borderColor: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
id="taincan-search-bar-block_input"
label={ __('Search', 'taincan')}
name='search'
placeholder={ placeholderText }
/>
<button
class="button">
<span class="icon">
<i>
<svg
style={{ fill: showCollectionHeader && collectionBackgroundColor ? collectionBackgroundColor : '' }}
width="24"
height="24"
viewBox="-2 -4 20 20">
<path d="M0,5.8C0,5,0.2,4.2,0.5,3.5s0.7-1.3,1.2-1.8s1.1-0.9,1.8-1.2C4.2,0.1,5,0,5.8,0S7.3,0.1,8,0.5
c0.7,0.3,1.3,0.7,1.8,1.2s0.9,1.1,1.2,1.8c0.5,1.2,0.5,2.5,0.2,3.7c0,0.2-0.1,0.4-0.2,0.6c0,0.1-0.2,0.6-0.2,0.6
c0.6,0.6,1.3,1.3,1.9,1.9c0.7,0.7,1.3,1.3,2,2c0,0,0.3,0.2,0.3,0.3c0,0.3-0.1,0.7-0.3,1c-0.2,0.6-0.8,1-1.4,1.2
c-0.1,0-0.6,0.2-0.6,0.1c0,0-4.2-4.2-4.2-4.2c0,0-0.8,0.3-0.8,0.4c-1.3,0.4-2.8,0.5-4.1-0.1c-0.7-0.3-1.3-0.7-1.8-1.2
C1.2,9.3,0.8,8.7,0.5,8S0,6.6,0,5.8z M1.6,5.8c0,0.4,0.1,0.9,0.2,1.3C2.1,8.2,3,9.2,4.1,9.6c0.5,0.2,1,0.3,1.6,0.3
c0.6,0,1.1-0.1,1.6-0.3C8.7,9,9.7,7.6,9.8,6c0.1-1.5-0.6-3.1-2-3.9c-0.9-0.5-2-0.6-3-0.4C4.6,1.8,4.4,1.9,4.1,2
c-0.5,0.2-1,0.5-1.4,0.9C2,3.7,1.6,4.7,1.6,5.8z"/>
</svg>
</i>
</span>
</button>
</div>
</div>
: null
}
</div>
);
},
save({ attributes, className }){
const { content } = attributes;
return <div className={ className }>{ content }</div>
}
});

View File

@ -0,0 +1,325 @@
import tainacan from '../../api-client/axios.js';
import axios from 'axios';
const { __ } = wp.i18n;
const { TextControl, Button, Modal, RadioControl, SelectControl, Spinner } = wp.components;
export default class SearchBarModal extends React.Component {
constructor(props) {
super(props);
// Initialize state
this.state = {
collectionsPerPage: 24,
collectionId: undefined,
collectionSlug: undefined,
collectionName: '',
isLoadingCollections: false,
modalCollections: [],
totalModalCollections: 0,
collectionOrderBy: 'date-desc',
collectionPage: 1,
temporaryCollectionId: '',
searchCollectionName: '',
collections: [],
collectionsRequestSource: undefined
};
// Bind events
this.resetCollections = this.resetCollections.bind(this);
this.selectCollection = this.selectCollection.bind(this);
this.fetchCollections = this.fetchCollections.bind(this);
this.fetchModalCollections = this.fetchModalCollections.bind(this);
}
componentWillMount() {
this.setState({
temporaryCollectionId: this.props.existingCollectionId,
collectionId: this.props.existingCollectionId,
collectionSlug: this.props.existingCollectionSlug
});
this.setState({ collectionPage: 1 });
this.fetchModalCollections();
}
// COLLECTIONS RELATED --------------------------------------------------
fetchModalCollections() {
let someModalCollections = this.state.modalCollections;
if (this.state.collectionPage <= 1)
someModalCollections = [];
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionPage;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
this.setState({
isLoadingCollections: true,
collectionPage: this.state.collectionPage + 1,
modalCollections: someModalCollections
});
tainacan.get(endpoint)
.then(response => {
let otherModalCollections = this.state.modalCollections;
for (let collection of response.data) {
otherModalCollections.push({
name: collection.name,
id: collection.id,
slug: collection.slug,
header_image: collection.header_image,
tainacan_theme_collection_background_color: collection.tainacan_theme_collection_background_color,
tainacan_theme_collection_color: collection.tainacan_theme_collection_color
});
}
this.setState({
isLoadingCollections: false,
modalCollections: otherModalCollections,
totalModalCollections: response.headers['x-wp-total']
});
return otherModalCollections;
})
.catch(error => {
console.log('Error trying to fetch collections: ' + error);
});
}
selectCollection(selectedCollectionId) {
let selectedCollection;
if (selectedCollectionId == 'default')
selectedCollection = {
label: __('Repository items', 'tainacan'),
name: __('Repository items', 'tainacan'),
id: 'default',
slug: tainacan_plugin.theme_items_list_url.split('/')[tainacan_plugin.theme_items_list_url.split('/').length - 1]
};
else {
selectedCollection = this.state.modalCollections.find((collection) => collection.id == selectedCollectionId)
if (selectedCollection == undefined)
selectedCollection = this.state.collections.find((collection) => collection.id == selectedCollectionId)
}
this.setState({
collectionId: selectedCollection.id,
collectionSlug: selectedCollection.slug
});
this.props.onSelectCollection(selectedCollection);
}
fetchCollections(name) {
if (this.state.collectionsRequestSource != undefined)
this.state.collectionsRequestSource.cancel('Previous collections search canceled.');
let aCollectionRequestSource = axios.CancelToken.source();
this.setState({
collectionsRequestSource: aCollectionRequestSource,
isLoadingCollections: true,
collections: [],
items: []
});
let endpoint = '/collections/?perpage=' + this.state.collectionsPerPage;
if (name != undefined && name != '')
endpoint += '&search=' + name;
if (this.state.collectionOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.collectionOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.collectionOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.collectionOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
tainacan.get(endpoint, { cancelToken: aCollectionRequestSource.token })
.then(response => {
let someCollections = response.data.map((collection) => ({
name: collection.name,
id: collection.id + '',
header_image: collection.header_image,
slug: collection.slug,
tainacan_theme_collection_background_color: collection.tainacan_theme_collection_background_color,
tainacan_theme_collection_color: collection.tainacan_theme_collection_color
}));
this.setState({
isLoadingCollections: false,
collections: someCollections
});
return someCollections;
})
.catch(error => {
console.log('Error trying to fetch collections: ' + error);
});
}
resetCollections() {
this.setState({
collectionId: null,
collectionPage: 1,
modalCollections: []
});
this.fetchModalCollections();
}
cancelSelection() {
this.setState({
modalCollections: []
});
this.props.onCancelSelection();
}
render() {
return <Modal
className="wp-block-tainacan-modal"
title={__('Select a search source to fetch items from', 'tainacan')}
onRequestClose={ () => this.cancelSelection() }
contentLabel={__('Select search source', 'tainacan')}>
<div>
<div className="modal-search-area">
<TextControl
label={__('Search for a collection', 'tainacan')}
placeholder={ __('Search by collection\'s name', 'tainacan') }
value={ this.state.searchCollectionName }
onChange={(value) => {
this.setState({
searchCollectionName: value
});
_.debounce(this.fetchCollections(value), 300);
}}/>
<SelectControl
label={__('Order by', 'tainacan')}
value={ this.state.collectionOrderBy }
options={ [
{ label: __('Latest', 'tainacan'), value: 'date-desc' },
{ label: __('Oldest', 'tainacan'), value: 'date' },
{ label: __('Name (A-Z)', 'tainacan'), value: 'title' },
{ label: __('Name (Z-A)', 'tainacan'), value: 'title-desc' }
] }
onChange={ ( aCollectionOrderBy ) => {
this.state.collectionOrderBy = aCollectionOrderBy;
this.state.collectionPage = 1;
this.setState({
collectionOrderBy: this.state.collectionOrderBy,
collectionPage: this.state.collectionPage
});
if (this.state.searchCollectionName && this.state.searchCollectionName != '') {
this.fetchCollections(this.state.searchCollectionName);
} else {
this.fetchModalCollections();
}
}}/>
</div>
{(
this.state.searchCollectionName != '' ? (
this.state.collections.length > 0 ?
(
<div>
<div className="modal-radio-list">
{
<RadioControl
selected={ this.state.temporaryCollectionId }
options={
this.state.collections.map((collection) => {
return { label: collection.name, value: '' + collection.id }
})
}
onChange={ ( aCollectionId ) => {
this.setState({ temporaryCollectionId: aCollectionId });
} } />
}
</div>
</div>
) :
this.state.isLoadingCollections ? (
<Spinner />
) :
<div className="modal-loadmore-section">
<p>{ __('Sorry, no collection found.', 'tainacan') }</p>
</div>
):
this.state.modalCollections.length > 0 ?
(
<div>
<div className="modal-radio-list">
<p class="modal-radio-area-label">{__('Repository', 'tainacan')}</p>
<RadioControl
className={'repository-radio-option'}
selected={ this.state.temporaryCollectionId }
options={ [{ label: __('Repository items', 'tainacan'), value: 'default', slug: tainacan_plugin.theme_items_list_url.split('/')[tainacan_plugin.theme_items_list_url.split('/').length - 1] }] }
onChange={ ( aCollectionId ) => {
this.setState({ temporaryCollectionId: aCollectionId });
} } />
<hr/>
<p class="modal-radio-area-label">{__('Collections', 'tainacan')}</p>
<RadioControl
selected={ this.state.temporaryCollectionId }
options={
this.state.modalCollections.map((collection) => {
return { label: collection.name, value: '' + collection.id }
})
}
onChange={ ( aCollectionId ) => {
this.setState({ temporaryCollectionId: aCollectionId });
} } />
</div>
<div className="modal-loadmore-section">
<p>{ __('Showing', 'tainacan') + " " + this.state.modalCollections.length + " " + __('of', 'tainacan') + " " + this.state.totalModalCollections + " " + __('collections', 'tainacan') + "."}</p>
{
this.state.modalCollections.length < this.state.totalModalCollections ? (
<Button
isDefault
isSmall
onClick={ () => this.fetchModalCollections() }>
{__('Load more', 'tainacan')}
</Button>
) : null
}
</div>
</div>
) : this.state.isLoadingCollections ? <Spinner/> :
<div className="modal-loadmore-section">
<p>{ __('Sorry, no collection found.', 'tainacan') }</p>
</div>
)}
<div className="modal-footer-area">
<Button
isDefault
onClick={ () => { this.cancelSelection() }}>
{__('Cancel', 'tainacan')}
</Button>
<Button
isPrimary
disabled={ this.state.temporaryCollectionId == undefined || this.state.temporaryCollectionId == null || this.state.temporaryCollectionId == ''}
onClick={ () => { this.selectCollection(this.state.temporaryCollectionId); } }>
{__('Apply source', 'tainacan')}
</Button>
</div>
</div>
</Modal>
}
}

View File

@ -0,0 +1,14 @@
document.addEventListener("DOMContentLoaded",() => {
let form = document.getElementById('taincan-search-bar-block');
if (form) {
form.addEventListener('submit', ((e) => {
e.preventDefault();
let input = document.getElementById('taincan-search-bar-block_input');
if (input) {
if (input.value)
window.location.href = e.target.action + '?search=' + input.value;
return;
}
}));
}
}, false);

View File

@ -0,0 +1,403 @@
@import '../../gutenberg-blocks-style.scss';
.edit-post-sidebar div.components-toolbar {
border: none;
justify-content: center;
}
.wp-block-tainacan-search-bar {
margin: 2rem 0px;
.tainacan-search-container {
width: 100%;
#taincan-search-bar-block {
height: 32px;
max-width: 100%;
display: flex;
justify-content: center;
align-items: stretch;
margin: 0 auto;
border: 1px solid #dbdbdb;
transition: border-color ease 0.3s;
&.is-aligned-left {
margin-left: 0;
justify-content: flex-start;
}
&.is-aligned-right {
margin-right: 0;
justify-content: flex-end;
}
&:hover,
&:focus,
&:active {
border: 1px solid #545758;
}
input#taincan-search-bar-block_input {
width: 100%;
min-width: 28px;
margin: 0;
border: none;
padding: 4px 0.75rem;
text-overflow: ellipsis;
}
button {
height: auto;
display: flex;
align-items: center;
border: none;
box-shadow: none;
border-radius: 0;
background: white;
padding: 4px 1rem;
font-size: 1rem;
.icon {
height: 28px;
svg {
fill: #298596;
}
}
}
@media only screen and (max-width: 768px) {
margin-left: 0px;
margin-right: 0px;
max-width: 100% !important;
input#taincan-search-bar-block_input {
width: 100% !important;
}
}
}
}
.search-bar-collection-header-container {
@media only screen and (max-width: 768px) {
flex-wrap: wrap !important;
.search-bar-collection-header-title {
text-align: center !important;
}
}
}
&.is-style-alternate {
#taincan-search-bar-block {
width: 100%;
display: flex;
flex-direction: row-reverse;
border: none;
&.is-aligned-left {
margin-left: 0;
justify-content: flex-end;
}
&.is-aligned-right {
margin-right: 0;
justify-content: flex-start;
}
&:focus,
&:active,
&:hover {
border: none;
}
input#taincan-search-bar-block_input {
width: 35%;
border-radius: 0;
margin-left: -52px;
padding-left: 52px;
border: 1px solid transparent;
background: rgba(250, 250, 250, 0.2);
transition: border-color 0.4s ease, width 0.5s ease-in, background-color 0.3s ease, color 0.3s ease;
&:focus,
&:active,
&:hover {
width: 100%;
border-color: #cbcbcb;
background:rgba(250, 250, 250, 1);
box-shadow: none;
}
}
button {
margin-right: 0.75rem;
padding: 0 0.35rem;
min-height: 28px;
z-index: 2;
border: none;
background: transparent;
cursor: pointer;
.icon {
svg {
fill: #cbcbcb;
transition: fill 0.4s ease;
}
}
&:hover {
background: transparent;
}
}
@media only screen and (max-width: 768px) {
margin-left: 0px;
margin-right: 0px;
max-width: 100% !important;
input#taincan-search-bar-block_input {
width: 100% !important;
}
}
}
// This style has particular alignments properties.
.search-bar-collection-header-container {
.tainacan-search-container {
#taincan-search-bar-block {
&:focus,
&:active,
&:hover {
input,
input::placeholder {
color: #454647;
border-width: 0;
}
button .icon {
svg {
fill: #cbcbcb !important;
}
}
}
input#taincan-search-bar-block_input {
color: white;
&::placeholder { color: white; }
&:focus,
&:active,
&:hover,
&:focus::placeholder,
&:active::placeholder,
&:hover::placeholder {
color: #454647;
}
}
button .icon {
svg {
fill: #dbdbdb !important;
}
}
}
}
}
}
&.is-style-stylish {
#taincan-search-bar-block {
width: 100%;
height: 53px;
display: flex;
flex-direction: row;
border: none;
&:focus,
&:active,
&:hover {
border: none;
}
&:hover input#taincan-search-bar-block_input {
width: 100%;
padding-right: 52px;
padding-left: 24px;
border-width: 0;
}
input#taincan-search-bar-block_input {
width: 0%;
min-width: 0%;
border-radius: 28px;
margin-right: -56px;
padding-right: 27px;
padding-left: 26px;
font-size: 1rem;
border-width: 0;
background: #f2f2f2;
transition: width 0.5s ease-in;
&:focus,
&:active,
&:hover {
width: 100%;
padding-right: 52px;
padding-left: 24px;
border-width: 0;
}
}
button {
margin-left: 0.75rem;
padding: 0 0.35rem;
min-height: 28px;
z-index: 2;
border: none;
background: transparent;
cursor: pointer;
.icon {
svg {
fill: black;
transition: fill 0.4s ease;
}
}
&:hover {
background: transparent;
}
}
@media only screen and (max-width: 768px) {
}
}
// This style has particular alignments properties.
.search-bar-collection-header-container {
&:not(.is-aligned-right):not(.is-aligned-left) {
.tainacan-search-container {
width: calc(100% - 4.1667% - 53px);
width: calc(100% - 4.1667vw - 53px);
bottom: calc(-50% + 38px);
position: absolute;
}
.search-bar-collection-header-title {
margin-bottom: 26px;
}
}
&.is-aligned-right {
.tainacan-search-container {
width: calc(100% - 4.1667% - 26px);
width: calc(100% - 4.1667vw - 26px);
top: calc(-50% + 26px);
right: calc(4.1667% + 26px);
right: calc(4.1667vw + 26px);
position: absolute;
}
}
&.is-aligned-left {
.tainacan-search-container {
width: calc(100% - 1rem - 26px);
top: calc(-50% + 26px);
left: calc(4.1667% + 26px);
left: calc(4.1667vw + 26px);
position: absolute;
}
}
.tainacan-search-container #taincan-search-bar-block input#taincan-search-bar-block_input {
background: white;
border-width: 3px;
border-style: solid;
margin-right: -56px;
padding-right: 24px;
padding-left: 24px;
&:hover {
border-width: 3px !important;
}
}
@media only screen and (max-width: 768px) {
.tainacan-search-container {
width: calc(100% - 4.1667% - 53px) !important;
width: calc(100% - 4.1667vw - 53px) !important;
bottom: calc(-50% + 38px) !important;
position: absolute !important;
}
&.is-aligned-right,
&.is-aligned-left {
.search-bar-collection-header-title {
margin-bottom: 0px !important;
}
}
}
}
}
// Collection header
.search-bar-collection-header-image {
width: 100%;
min-width: 160px;
min-height: 125px;
background-size: cover;
background-position: center;
background-color: #dbdbdb;
}
.search-bar-collection-header-container {
width: 100%;
min-height: 125px;
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
flex-grow: 2;
padding: 0.5rem 4.1667%;
padding: 0.5rem 4.1667vw;
text-align: center;
text-decoration: none !important;
&.is-aligned-left {
min-height: 100px;
text-align: left;
flex-direction: row-reverse;
flex-wrap: nowrap;
justify-content: space-between;
.search-bar-collection-header-title { text-align: right; }
}
&.is-aligned-right {
min-height: 100px;
text-align: right;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
.search-bar-collection-header-title { text-align: left; }
}
.search-bar-collection-header-title {
width: 100%;
color: white;
h3 {
margin: 0 auto;
text-decoration: none;
font-size: 1.3rem;
line-height: 1.5rem;
text-overflow: ellipsis;
color: inherit;
&:hover {
text-decoration: none;
}
}
span.label {
width: 100%;
display: block;
margin-top: -12px;
font-weight: normal;
font-size: 1rem;
}
}
@media only screen and (max-width: 1024px) {
.search-bar-collection-header-title {
margin-bottom: 1rem;
}
}
}
}

View File

@ -103,26 +103,26 @@
ul.terms-list.terms-layout-list,
ul.terms-list-edit.terms-layout-list {
padding: 0;
display: block;
display: flex;
flex-wrap: wrap;
align-items: center;
list-style-type: none;
li.term-list-item {
position: relative;
display: inline-block;
margin: 12px 12px 24px 12px;
margin-bottom: 12px;
min-height: 54px;
min-width: 22%;
width: 22%;
min-width: calc(20% - 24px);
width: calc(20% - 24px);
a {
color: #454647;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
height: auto;
display: flex;
align-items: center;
height: 54px;
word-break: break-all;
word-break: break-word;
}
img {
@ -141,30 +141,26 @@
color: #454647;
text-decoration: none;
}
}
}
@media only screen and (max-width: 1600px) {
ul.terms-list.terms-layout-list li.term-list-item,
ul.terms-list-edit.terms-layout-list li.term-list-item {
min-width: 30%;
width: 30%;
}
min-width: calc(25% - 24px);
width: calc(25% - 24px);
}
@media only screen and (max-width: 1024px) {
ul.terms-list.terms-layout-list li.term-list-item,
ul.terms-list-edit.terms-layout-list li.term-list-item {
min-width: 45%;
width: 45%;
}
min-width: calc(33.333% - 24px);
width: calc(33.333% - 24px);
}
@media only screen and (max-width: 768px) {
ul.terms-list.terms-layout-list li.term-list-item,
ul.terms-list-edit.terms-layout-list li.term-list-item {
min-width: 100%;
width: 100%;
min-width: calc(50% - 24px);
width: calc(50% - 24px);
}
@media only screen and (max-width: 498px) {
min-width: calc(100% - 24px);
width: calc(100% - 24px);
}
}
}

View File

@ -1,9 +1,8 @@
import tainacan from '../../api-client/axios.js';
import axios from 'axios';
const { __ } = wp.i18n;
const { TextControl, Button, Modal, CheckboxControl, RadioControl, Spinner } = wp.components;
const { TextControl, Button, Modal, CheckboxControl, SelectControl, RadioControl, Spinner } = wp.components;
export default class TermsModal extends React.Component {
constructor(props) {
@ -14,6 +13,7 @@ export default class TermsModal extends React.Component {
modalTerms: [],
totalModalTerms: 0,
termsPerPage: 24,
termOrder: 'asc',
searchTermName: '',
temporarySelectedTerms: [],
terms: [],
@ -22,6 +22,7 @@ export default class TermsModal extends React.Component {
taxonomyName: '',
isLoadingTaxonomies: false,
modalTaxonomies: [],
taxonomyOrderBy: 'date-desc',
totalModalTaxonomies: 0,
taxonomyPage: 1,
temporaryTaxonomyId: '',
@ -120,7 +121,7 @@ export default class TermsModal extends React.Component {
fetchTerms(name) {
let endpoint = '/taxonomy/'+ this.state.taxonomyId + '/terms/?order=asc&hideempty=0&number=' + this.state.termsPerPage;
let endpoint = '/taxonomy/'+ this.state.taxonomyId + '/terms/?order=' + this.state.termOrder + '&hideempty=0&number=' + this.state.termsPerPage;
if (name != undefined && name != '')
endpoint += '&searchterm=' + name;
@ -157,7 +158,7 @@ export default class TermsModal extends React.Component {
if (offset <= 0)
someModalTerms = [];
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?order=asc&hideempty=0&number=' + this.state.termsPerPage + '&offset=' + offset;
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?order=' + this.state.termOrder + '&hideempty=0&number=' + this.state.termsPerPage + '&offset=' + offset;
this.setState({
isLoadingTerms: true,
@ -200,7 +201,16 @@ export default class TermsModal extends React.Component {
if (this.state.taxonomyPage <= 1)
someModalTaxonomies = [];
let endpoint = '/taxonomies/?orderby=title&order=asc&perpage=' + this.state.termsPerPage + '&paged=' + this.state.taxonomyPage;
let endpoint = '/taxonomies/?perpage=' + this.state.termsPerPage + '&paged=' + this.state.taxonomyPage;
if (this.state.taxonomyOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.taxonomyOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.taxonomyOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.taxonomyOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
this.setState({
isLoadingTaxonomies: true,
@ -259,10 +269,19 @@ export default class TermsModal extends React.Component {
terms: []
});
let endpoint = '/taxonomies/?orderby=title&order=asc&perpage=' + this.state.termsPerPage;
let endpoint = '/taxonomies/?perpage=' + this.state.termsPerPage;
if (name != undefined && name != '')
endpoint += '&search=' + name;
if (this.state.taxonomyOrderBy == 'date')
endpoint += '&orderby=date&order=asc';
else if (this.state.taxonomyOrderBy == 'date-desc')
endpoint += '&orderby=date&order=desc';
else if (this.state.taxonomyOrderBy == 'title')
endpoint += '&orderby=title&order=asc';
else if (this.state.taxonomyOrderBy == 'title-desc')
endpoint += '&orderby=title&order=desc';
tainacan.get(endpoint)
.then(response => {
let someTaxonomies = response.data.map((taxonomy) => ({ name: taxonomy.name, id: taxonomy.id + '' }));
@ -301,6 +320,7 @@ export default class TermsModal extends React.Component {
<div>
<div className="modal-search-area">
<TextControl
placeholder={ __('Search by term\'s name', 'tainacan') }
label={__('Search for a term', 'tainacan')}
value={ this.state.searchTermName }
onChange={(value) => {
@ -309,6 +329,24 @@ export default class TermsModal extends React.Component {
});
_.debounce(this.fetchTerms(value), 300);
}}/>
<SelectControl
label={__('Order', 'tainacan')}
value={ this.state.termOrder }
options={ [
{ label: __('Name (A-Z)', 'tainacan'), value: 'asc' },
{ label: __('Name (Z-A)', 'tainacan'), value: 'desc' }
] }
onChange={ ( atermOrder ) => {
this.state.termOrder = atermOrder;
this.setState({
termOrder: this.state.termOrder
});
if (this.state.searchTermName && this.state.searchTermName != '') {
this.fetchTerms(this.state.searchTermName);
} else {
this.fetchModalTerms(0, this.state.taxonomyId);
}
}}/>
</div>
{(
this.state.searchTermName != '' ? (
@ -414,6 +452,7 @@ export default class TermsModal extends React.Component {
<div>
<div className="modal-search-area">
<TextControl
placeholder={ __('Search by taxonomy name', 'tainacan') }
label={__('Search for a taxonomy', 'tainacan')}
value={ this.state.searchTaxonomyName }
onChange={(value) => {
@ -422,6 +461,28 @@ export default class TermsModal extends React.Component {
});
_.debounce(this.fetchTaxonomies(value), 300);
}}/>
<SelectControl
label={__('Order by', 'tainacan')}
value={ this.state.taxonomyOrderBy }
options={ [
{ label: __('Latest', 'tainacan'), value: 'date-desc' },
{ label: __('Oldest', 'tainacan'), value: 'date' },
{ label: __('Name (A-Z)', 'tainacan'), value: 'title' },
{ label: __('Name (Z-A)', 'tainacan'), value: 'title-desc' }
] }
onChange={ ( ataxonomyOrderBy ) => {
this.state.taxonomyOrderBy = ataxonomyOrderBy;
this.state.taxonomyPage = 1;
this.setState({
taxonomyOrderBy: this.state.taxonomyOrderBy,
taxonomyPage: this.state.taxonomyPage
});
if (this.state.searchTaxonomyName && this.state.searchTaxonomyName != '') {
this.fetchTaxonomies(this.state.searchTaxonomyName);
} else {
this.fetchModalTaxonomies();
}
}}/>
</div>
{(
this.state.searchTaxonomyName != '' ? (

View File

@ -79,7 +79,7 @@ class Importer_Handler {
'manual_mapping' => true,
]);
do_action('tainacan_register_importers');
do_action('tainacan-register-importers');
add_action( 'tainacan-enqueue-admin-scripts', array($this, 'enqueue_scripts') );
}

View File

@ -210,7 +210,7 @@ export const fetchAttachments = ({ commit }, { page, attachmentsPerPage, itemId,
axios.wp.get('/media/?parent=' + itemId + '&per_page=' + attachmentsPerPage + '&page=' + page)
.then(res => {
let attachments = res.data.filter((attachment) => attachment.id != documentId);
let total = documentId ? res.headers['x-wp-total'] - 1 : res.headers['x-wp-total'];
let total = (documentId && res.data.length != attachments.length && res.headers['x-wp-total'] > 0) ? res.headers['x-wp-total'] - 1 : res.headers['x-wp-total'];
commit('setAttachments', attachments);
commit('setTotalAttachments', total);

View File

@ -22,9 +22,7 @@ class Mappers_Handler {
public function __construct() {
self::$instance = $this;
$this->register_mapper('Tainacan\Mappers\Dublin_Core');
do_action('tainacan-register-mappers', $this);
add_action('init', array(&$this, 'init'));
add_filter( 'tainacan-admin-i18n', [$this, 'mappers_i18n']);
@ -34,6 +32,12 @@ class Mappers_Handler {
}
function init() {
$this->register_mapper('Tainacan\Mappers\Dublin_Core');
do_action('tainacan-register-mappers', $this);
}
/**
* register mappers class
*

View File

@ -1846,29 +1846,27 @@ var PDFViewerApplication = {
_boundEvents.windowAfterPrint = null;
}
};
var validateFileURL = void 0;
var validateViewerURL = void 0;
{
var HOSTED_VIEWER_ORIGINS = ['null', 'http://mozilla.github.io', 'https://mozilla.github.io'];
validateFileURL = function validateFileURL(file) {
validateViewerURL = function validateViewerURL(file) {
if (file === undefined) {
return;
}
if (window.self != window.top) {
// iframe
var viewerOrigin = window.location.hostname;
try {
var viewerOrigin = new URL(window.location.href).origin || 'null';
if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) {
return;
}
var fileOrigin = new URL(file, window.location.href).origin;
if (fileOrigin !== viewerOrigin) {
throw new Error('file origin does not match viewer\'s');
}
} catch (ex) {
var message = ex && ex.message;
// if parent is in a different domain, it will trigger an error
var parentOrigin = window.parent.location.hostname;
} catch (e) {
var message = 'parent origin does not match viewer\'s';
PDFViewerApplication.l10n.get('loading_error', null, 'An error occurred while loading the PDF.').then(function (loadingErrorMessage) {
PDFViewerApplication.error(loadingErrorMessage, { message: message });
});
throw ex;
throw e;
}
}
};
}
function loadAndEnablePDFBug(enabledTabs) {
@ -1896,7 +1894,7 @@ function webViewerInitialized() {
var queryString = document.location.search.substring(1);
var params = (0, _ui_utils.parseQueryString)(queryString);
file = 'file' in params ? params.file : appConfig.defaultUrl;
validateFileURL(file);
validateViewerURL(file);
var waitForBeforeOpening = [];
var fileInput = document.createElement('input');
fileInput.id = appConfig.openFileInputName;

View File

@ -4,7 +4,7 @@ Tags: museums, libraries, archives, GLAM, collections, repository
Requires at least: 4.8
Tested up to: 5.2.1
Requires PHP: 5.6
Stable tag: 0.10.1
Stable tag: 0.11
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

View File

@ -4,13 +4,13 @@ Plugin Name: Tainacan
Plugin URI: https://tainacan.org/
Description: powerfull and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional respository platform.
Author: Media Lab / UFG
Version: 0.10.1
Version: 0.11
Text Domain: tainacan
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
const TAINACAN_VERSION = '0.10.1';
const TAINACAN_VERSION = '0.11';
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
$TAINACAN_BASE_URL = plugins_url('', __FILE__);

View File

@ -156,7 +156,7 @@
column.metadatum !== 'row_author' &&
column.metadatum !== 'row_title' &&
column.metadatum !== 'row_description'"
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column, column.metadata_type_object.component) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
<span v-if="column.metadatum == 'row_thumbnail'">
<img
@ -190,16 +190,13 @@ export default {
}
},
methods: {
renderMetadata(itemMetadata, column, component) {
renderMetadata(itemMetadata, column) {
let metadata = (itemMetadata != undefined && itemMetadata[column.slug] != undefined) ? itemMetadata[column.slug] : false;
if (!metadata) {
return '';
} else {
if (component != undefined && component == 'tainacan-textarea')
return '<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_string;
else
return '<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_html;
}
}

View File

@ -5,20 +5,27 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
module.exports = {
entry: {
//dev_admin: './src/js/main.js',\
user_search: './src/admin/js/theme-main.js',
user_admin: './src/admin/js/main.js',
//gutenberg_collections_carousel: './src/gutenberg-blocks/tainacan-collections/collections-carousel/index.js',
// gutenberg_items_grid: './src/gutenberg-blocks/tainacan-items/items-grid/index.js',
gutenberg_terms_list: './src/gutenberg-blocks/tainacan-terms/terms-list/index.js',
gutenberg_items_list: './src/gutenberg-blocks/tainacan-items/items-list/index.js',
gutenberg_dynamic_items_list: './src/gutenberg-blocks/tainacan-items/dynamic-items-list/index.js',
gutenberg_dynamic_items_list_theme: './src/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list-theme.js',
gutenberg_carousel_items_list: './src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js',
gutenberg_carousel_items_list_theme: './src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.js',
gutenberg_search_bar: './src/gutenberg-blocks/tainacan-items/search-bar/index.js',
gutenberg_search_bar_script: './src/gutenberg-blocks/tainacan-items/search-bar/search-bar-theme-script.js',
gutenberg_collections_list: './src/gutenberg-blocks/tainacan-collections/collections-list/index.js',
gutenberg_carousel_collections_list: './src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js',
gutenberg_carousel_collections_list_theme: './src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list-theme.js',
gutenberg_facets_list: './src/gutenberg-blocks/tainacan-facets/facets-list/index.js',
gutenberg_facets_list_theme: './src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.js'
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 KiB

After

Width:  |  Height:  |  Size: 569 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 41 KiB