Merge tag '0.18' into develop

release 0.18
This commit is contained in:
vnmedeiros 2021-06-07 15:08:36 -03:00
commit 92fb758c82
141 changed files with 2994 additions and 1700 deletions

View File

@ -2,8 +2,8 @@ sudo: true
language: php
php:
#- 8.0
- 7.1
- 7.2
- 7.1
- 5.6
matrix:
allow_failures:
@ -33,7 +33,7 @@ install:
- sudo mv ./tests/bootstrap-config-sample.php ./tests/bootstrap-config.php
- sudo ./tests/bin/install-wp-tests.sh test travis "" /tmp/wordpress localhost latest
true
- composer install
- if [[ $TRAVIS_PHP_VERSION = 7.1 || $TRAVIS_PHP_VERSION = 5.6 ]]; then composer install --ignore-platform-reqs; else composer install; fi
- sudo mkdir /tmp/wordpress/wordpress-test/wp-content/uploads
- sudo chmod -R 777 /tmp/wordpress/wordpress-test/wp-content/uploads
- sudo wget https://phar.phpunit.de/phpunit-6.5.7.phar -P /tmp

View File

@ -19,7 +19,7 @@ if [ $current_OS == "Darwin" ]; then
find ./package.json -type f \( -name "package.json" -or -name "package-lock.json" \) -exec md5 {} \; | sort -k 2 | md5 > last-package-build.md5
else
find src *.js -type f \( -name "*.js" -or -name "*.vue" -or -name "webpack.common.js" -or -name "webpack.dev.js" -or -name "webpack.prod.js" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-js-build.md5
find ./src/views/admin/scss/ ./src/views/gutenberg-blocks ./src/views/gutenberg-blocks/tainacan-collections/collections-list ./src/views/gutenberg-blocks/tainacan-facets/facets-list ./src/views/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/views/gutenberg-blocks/tainacan-items/items-list ./src/views/gutenberg-blocks/tainacan-terms/terms-list -type f \( -name "*.scss" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-sass-build.md5
find ./src/views/admin/scss/ ./src/views/roles/ ./src/views/media-component/ ./src/views/reports/ ./src/views/gutenberg-blocks ./src/views/gutenberg-blocks/tainacan-collections/collections-list ./src/views/gutenberg-blocks/tainacan-facets/facets-list ./src/views/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/views/gutenberg-blocks/tainacan-items/items-list ./src/views/gutenberg-blocks/tainacan-terms/terms-list -type f \( -name "*.scss" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-sass-build.md5
find ./composer.json -type f \( -name "composer.json" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-composer-build.md5
find ./package.json -type f \( -name "package.json" -or -name "package-lock.json" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-package-build.md5
fi

View File

@ -12,7 +12,6 @@ sass -E 'UTF-8' --cache-location .tmp/sass-cache-1 src/views/admin/scss/tainacan
sass -E 'UTF-8' --cache-location .tmp/sass-cache-2 src/views/roles/tainacan-roles.scss:src/assets/css/tainacan-roles.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-3 src/views/reports/tainacan-reports.scss:src/assets/css/tainacan-reports.css
sass -E 'UTF-8' --cache-location .tmp/sass-cache-4 src/views/media-component/media-component.scss:src/assets/css/media-component.css

View File

@ -18,7 +18,7 @@
"platform-check": false
},
"scripts": {
"post-install-cmd": "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/wimg/php-compatibility",
"post-update-cmd" : "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/wimg/php-compatibility"
"post-install-cmd": "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/phpcompatibility/php-compatibility",
"post-update-cmd" : "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/phpcompatibility/php-compatibility"
}
}

22
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "977d4fe3cad3f53c6559a0cc2656dcc1",
"content-hash": "8eb9217097c6d62dba6409b24f81c0ad",
"packages": [
{
"name": "kornrunner/blurhash",
@ -164,16 +164,16 @@
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.22.0",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13"
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
"reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
"shasum": ""
},
"require": {
@ -185,7 +185,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.22-dev"
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -223,6 +223,9 @@
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
@ -237,7 +240,7 @@
"type": "tidelift"
}
],
"time": "2021-01-07T16:49:33+00:00"
"time": "2020-10-23T14:02:19+00:00"
}
],
"packages-dev": [
@ -358,8 +361,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"platform-overrides": {
"php": "7.2"
},
"plugin-api-version": "1.1.0"
"plugin-api-version": "2.0.0"
}

119
package-lock.json generated
View File

@ -1666,9 +1666,9 @@
}
},
"apexcharts": {
"version": "3.24.0",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.24.0.tgz",
"integrity": "sha512-iT6czJCIVrmAtrcO90MZTQCvC+xi6R6Acf0jNH/d40FVTtCfcqECuKIh5iAMyOTtgUb7+fQ8rbadH2bm1kbL9Q==",
"version": "3.26.3",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.26.3.tgz",
"integrity": "sha512-zbP7RBBV2CGffoVMIuTCUG64YbEUzV8IIT7iNVLMtY/OAVXTjPksDxSqKIniTvgJoscKe6sx4P56qDpBSU19VA==",
"requires": {
"svg.draggable.js": "^2.2.2",
"svg.easing.js": "^2.0.0",
@ -3724,9 +3724,9 @@
}
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"ms": {
@ -5471,9 +5471,9 @@
"dev": true
},
"hosted-git-info": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg=="
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="
},
"hpack.js": {
"version": "2.1.6",
@ -5851,9 +5851,9 @@
"dev": true
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"string-width": {
@ -6459,9 +6459,15 @@
}
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.difference": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
"integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=",
"dev": true
},
"loglevel": {
"version": "1.6.8",
@ -6836,6 +6842,15 @@
"resolved": "https://registry.npmjs.org/moment/-/moment-2.25.3.tgz",
"integrity": "sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg=="
},
"moment-locales-webpack-plugin": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/moment-locales-webpack-plugin/-/moment-locales-webpack-plugin-1.2.0.tgz",
"integrity": "sha512-QAi5v0OlPUP7GXviKMtxnpBAo8WmTHrUNN7iciAhNOEAd9evCOvuN0g1N7ThIg3q11GLCkjY1zQ2saRcf/43nQ==",
"dev": true,
"requires": {
"lodash.difference": "^4.5.0"
}
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
@ -8280,9 +8295,9 @@
"dev": true
},
"querystringify": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
"dev": true
},
"randombytes": {
@ -8452,8 +8467,7 @@
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
},
"regenerator-transform": {
"version": "0.14.4",
@ -10123,9 +10137,9 @@
"dev": true
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"string-width": {
@ -10708,9 +10722,9 @@
}
},
"url-parse": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz",
"integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==",
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
"dev": true,
"requires": {
"querystringify": "^2.1.1",
@ -10749,13 +10763,29 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"v-tooltip": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.0.3.tgz",
"integrity": "sha512-KZZY3s+dcijzZmV2qoDH4rYmjMZ9YKGBVoUznZKQX0e3c2GjpJm3Sldzz8HHH2Ud87JqhZPB4+4gyKZ6m98cKQ==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.1.3.tgz",
"integrity": "sha512-xXngyxLQTOx/yUEy50thb8te7Qo4XU6h4LZB6cvEfVd9mnysUxLEoYwGWDdqR+l69liKsy3IPkdYff3J1gAJ5w==",
"requires": {
"lodash": "^4.17.15",
"popper.js": "^1.16.0",
"vue-resize": "^0.4.5"
"@babel/runtime": "^7.13.10",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"vue-resize": "^1.0.1"
},
"dependencies": {
"@babel/runtime": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz",
"integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}
}
},
"v8-compile-cache": {
@ -10801,9 +10831,9 @@
"integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ=="
},
"vue-apexcharts": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/vue-apexcharts/-/vue-apexcharts-1.6.0.tgz",
"integrity": "sha512-sT6tuVTLBwfH3TA7azecDNS/W70bmz14ZJI7aE7QIqcG9I6OywyH7x3hcOeY1v1DxttI8Svc5RuYj4Dd+A5F4g=="
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/vue-apexcharts/-/vue-apexcharts-1.6.1.tgz",
"integrity": "sha512-ILn3/55IvZQUgsc7+jKDjPfHfGUlcUQi/lDrLjRe5g7gfjj99o8otXoHwMeib3CBHYdQXNG9foe1vzv7RdUzXA=="
},
"vue-awesome-swiper": {
"version": "4.1.1",
@ -10887,9 +10917,22 @@
"integrity": "sha512-viecHQiHVLez7HlYUQsv1wJb2MT/RDSzkDp6m3In41vPrk6OsBmT2qRE8LZqYIA4daIwrnx/Xm8h4fjOpuE3hw=="
},
"vue-resize": {
"version": "0.4.5",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-0.4.5.tgz",
"integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg=="
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-1.0.1.tgz",
"integrity": "sha512-z5M7lJs0QluJnaoMFTIeGx6dIkYxOwHThlZDeQnWZBizKblb99GSejPnK37ZbNE/rVwDcYcHY+Io+AxdpY952w==",
"requires": {
"@babel/runtime": "^7.13.10"
},
"dependencies": {
"@babel/runtime": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz",
"integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
}
}
},
"vue-router": {
"version": "3.1.6",

View File

@ -8,7 +8,7 @@
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.prod.js --display-error-details --progress --hide-modules"
},
"dependencies": {
"apexcharts": "^3.24.0",
"apexcharts": "^3.26.3",
"countup.js": "^2.0.7",
"axios": "^0.21.1",
"blurhash": "^1.1.3",
@ -24,9 +24,9 @@
"react-dom": "^16.13.1",
"swiper": "^5.2.0",
"t": "^0.5.1",
"v-tooltip": "^2.0.3",
"v-tooltip": "^2.1.3",
"vue": "^2.6.11",
"vue-apexcharts": "^1.6.0",
"vue-apexcharts": "^1.6.1",
"vue-awesome-swiper": "^4.1.1",
"vue-blurhash": "^0.1.4",
"vue-countup-v2": "^4.0.0",
@ -49,6 +49,7 @@
"eslint-loader": "^2.2.1",
"eslint-plugin-vue": "^5.2.3",
"file-loader": "^2.0.0",
"moment-locales-webpack-plugin": "^1.2.0",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.3.1",
"style-loader": "^0.23.1",

View File

@ -657,7 +657,6 @@ a.pswp__share--download:hover {
.tainacan-media-component__swiper-main li.swiper-slide {
height: 100%;
max-width: calc(100% - var(--swiper-navigation-size, 44px) - var(--swiper-navigation-size, 44px));
min-width: 100%;
padding: 0 var(--swiper-navigation-size, 44px);
opacity: 1.0;
transition: opacity 0.2s linear; }
@ -687,17 +686,37 @@ a.pswp__share--download:hover {
.tainacan-media-component__swiper-main .swiper-slide-content {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-embed-container {
display: block;
text-align: center; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed {
width: 100%;
height: auto; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-has-aspect-ratio {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 2) / 1);
/* Default to 2:1 aspect ratio. */
margin-left: auto;
margin-right: auto; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-21-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 21) / 9); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-18-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 18) / 9); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-16-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 16) / 9); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-4-3 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 4) / 3); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-1-1 {
max-width: var(--tainacan-media-main-carousel-height, 60vh); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-3-4 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 3) / 4); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-9-16 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 9) / 16); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-1-2 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 1) / 2); }
.tainacan-media-component__swiper-main .swiper-slide-content iframe {
max-height: var(--tainacan-media-main-carousel-height, 60vh);
width: 100%;
max-width: 100%;
margin-left: auto;
margin-right: auto;
border: none;
display: block;
background-image: url("../images/preloader.gif");
@ -708,7 +727,8 @@ a.pswp__share--download:hover {
z-index: 99;
background: var(--tainacan-media-background, #ffffff);
border-radius: 3px;
word-wrap: break-word; }
word-wrap: break-word;
padding: 1rem 2rem; }
.tainacan-media-component__swiper-main .swiper-slide-content audio {
background: black;
min-height: 38px;
@ -724,6 +744,9 @@ a.pswp__share--download:hover {
.tainacan-media-component__swiper-main .swiper-slide-content img {
width: auto;
max-height: var(--tainacan-media-main-carousel-height, 60vh); }
.tainacan-media-component__swiper-main .swiper-slide-content .twitter-tweet {
margin-left: auto;
margin-right: auto; }
.tainacan-media-component__swiper-thumbs {
width: 100%;
@ -833,27 +856,53 @@ a.pswp__share--download:hover {
justify-content: center; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image {
width: 100%;
height: 100%;
height: calc(100% - 44px);
display: flex;
justify-content: center;
align-items: center;
justify-content: center; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image.tainacan-embed-container:not(.tainacan-embed-without-iframe) {
padding: 0px; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image .tainacan-embed-container .twitter-tweet {
width: 100vw !important; }
.tainacan-photoswipe-layer .pswp__container iframe {
text-align: center;
padding: 44px;
min-height: 90vh;
max-height: 90vh;
height: 100%;
width: 100%;
max-width: 100%;
margin: 0 auto;
margin-top: 22px; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image > iframe:not(.wp-embedded-content) {
width: 90vw;
height: 90vh;
border: none;
margin: 44px;
display: block;
background-image: url("../images/preloader.gif");
background-repeat: no-repeat;
background-position: center; }
.tainacan-photoswipe-layer .pswp__container .pswp__zoom-wrap > iframe#iframePDF {
width: 90vw;
height: 90vh;
border: none;
margin: 44px auto;
display: block;
background-image: url("../images/preloader.gif");
background-repeat: no-repeat;
background-position: center; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed {
width: 100%;
height: auto; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-has-aspect-ratio {
max-width: calc((90vh * 2) / 1);
/* Default to 2:1 aspect ratio. */
margin-left: auto;
margin-right: auto; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-21-9 {
max-width: calc((90vh * 21) / 9); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-18-9 {
max-width: calc((90vh * 18) / 9); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-16-9 {
max-width: calc((90vh * 16) / 9); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-4-3 {
max-width: calc((90vh * 4) / 3); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-1-1 {
max-width: 90vh; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-9-16 {
max-width: calc((90vh * 9) / 16); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-1-2 {
max-width: calc((90vh * 1) / 2); }
.tainacan-photoswipe-layer .pswp__container a:first-of-type,
.tainacan-photoswipe-layer .pswp__container p:first-of-type,
.tainacan-photoswipe-layer .pswp__container article:first-of-type {

File diff suppressed because one or more lines are too long

View File

@ -1,44 +1,64 @@
.tainacan-embed-container {
position: relative;
height: 0;
overflow: hidden;
/* TAINACAN EMBEDS
* This file copies most of Gutenberg's logic for responsive blocks,
* but uses different classes to avoid future conflicts.
* Check their original css: /packages/block-library/src/embed/style.scss
*/
/*
* The embed container is in a `figure` element, and many themes zero this out.
* This rule explicitly sets it, to ensure at least some bottom-margin in the flow.
*/
:not(.wp-block-embed__wrapper)>.tainacan-content-embed {
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
clear: both;
}
/* Don't allow iframe to overflow it's container. */
:not(.wp-block-embed__wrapper)>.tainacan-content-embed iframe {
max-width: 100%;
height: auto;
}
.tainacan-embed-container:not(.tainacan-embed-without-iframe) {
padding-bottom: 56.25%;
padding-top: 30px;
width: 100%;
margin: auto;
}
.tainacan-embed-container .twitter-tweet {
margin: 0 auto;
}
.tainacan-embed-container iframe.wp-embedded-content {
display: flex !important;
align-items: center;
justify-content: center;
margin: auto !important;
width: auto !important;
top: 50%;
bottom: 50%;
}
@media screen and (max-width: 1024px) {
.tainacan-embed-container iframe.wp-embedded-content {
:not(.wp-block-embed__wrapper)>.tainacan-content-embed .tainacan-content-embed__wrapper {
position: relative;
}
}
.tainacan-embed-container #tainacan-attachment-iframe { /* PDF */
width: 100%;
/* Add responsiveness to embeds with aspect ratios. */
:not(.wp-block-embed__wrapper)>.tainacan-has-aspect-ratio .tainacan-content-embed__wrapper::before {
content: "";
display: block;
padding-top: 50%; /* Default to 2:1 aspect ratio. */
}
.tainacan-embed-container iframe,
.tainacan-embed-container object,
.tainacan-embed-container embed {
:not(.wp-block-embed__wrapper)>.tainacan-has-aspect-ratio iframe {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
width: 100%;
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-21-9 .tainacan-content-embed__wrapper::before {
padding-top: 42.85%; /* 9 / 21 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-18-9 .tainacan-content-embed__wrapper::before {
padding-top: 50%; /* 9 / 18 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-16-9 .tainacan-content-embed__wrapper::before {
padding-top: 56.25%; /* 9 / 16 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-4-3 .tainacan-content-embed__wrapper::before {
padding-top: 75%; /* 3 / 4 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-1-1 .tainacan-content-embed__wrapper::before {
padding-top: 100%; /* 1 / 1 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-9-16 .tainacan-content-embed__wrapper::before {
padding-top: 177.77%; /* 16 / 9 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-3-4 .tainacan-content-embed__wrapper::before {
padding-top: 133.33%; /* 4 / 3 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-1-2 .tainacan-content-embed__wrapper::before {
padding-top: 200%; /* 2 / 1 * 100 */
}

View File

@ -158,6 +158,10 @@
.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-checkbox-list .components-radio-control__option .components-radio-control__input,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option .components-radio-control__input {
min-width: 20px;
min-height: 20px; }
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option .components-radio-control__input::before,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option .components-radio-control__input::before {
border-width: 0px; }

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAIA,KAAM;EACF,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,wBAAwB,CAAC,QAAY;;AAIzC,kDAAmD;EAC/C,WAAW,EAAE,iBAAiB;EAC9B,aAAa,EAAE,YAAY;EAC3B,UAAU,EAAE,oCAAmC;EAE/C,iFAA+B;IAC3B,aAAa,EAAE,CAAC;EAEpB,oFAAkC;IAC9B,OAAO,EAAE,IAAI;IACb,cAAc,EAAE,GAAG;IACnB,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,CAAC;IAEV,sFAAE;MACE,SAAS,EAAE,cAAc;MACzB,MAAM,EAAE,IAAI;MACZ,KAAK,EAAE,oCAAmC;MAC1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,EAAE,GAAG;EAGzB,gDAAwB;IACpB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,MAAM;IAEvB,kDAAE;MACE,KAAK,EAAE,oCAAmC;MAC1C,YAAY,EAAE,IAAI;MAClB,UAAU,EAAE,GAAG;EAGvB,2CAAmB;IACf,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,aAAa;IAC9B,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,OAAO;IAEf,6CAAE;MACE,OAAO,EAAE,MAAM;MACf,KAAK,EAAE,oCAAmC",
"sources": ["../../views/gutenberg-blocks/gutenberg-blocks-style.scss","../../views/gutenberg-blocks/gutenberg-blocks-variables.scss"],
"names": [],
"file": "tainacan-gutenberg-block-common-styles.css"

View File

@ -5,8 +5,59 @@
opacity: 0.0; }
#tainacan-reports-app a:hover {
cursor: pointer; }
#tainacan-reports-app .wp-heading-inline {
margin-bottom: 2rem; }
#tainacan-reports-app .tainacan-reports-header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 10px 24px 10px 0px; }
#tainacan-reports-app .tainacan-reports-header .wp-heading-inline {
margin: 0rem; }
#tainacan-reports-app .tainacan-reports-header select {
margin-right: auto;
margin-left: 6px; }
#tainacan-reports-app .tainacan-reports-subheader {
display: flex;
align-items: center;
margin: 6px 0px 36px 0px;
color: var(--tainacan-block-gray4, #555758); }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box:not(:first-child) {
padding-left: 14px;
border-left: 1px solid var(--tainacan-block-gray3, #cbcbcb); }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__title {
font-weight: bold;
margin-left: 2px; }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content {
display: flex;
align-items: center;
margin: 0px 14px 0px 0px;
flex-wrap: wrap; }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--two-columns li {
flex-basis: calc(50% - 8px); }
@media screen and (max-width: 986px) {
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--two-columns li {
flex-basis: 100%; } }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--three-columns li {
flex-basis: calc(33.3333% - 8px); }
@media screen and (max-width: 1024px) {
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--three-columns li {
flex-basis: calc(50% - 8px); } }
@media screen and (max-width: 768px) {
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content.tainacan-reports-subheader-box__content--three-columns li {
flex-basis: 100%; } }
#tainacan-reports-app .tainacan-reports-subheader .tainacan-reports-subheader-box__content li {
display: flex;
align-items: center;
margin: 0px 8px 0px 0px;
flex-basis: 100%; }
#tainacan-reports-app .tainacan-reports-subheader .icon svg {
fill: var(--tainacan-block-gray4, #555758);
margin-left: -0.5rem;
cursor: default; }
#tainacan-reports-app .tainacan-reports-subheader .apexcharts-pan-icon svg {
fill: transparent;
stroke: var(--tainacan-block-gray4, #555758); }
#tainacan-reports-app .tainacan-reports-subheader .apexcharts-reset-icon {
margin-left: 0; }
#tainacan-reports-app .columns {
max-width: 100%;
align-items: flex-start;
@ -57,6 +108,16 @@
#tainacan-reports-app .postbox .box-header .box-header__item {
margin-bottom: 10px;
line-height: 2rem; }
#tainacan-reports-app .empty-postbox-placeholder {
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
min-height: 380px;
flex-direction: column;
opacity: 0.75; }
#tainacan-reports-app .empty-postbox-placeholder p {
color: var(--tainacan-block-gray4, #555758); }
#tainacan-reports-app .graph-mode-switch {
display: inline-block; }
#tainacan-reports-app .graph-mode-switch button {
@ -92,5 +153,8 @@
#tainacan-reports-app .tainacan-custom-tooltip .tainacan-custom-tooltip__body p {
margin-bottom: 4px;
font-size: 0.85rem; }
#tainacan-reports-app .apexcharts-legend-series {
display: flex;
align-items: center; }
/*# sourceMappingURL=tainacan-reports.css.map */

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAAA,qBAAsB;EAClB,OAAO,EAAE,iBAAiB;EAC1B,MAAM,EAAE,CAAC;EAGT,4CAAuB;IACnB,OAAO,EAAE,GAAG;EAGhB,6BAAQ;IACJ,MAAM,EAAE,OAAO;EAGnB,wCAAmB;IACf,aAAa,EAAE,IAAI;EAGvB,8BAAS;IACL,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,MAAM;IAEvB,sCAAQ;MACJ,SAAS,EAAE,IAAI;MACf,OAAO,EAAE,CAAC;MACV,QAAQ,EAAE,QAAQ;MAClB,UAAU,EAAE,WAAW;MAEvB,+CAAS;QACL,MAAM,EAAE,OAAO;MAEnB,0DAAoB;QAChB,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,mBAAmB;QAC3B,KAAK,EAAE,mBAAmB;QAC1B,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,QAAQ;QACjB,gBAAgB,EAAE,oCAAoC;QACtD,KAAK,EAAE,oCAAoC;QAC3C,SAAS,EAAE,OAAO;QAClB,sBAAsB,EAAE,GAAG;QAC3B,OAAO,EAAE,GAAG;QACZ,UAAU,EAAE,iBAAiB;QAE7B,iEAAO;UACH,MAAM,EAAE,IAAI;UACZ,UAAU,EAAE,IAAI;UAChB,MAAM,EAAE,OAAO;UAEf,uEAAQ;YACJ,KAAK,EAAE,oCAAoC;MAIvD;;sEAE0B;QACtB,OAAO,EAAE,GAAG;EAKxB,8BAAS;IACL,OAAO,EAAE,gBAAgB;IACzB,aAAa,EAAE,CAAC;IAChB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,oCAAoC;IAEtD,oCAAM;MACF,WAAW,EAAE,IAAI;MACjB,SAAS,EAAE,QAAQ;IAG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;MAEf,uDAAU;QACN,KAAK,EAAE,oCAAoC;EAKvD,8CAAyB;IACrB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,UAAU;IACvB,cAAc,EAAE,MAAM;IAEtB,+EAAiC;MAC7B,gBAAgB,EAAE,oCAAoC;MACtD,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,UAAU;MAC3B,WAAW,EAAE,MAAM;MACnB,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,iBAAiB;IAG9B,gHAAgE;MAC5D,OAAO,EAAE,iBAAiB;IAE9B,6EAA+B;MAC3B,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,QAAQ;MACjB,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,MAAM;MACvB,WAAW,EAAE,UAAU;MACvB,cAAc,EAAE,MAAM;MAEtB,+EAAE;QACE,aAAa,EAAE,GAAG;QAClB,SAAS,EAAE,OAAO;EAK9B,+CAA0B;IACtB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,MAAM",
"sources": ["../../views/reports/tainacan-reports.scss"],
"names": [],
"file": "tainacan-reports.css"

View File

@ -7,7 +7,7 @@
url("../fonts/TainacanIcons.woff") format("woff"),
url("../fonts/TainacanIcons.ttf") format("truetype"),
url("../fonts/TainacanIcons.svg") format("svg");
font-weight: normal;
font-weight: normal;
font-style: normal;
text-rendering: optimizeLegibility;
}

View File

@ -382,8 +382,9 @@ class REST_Bulkedit_Controller extends REST_Controller {
global $Tainacan_Generic_Process_Handler;
$process = $Tainacan_Generic_Process_Handler->get_process_instance_by_session_id($bulk_id);
if ($process !== false) {
$bulk_edit_value = isset($body['new_value']) ? $body['new_value'] : (isset($body['value']) ? $body['value'] : null);
$bulk_edit_data = [
"value" => isset($body['new_value']) ? $body['new_value'] : $body['value'],
"value" => $bulk_edit_value,
"method" => $method,
"old_value" => isset($body['old_value']) ? $body['old_value'] : null,
"metadatum_id" => isset($body['metadatum_id']) ? $body['metadatum_id'] : null,

View File

@ -883,7 +883,7 @@ class REST_Items_Controller extends REST_Controller {
return new \WP_REST_Response( [
'error_message' => __( 'Please verify, invalid value(s)', 'tainacan' ),
'errors' => $item_metadata->get_errors(),
'item_metadata' => $this->prepare_item_for_response($item_metadata, $request),
'item_metadata' => $this->prepare_item_for_response($item_metadata->get_item(), $request),
], 400 );
}
}

View File

@ -35,10 +35,10 @@ class REST_Reports_Controller extends REST_Controller {
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -56,10 +56,10 @@ class REST_Reports_Controller extends REST_Controller {
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -77,10 +77,10 @@ class REST_Reports_Controller extends REST_Controller {
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -98,10 +98,10 @@ class REST_Reports_Controller extends REST_Controller {
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -119,10 +119,10 @@ class REST_Reports_Controller extends REST_Controller {
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -140,10 +140,10 @@ class REST_Reports_Controller extends REST_Controller {
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -161,10 +161,10 @@ class REST_Reports_Controller extends REST_Controller {
'permission_callback' => array($this, 'reports_permissions_check'),
'args' => [
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -192,10 +192,10 @@ class REST_Reports_Controller extends REST_Controller {
'format' => 'date-time', // RFC3339. https://tools.ietf.org/html/rfc3339#section-5.8
],
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -223,10 +223,10 @@ class REST_Reports_Controller extends REST_Controller {
'format' => 'date-time', // RFC3339. https://tools.ietf.org/html/rfc3339#section-5.8
],
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -248,10 +248,10 @@ class REST_Reports_Controller extends REST_Controller {
'type' => 'integer',
],
'force' => [
'title' => __( 'Force regenerete', 'tainacan' ),
'title' => __( 'Force regenerate', 'tainacan' ),
'type' => 'string',
'default' => 'no',
'description' => __( 'Force generates the reports graphic.', 'tainacan' ),
'description' => __( 'Force generating the report, despite presence of cache.', 'tainacan' ),
'enum' => array(
'no',
'yes'
@ -264,7 +264,7 @@ class REST_Reports_Controller extends REST_Controller {
}
public function reports_permissions_check($request) {
return true;
return \is_user_logged_in() && current_user_can('read');
}
public function get_collections($request) {
@ -311,7 +311,9 @@ class REST_Reports_Controller extends REST_Controller {
'trash' => 0,
'draft' => 0,
'publish' => 0,
'private' => 0
'private' => 0,
'restrict' => 0,
'not_restrict' => 0
)
)
);
@ -333,13 +335,24 @@ class REST_Reports_Controller extends REST_Controller {
$response['totals']['items']['draft'] = intval($total_items->draft);
$response['totals']['items']['publish'] = intval($total_items->publish);
$response['totals']['items']['private'] = intval($total_items->private);
if ( \is_post_status_viewable( $collection->get_status() ) === true ) {
$response['totals']['items']['not_restrict'] += isset($total_items->publish) ? intval($total_items->publish) : 0;
} else {
$response['totals']['items']['restrict'] += (
//(isset($total_items->trash) ? intval($total_items->trash) : 0) +
(isset($total_items->draft) ? intval($total_items->draft) : 0) +
(isset($total_items->publish) ? intval($total_items->publish) : 0) +
(isset($total_items->private) ? intval($total_items->private) : 0)
);
}
}
} else {
$key_cache_object = 'summary';
$cached_object = $this->get_cache_object($key_cache_object, $request);
if($cached_object !== false ) return new \WP_REST_Response($cached_object, 200);
$collections = $this->collections_repository->fetch([]);
$collections = $this->collections_repository->fetch(['status'=> ['publish', 'private', 'trash']]);
$response['totals']['collections'] = array(
'total' => 0,
'trash' => 0,
@ -354,12 +367,20 @@ class REST_Reports_Controller extends REST_Controller {
$response['totals']['collections']['total']++;
$total_items = wp_count_posts( $collection->get_db_identifier(), 'readable' );
if (isset($total_items->publish) || isset($total_items->private) ||
isset($total_items->trash) || isset($total_items->draft)) {
$response['totals']['items']['trash'] += $total_items->trash;
$response['totals']['items']['draft'] += $total_items->draft;
$response['totals']['items']['publish'] += $total_items->publish;
$response['totals']['items']['private'] += $total_items->private;
$response['totals']['items']['trash'] += isset($total_items->trash) ? intval($total_items->trash) : 0;
$response['totals']['items']['draft'] += isset($total_items->draft) ? intval($total_items->draft) : 0;
$response['totals']['items']['publish'] += isset($total_items->publish)? intval($total_items->publish) : 0;
$response['totals']['items']['private'] += isset($total_items->private)? intval($total_items->private) : 0;
if ( \is_post_status_viewable( $collection->get_status() ) === true ) {
$response['totals']['items']['not_restrict'] += isset($total_items->publish) ? intval($total_items->publish) : 0;
} else {
$response['totals']['items']['restrict'] += (
//(isset($total_items->trash) ? intval($total_items->trash) : 0) +
(isset($total_items->draft) ? intval($total_items->draft) : 0) +
(isset($total_items->publish) ? intval($total_items->publish) : 0) +
(isset($total_items->private) ? intval($total_items->private) : 0)
);
}
}
wp_reset_postdata();
@ -376,20 +397,14 @@ class REST_Reports_Controller extends REST_Controller {
);
$total_taxonomies = wp_count_posts( 'tainacan-taxonomy', 'readable' );
if (isset($total_taxonomies->publish) ||
isset($total_taxonomies->private) ||
isset($total_taxonomies->trash) ||
isset($total_taxonomies->draft)) {
$response['totals']['taxonomies']['trash'] = intval($total_taxonomies->trash);
$response['totals']['taxonomies']['publish'] = intval($total_taxonomies->publish);
$response['totals']['taxonomies']['draft'] = intval($total_taxonomies->draft);
$response['totals']['taxonomies']['private'] = intval($total_taxonomies->private);
$response['totals']['taxonomies']['trash'] = isset($total_taxonomies->trash) ? intval($total_taxonomies->trash) : 0;
$response['totals']['taxonomies']['draft'] = isset($total_taxonomies->draft) ? intval($total_taxonomies->draft) : 0;
$response['totals']['taxonomies']['publish'] = isset($total_taxonomies->publish)? intval($total_taxonomies->publish) : 0;
$response['totals']['taxonomies']['private'] = isset($total_taxonomies->private)? intval($total_taxonomies->private) : 0;
$response['totals']['taxonomies']['total'] = $response['totals']['taxonomies']['trash'] + $response['totals']['taxonomies']['publish'] + $response['totals']['taxonomies']['draft'] + $response['totals']['taxonomies']['private'];
$response['totals']['taxonomies']['used'] = $this->query_count_used_taxononomies();
$response['totals']['taxonomies']['not_used'] = $response['totals']['taxonomies']['total'] - $response['totals']['taxonomies']['used'];
}
}
$response['totals']['items']['total'] = ($response['totals']['items']['trash'] + $response['totals']['items']['draft'] + $response['totals']['items']['publish'] + $response['totals']['items']['private']);
$this->set_cache_object($key_cache_object, $response);
return new \WP_REST_Response($response, 200);
@ -550,11 +565,23 @@ class REST_Reports_Controller extends REST_Controller {
}
$response['totals']['metadata'][$metadatum->get_status()]++;
$response['totals']['metadata_per_type'][$meta_type]['name'] = $meta_type_name;
if ( !isset($response['totals']['metadata_per_type'][$meta_type]) ) {
$response['totals']['metadata_per_type'][$meta_type] = array(
'name' => $meta_type_name,
'count' => 0,
);
}
$response['totals']['metadata_per_type'][$meta_type]['count']++;
if ( $metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\Compound' ) {
$metadatum_childs = $this->metadatum_repository->fetch(['parent' => $metadatum->get_id()], 'OBJECT');
foreach($metadatum_childs as $childs) {
$meta_ids[] = $childs->get_id();
}
} else {
$meta_ids[] = $metadatum->get_id();
}
}
$response['distribution'] = $this->query_item_metadata_distribution($meta_ids, $collection->get_db_identifier());
//wp_count_posts()
} else {
@ -604,9 +631,11 @@ class REST_Reports_Controller extends REST_Controller {
global $wpdb;
$string_meta_ids = "'".implode("','", $meta_ids)."'";
$sql_statement = $wpdb->prepare(
"SELECT p.post_title AS 'name', p.id AS id, IFNULL(((m.total/$total_items) * 100), 0) as fill_percentage
"SELECT p.post_title AS 'name', pp.post_title AS 'parent_name', p.id AS id, IFNULL(((m.total/$total_items) * 100), 0) as fill_percentage
FROM
$wpdb->posts p LEFT JOIN
$wpdb->posts p
LEFT JOIN $wpdb->posts pp ON (p.post_parent = pp.id)
LEFT JOIN
(
SELECT meta_key, count(DISTINCT post_id) AS total
FROM $wpdb->postmeta
@ -636,7 +665,7 @@ class REST_Reports_Controller extends REST_Controller {
) m
ON (p.id = m.meta_key)
WHERE p.id IN($string_meta_ids)
"
", []
);
$res = $wpdb->get_results($sql_statement);
//return ['t' => $res, 's' => $sql_statement];
@ -649,7 +678,7 @@ class REST_Reports_Controller extends REST_Controller {
"SELECT COUNT(DISTINCT($wpdb->postmeta.meta_value))
FROM $wpdb->postmeta
WHERE meta_key = '_option_taxonomy_id'
"
", []
);
$res = intval($wpdb->get_var( $sql_statement ));
@ -717,7 +746,7 @@ class REST_Reports_Controller extends REST_Controller {
FROM $wpdb->posts p $collection_from
WHERE p.post_type='tainacan-log' AND p.post_date BETWEEN '$start' AND '$end'
GROUP BY DATE(p.post_date)
ORDER BY DATE(p.post_date)"
ORDER BY DATE(p.post_date)", []
);
return $wpdb->get_results($sql_statement);
}
@ -735,7 +764,7 @@ class REST_Reports_Controller extends REST_Controller {
FROM $wpdb->posts p $collection_from
WHERE p.post_type='tainacan-log' AND p.post_date BETWEEN '$start' AND '$end'
GROUP BY p.post_author, DATE(p.post_date)
ORDER BY DATE(p.post_date)"
ORDER BY DATE(p.post_date)", []
);
$data =$wpdb->get_results($sql_statement);
$arr = array();
@ -781,7 +810,7 @@ class REST_Reports_Controller extends REST_Controller {
$collection_from
WHERE p.post_type='tainacan-log'
GROUP BY p.post_author, pm.meta_value
ORDER BY total DESC"
ORDER BY total DESC", []
);
$results = $wpdb->get_results($sql_statement);
$response = [];

View File

@ -13,6 +13,19 @@ class Embed {
return self::$instance;
}
private static $aspect_ratios = array(
// Common video resolutions.
array("ratio" => '2.33', "className" => 'tainacan-embed-aspect-21-9'),
array("ratio" => '2.00', "className" => 'tainacan-embed-aspect-18-9'),
array("ratio" => '1.78', "className" => 'tainacan-embed-aspect-16-9'),
array("ratio" => '1.33', "className" => 'tainacan-embed-aspect-4-3'),
// Vertical video and instagram square video support.
array("ratio" => '1.00', "className" => 'tainacan-embed-aspect-1-1' ),
array("ratio" => '0.75', "className" => 'tainacan-embed-aspect-3-4'),
array("ratio" => '0.56', "className" => 'tainacan-embed-aspect-9-16'),
array("ratio" => '0.50', "className" => 'tainacan-embed-aspect-1-2' )
);
protected function __construct() {
/**
@ -24,7 +37,7 @@ class Embed {
/**
* Add responsiveness to embeds
*/
add_filter('embed_oembed_html', [$this, 'responsive_embed'], 10, 3);
add_filter( 'embed_oembed_html', [$this, 'responsive_embed'], 10, 3);
add_action( 'admin_enqueue_scripts', array( &$this, 'add_css' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'add_css' ) );
@ -109,7 +122,6 @@ class Embed {
}
/**
* Responsiveness
*/
@ -117,6 +129,69 @@ class Embed {
global $TAINACAN_BASE_URL;
wp_enqueue_style( 'tainacan-embeds', $TAINACAN_BASE_URL . '/assets/css/tainacan-embeds.css', [], TAINACAN_VERSION );
}
/**
* Get responsive class based on aspect ratio
* This code is heavily inspired by Gutenberg plugin's "getClassNames" function.
* Check their source code for more details: /packages/block-library/src/embed/util.js
*
* @param {string} html The preview HTML that possibly contains an iframe with width and height set.
* @param {string} existingClassNames Any existing class names.
* @return {string} Deduped class names.
*/
public function add_responsive_wrapper( $html, $existingClassNames = '' ) {
$height = false;
$width = false;
$dom = new \DOMDocument();
$dom->loadHTML($html);
// If we have a fixed aspect iframe, and it's a responsive embed content.
if ($dom) {
$externalContentElement = $dom->getElementsByTagName('iframe');
if (!$externalContentElement)
$externalContentElement = $dom->getElementsByTagName('embed');
if (!$externalContentElement)
$externalContentElement = $dom->getElementsByTagName('object');
if ($externalContentElement) {
foreach($externalContentElement as $element) {
foreach($element->attributes as $attribute) {
if ($attribute->nodeName == 'width')
$width = $attribute->nodeValue;
if ($attribute->nodeName == 'height')
$height = $attribute->nodeValue;
if ($attribute->nodeName == 'class' && $attribute->nodeValue == 'wp-embedded-content') {
$height = false;
$width = false;
break;
}
}
}
}
if ( $height && $width ) {
$aspect_ratio = number_format(( $width / $height ), 2, '.', "");
// Given the actual aspect ratio, find the widest ratio to support it.
for ($ratioIndex = 0; $ratioIndex < count(self::$aspect_ratios); $ratioIndex++) {
$potentialRatio = self::$aspect_ratios[ $ratioIndex ];
if ( $aspect_ratio >= $potentialRatio['ratio'] ) {
$class = $potentialRatio['className'] . ' tainacan-content-embed tainacan-has-aspect-ratio';
return '<figure class="' . $class . '"><div class="tainacan-content-embed__wrapper">' . $html . '</div></figure>';
}
}
}
}
return $html;
}
/**
* Adds a responsive embed wrapper around oEmbed content
* @param string $html The oEmbed markup
@ -126,12 +201,9 @@ class Embed {
*/
function responsive_embed($html, $url, $attr) {
$class = 'tainacan-embed-container';
$element = $this->add_responsive_wrapper($html);
if ( !preg_match('/(?:<iframe[^>]*)(?:(?:\/>)|(?:>.*?<\/iframe>))/i', $html ) && !preg_match('/(?:<object[^>]*)(?:(?:\/>)|(?:>.*?<\/object>))/i', $html) && !preg_match('/(?:<embed[^>]*)(?:(?:\/>)|(?:>.*?<\/embed>))/i', $html ) )
$class .= ' tainacan-embed-without-iframe';
return $html !== '' ? '<div class="' . $class . '">'.$html.'</div>' : '';
return $element;
}
}

View File

@ -103,7 +103,6 @@ class Media {
* @return string the file path
*/
public function save_remote_file($url) {
set_time_limit(0);
$filename = tempnam(sys_get_temp_dir(), basename($url));
@ -134,7 +133,7 @@ class Media {
# Assign a callback function to the CURL Write-Function
curl_setopt($ch, CURLOPT_WRITEFUNCTION, $callback);
# Exceute the download - note we DO NOT put the result into a variable!
# Execute the download - note we DO NOT put the result into a variable!
curl_exec($ch);
if (curl_errno($ch)) {
$error_msg = curl_error($ch);

View File

@ -414,7 +414,7 @@ class Item_Metadata_Entity extends Entity {
return $this->has_value;
$value = $this->get_value();
$this->has_value = (is_array($value)) ? !empty(array_filter($value)) : !empty($value);
$this->has_value = (is_array($value)) ? !empty(array_filter($value)) : (is_numeric($value) || !empty($value));
return $this->has_value;
}

View File

@ -278,7 +278,8 @@ class Bulk_Edit_Process extends Generic_Process {
private function clear_value(\Tainacan\Entities\Item $item) {
$metadatum = $this->metadatum_repository->fetch($this->bulk_edit_data['metadatum_id']);
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum );
$parent_meta_id = $this->get_parent_meta_id($item, $metadatum);
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum, null, $parent_meta_id );
$item_metadata->set_value("");
return $this->save_item_metadata($item_metadata, $item);
}
@ -286,8 +287,9 @@ class Bulk_Edit_Process extends Generic_Process {
private function set_value(\Tainacan\Entities\Item $item) {
$metadatum = $this->metadatum_repository->fetch($this->bulk_edit_data['metadatum_id']);
$value = $this->bulk_edit_data['value'];
$parent_meta_id = $this->get_parent_meta_id($item, $metadatum);
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum );
$item_metadata = new Entities\Item_Metadata_Entity( $item, $metadatum, null, $parent_meta_id );
if($item_metadata->is_multiple()) {
$value = is_array( $value ) ? $value : [$value];
@ -300,6 +302,22 @@ class Bulk_Edit_Process extends Generic_Process {
}
private function get_parent_meta_id($item, $metadatum) {
$metadatum_parent_id = $metadatum->get_parent();
if ($metadatum_parent_id > 0) {
$metadatum_parent = $this->metadatum_repository->fetch($metadatum_parent_id);
$compoundItem = new Entities\Item_Metadata_Entity($item, $metadatum_parent);
$unique = !$compoundItem->is_multiple();
$compoundValue = $compoundItem->get_value();
if ( $unique && !empty($compoundValue) ) {
$key = array_keys($compoundValue)[0]; // get the first metadata ID, if the argument metadata does not exist
$parent_meta_id = $compoundValue[$key]->get_parent_meta_id();
return $parent_meta_id;
} // elseif ((is_array($compoundValue) && sizeof($compoundValue) > 0))
}
return null;
}
private function add_value(\Tainacan\Entities\Item $item) {
$metadatum_id = $this->bulk_edit_data['metadatum_id'];
$metadatum = $this->metadatum_repository->fetch($metadatum_id);

View File

@ -38,7 +38,7 @@ class Generic_Process_Handler {
$data = $process_object->_to_Array(true);
$process = $this->get_generic_process_by_object($process_object);
$process_name = sprintf( __('%s process', 'tainacan'), $process['name'] );
$process_name = sprintf( __('%s processing', 'tainacan'), $process['name'] );
$bg_process = $this->bg_process->data($data)->set_name($process_name)->save();
if ( is_wp_error($bg_process->dispatch()) ) {

View File

@ -36,12 +36,14 @@ class CSV extends Importer {
}
$columns = [];
if( $rawColumns ) {
if ($rawColumns) {
foreach( $rawColumns as $index => $rawColumn ) {
if( strpos($rawColumn,'special_') === 0 ) {
if( $rawColumn === 'special_document' ) {
$this->set_option('document_index', $index);
} else if ($rawColumn === 'special_document|REPLACE') {
$this->set_option('document_import_mode', 'replace');
$this->set_option('document_index', $index);
} else if( $rawColumn === 'special_attachments' ||
$rawColumn === 'special_attachments|APPEND' ||
$rawColumn === 'special_attachments|REPLACE' ) {
@ -84,7 +86,7 @@ class CSV extends Importer {
if( $rawColumns ) {
foreach( $rawColumns as $index => $rawColumn ) {
if( strpos($rawColumn,'special_') === 0 ) {
if( in_array( $rawColumn, ['special_document', 'special_attachments', 'special_item_status', 'special_item_id', 'special_comment_status', 'special_attachments|APPEND', 'special_attachments|REPLACE'] ) ) {
if( in_array( $rawColumn, ['special_document', 'special_attachments', 'special_item_status', 'special_item_id', 'special_comment_status', 'special_attachments|APPEND', 'special_attachments|REPLACE', 'special_document|REPLACE'] ) ) {
$columns[] = $rawColumn;
}
}
@ -197,7 +199,9 @@ class CSV extends Importer {
$returnValue = [];
foreach($valueToInsert as $index => $metadatumValue) {
$childrenHeaders = str_getcsv($compoundHeaders[$key], $this->get_option('delimiter'), $this->get_option('enclosure'));
$childrenValue = str_getcsv($metadatumValue, $this->get_option('delimiter'), $this->get_option('enclosure'));
$childrenValue = $this->is_clear_value($metadatumValue) ?
array_fill(0, sizeof($childrenHeaders), $this->get_option('escape_empty_value') ) :
str_getcsv($metadatumValue, $this->get_option('delimiter'), $this->get_option('enclosure'));
if ( sizeof($childrenHeaders) != sizeof($childrenValue) ) {
$this->add_error_log('Mismatch count headers childrens and row columns. file value:' . $metadatumValue);
@ -514,7 +518,14 @@ class CSV extends Importer {
}
} else if( strpos($column_value,'file:') === 0 ) {
$correct_value = trim(substr($column_value, 5));
if( isset(parse_url($correct_value)['scheme'] ) ) {
//removing the old document attachment
if ($this->get_option('document_import_mode') === 'replace' && $item_inserted->get_document_type() == 'attachment' ) {
$this->add_log('Item Document will be replaced ... ');
wp_delete_attachment($item_inserted->get_document(), true);
$this->add_log('Deleted previous Item Documents ... ');
}
if (isset(parse_url($correct_value)['scheme'] )) {
$id = $TainacanMedia->insert_attachment_from_url($correct_value, $item_inserted->get_id());
if(!$id){
@ -571,15 +582,7 @@ class CSV extends Importer {
break;
case 'REPLACE':
$this->add_log('Attachment REPLACE file ');
$args['post_parent'] = $item_inserted->get_id();
$args['post_type'] = 'attachment';
$args['post_status'] = 'any';
$args['post__not_in'] = [$item_inserted->get_document()];
$posts_query = new \WP_Query();
$query_result = $posts_query->query( $args );
foreach ( $query_result as $post ) {
wp_delete_attachment( $post->ID, true );
}
$this->delete_previous_document_imgs($item_inserted->get_id(), $item_inserted->get_document());
break;
}
@ -681,7 +684,7 @@ class CSV extends Importer {
* its value or values
* @param integer $collection_index The index in the $this->collections array of the collection the item is being inserted into
*
* @return Tainacan\Entities\Item Item inserted
* @return bool|Tainacan\Entities\Item Item inserted
*/
public function insert( $processed_item, $collection_index ) {
remove_action( 'post_updated', 'wp_save_post_revision' );
@ -790,7 +793,12 @@ class CSV extends Importer {
foreach($children_mapping as $tainacan_children_metadatum_id => $tainacan_children_header) {
$metadatumChildren = $Tainacan_Metadata->fetch( $tainacan_children_metadatum_id, 'OBJECT' );
$compoundItemMetadata = new Entities\Item_Metadata_Entity( $item, $metadatumChildren);
$compoundItemMetadata->set_value($compoundValue[$tainacan_children_header]);
$childrenCompoundvalue = $compoundValue[$tainacan_children_header];
if ($this->is_clear_value($childrenCompoundvalue)) {
$compoundItemMetadata->set_value("");
} else {
$compoundItemMetadata->set_value($childrenCompoundvalue);
}
$tmp[] = $compoundItemMetadata;
}
$singleItemMetadata[] = $tmp;
@ -877,12 +885,18 @@ class CSV extends Importer {
}
}
private function is_assoc(array $arr) {
if (array() === $arr) return false;
return array_keys($arr) !== range(0, count($arr) - 1);
}
private function deleteAllValuesCompoundItemMetadata($item, $compoundMetadataID) {
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
$compound_metadata = $Tainacan_Metadata->fetch($compoundMetadataID, 'OBJECT');
$compound_item_metadata = new Entities\Item_Metadata_Entity($item, $compound_metadata);
$compound_item_metadata_value = $compound_item_metadata->get_value();
$compound_item_metadata_value = $this->is_assoc($compound_item_metadata_value) ? [$compound_item_metadata_value] : $compound_item_metadata_value;
foreach($compound_item_metadata_value as $item_metadata_value) {
foreach ($item_metadata_value as $itemMetadata) {
$Tainacan_Item_Metadata->remove_compound_value($item, $compound_metadata, $itemMetadata->get_parent_meta_id());
@ -916,10 +930,9 @@ class CSV extends Importer {
* @param $metadatum the metadata
* @param $values the categories names
*
* @return array empty with no category or array with IDs
* @return bool|array empty with no category or array with IDs
*/
private function insert_hierarchy( $metadatum, $values ){
private function insert_hierarchy( $metadatum, $values ) {
if (empty($values)) {
return false;
}
@ -982,14 +995,13 @@ class CSV extends Importer {
/**
* @param $collection_id
*
* @return array/bool false if has no mapping or associated array with metadata id and header
* @return array|bool false if has no mapping or associated array with metadata id and header
*/
public function get_mapping( $collection_id ){
$mapping = get_post_meta( $collection_id, 'metadata_mapping', true );
return ( $mapping ) ? $mapping : false;
return $mapping ?: false;
}
/**
* @inheritdoc
*
@ -1081,4 +1093,19 @@ class CSV extends Importer {
return $message;
}
private function delete_previous_document_imgs($item_id, $item_document) {
$previous_imgs = [
'post_parent' => $item_id,
'post_type' => 'attachment',
'post_status' => 'any',
'post__not_in' => [$item_document]
];
$posts_query = new \WP_Query();
$attachs = $posts_query->query($previous_imgs);
foreach ($attachs as $att) {
$this->add_log( "Deleting attachment [". $att->ID . "] " . $att->post_title);
wp_delete_attachment($att->ID, true);
}
}
}

View File

@ -44,7 +44,7 @@ class Importer_Handler {
$this->register_importer([
'name' => 'Vocabulary CSV',
'description' => __('Import a vaculary from a CSV file into a taxonomy', 'tainacan'),
'description' => __('Import a vocabulary from a CSV file into a taxonomy', 'tainacan'),
'slug' => 'terms',
'class_name' => '\Tainacan\Importer\Term_Importer',
'manual_collection' => false,

View File

@ -59,7 +59,7 @@ abstract class Importer {
private $options = [];
/**
* Stores the default options for the importer options
* Stores default options for importer options
* @var array
*/
protected $default_options = [];
@ -114,7 +114,7 @@ abstract class Importer {
private $error_log = [];
/**
* Wether to abort importer execution.
* Whether to abort importer execution.
* @var bool
*/
private $abort = false;
@ -137,7 +137,6 @@ abstract class Importer {
];
public function __construct($attributess = array()) {
$this->id = uniqid();
$author = get_current_user_id();
@ -153,8 +152,6 @@ abstract class Importer {
}
}
}
}
public function _to_Array($short = false) {
@ -193,8 +190,7 @@ abstract class Importer {
* @param $url string
* @return bool
*/
public function set_url($url)
{
public function set_url($url) {
if(!empty($url) && !is_array($url))
{
$this->url = rtrim(trim($url), "/");
@ -207,8 +203,7 @@ abstract class Importer {
/**
* @return string or bool
*/
public function get_url()
{
public function get_url() {
if(!empty($this->url))
{
return $this->url;
@ -293,7 +288,6 @@ abstract class Importer {
$this->default_options = $options;
}
public function set_steps($steps) {
$this->steps = $steps;
}
@ -302,7 +296,6 @@ abstract class Importer {
return $this->steps;
}
private function get_transients() {
return $this->transients;
}
@ -559,7 +552,6 @@ abstract class Importer {
$step = $steps[$current_step];
if ($step['callback'] == 'process_collections') {
$totalItems = 0;
$currentItem = $this->get_current_collection_item();
$current_collection = $this->get_current_collection();
@ -577,18 +569,12 @@ abstract class Importer {
if ($totalItems > 0) {
$value = round( ($currentItem/$totalItems) * 100 );
}
} else {
if ( isset($step['total']) && is_numeric($step['total']) && $step['total'] > 0 ) {
$current = $this->get_in_step_count();
$value = round( ($current/$step['total']) * 100 );
}
}
}
return $value;
}

View File

@ -42,11 +42,10 @@ class Oaipmh_Importer extends Importer {
$this->remove_import_method('file');
$this->add_import_method('url');
}
/**
* Method implemented by the child importer class to proccess each item
* Method implemented by child importer class to proccess each item
* @return int
*/
public function process_item( $index, $collection_id ){
@ -54,8 +53,7 @@ class Oaipmh_Importer extends Importer {
$records = [ 'records' => [] , 'collection_definition' => $collection_id ];
$record_processed = [];
if( $index === 0 ){
if ($index === 0) {
if( $collection_id['source_id'] !== 'sets' && $this->has_sets ){
$info = $this->requester( $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc&set=" . $collection_id['source_id'] );
$this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc&set=" . $collection_id['source_id']);
@ -63,19 +61,17 @@ class Oaipmh_Importer extends Importer {
$info = $this->requester( $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc" );
$this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc");
}
} else {
$token = $this->get_transient('resumptionToken');
$info = $this->requester( $this->get_url() . "?verb=ListRecords&resumptionToken=" . $token);
$this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&resumptionToken=" . $token);
}
if( !isset($info['body']) ){
if (!isset($info['body'])) {
$this->add_log('no answer');
return false;
}
try {
$xml = new \SimpleXMLElement($info['body']);
@ -743,7 +739,7 @@ class Oaipmh_Importer extends Importer {
$this->add_log('ERROR on get repo name');
$this->add_error_log('Error in fetch remote total items');
$this->abort();
return __('Imported Repo');
return __('Imported repository');
} else {
try {
@ -753,10 +749,10 @@ class Oaipmh_Importer extends Importer {
return (string) $xml->Identify->repositoryName;
}
} catch (Exception $e) {
return __('Imported Repo');
return __('Imported repository');
}
return __('Imported Repo');
return __('Imported repository');
}
}

View File

@ -6,7 +6,6 @@ use \Tainacan\Entities;
class Old_Tainacan extends Importer{
protected $steps = [
[
'name' => 'Create Taxonomies',
'progress_label' => 'Creating taxonomies',
@ -33,7 +32,6 @@ class Old_Tainacan extends Importer{
'callback' => 'link_relationships',
'total' => 5
]
];
protected $tainacan_api_address, $wordpress_api_address, $actual_collection;
@ -64,8 +62,7 @@ class Old_Tainacan extends Importer{
*
*/
public function create_taxonomies() {
if(!$this->get_url()){
if (!$this->get_url()) {
$this->add_error_log('Site url not found');
$this->abort();
return false;
@ -74,7 +71,6 @@ class Old_Tainacan extends Importer{
$this->add_log('Creating taxonomies');
foreach ($this->get_taxonomies() as $taxonomy) {
$tax = new Entities\Taxonomy();
$tax->set_name( $taxonomy->name );
$tax->set_description( $taxonomy->description );
@ -85,20 +81,16 @@ class Old_Tainacan extends Importer{
$tax = $this->tax_repo->insert($tax);
$this->add_log('Taxonomy ' . $tax->get_name() . ' created, id from Old'. $taxonomy->term_id );
$this->add_transient('tax_' . $taxonomy->term_id . '_id', $tax->get_id());
$this->add_transient('tax_' . $taxonomy->term_id . '_name', $tax->get_name());
if (isset($taxonomy->children) && $tax) {
$this->add_all_terms($tax, $taxonomy->children);
}
} else {
$this->add_log('Error creating taxonomy ' . $taxonomy->name );
$this->add_log($tax->get_errors());
}
}
return false;
@ -108,18 +100,15 @@ class Old_Tainacan extends Importer{
* create the repository metadata which each collection inherits by default
*
*/
public function create_repo_metadata(){
public function create_repo_metadata() {
$this->add_log('Creating repository metadata');
foreach ($this->get_repo_metadata() as $metadata) {
if (isset($metadata->slug) && strpos($metadata->slug, 'socialdb_property_fixed') === false) {
$metadatum_id = $this->create_metadata( $metadata );
} elseif ( strpos($metadata->slug, 'socialdb_property_fixed_tags') !== false ){
} elseif ( strpos($metadata->slug, 'socialdb_property_fixed_tags') !== false ) {
$metadatum_id = $this->create_metadata( $metadata );
}
}
$this->add_log('FInished repository metadata');

View File

@ -316,11 +316,9 @@ class Test_Importer extends Importer {
</div>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
@ -334,7 +332,6 @@ class Test_Importer extends Importer {
if ($tax1->validate()) {
$tax1 = $this->tax_repo->insert($tax1);
} else {
/**
* In these set up steps, if we have an error adding
* a taxonomy, collection or metadatum, there is no point
@ -346,13 +343,11 @@ class Test_Importer extends Importer {
$this->add_error_log($tax1->get_errors());
$this->abort();
return false;
}
$this->add_transient('tax_1_id', $tax1->get_id());
return false;
}
public function create_collections() {
@ -367,10 +362,8 @@ class Test_Importer extends Importer {
$this->add_error_log($col1->get_errors());
$this->abort();
return false;
}
$col1_map = [];
// metadata
@ -696,8 +689,7 @@ class Test_Importer extends Importer {
* @param $collection
*
*/
private function create_metadata( $args, $collection ){
private function create_metadata( $args, $collection ) {
$metadatum = new Entities\Metadatum();
$metadatum->set_name($args['name']);
$metadatum->set_collection($collection);
@ -758,7 +750,6 @@ class Test_Importer extends Importer {
return $array;
}
public function get_col2_item($index) {
return [
'field1' => 'Collection 2 item ' . $index,
@ -767,6 +758,4 @@ class Test_Importer extends Importer {
];
}
}

View File

@ -40,7 +40,7 @@ class Collections extends Repository {
'title' => __( 'Status', 'tainacan' ),
'type' => 'string',
'default' => '',
'description' => __( 'The current situation of the post', 'tainacan' )
'description' => __( 'The current situation of the collection. It also affects the visibility of the collection items, as public items from private collections do not appear in the site.', 'tainacan' )
],
'author_id' => [
'map' => 'post_author',
@ -169,7 +169,7 @@ class Collections extends Repository {
'map' => 'meta',
'title' => __( 'Header Image', 'tainacan' ),
'type' => 'string',
'description' => __( 'The image to be used in collection header', 'tainacan' ),
'description' => __( 'The image to be used in collection header, if the theme has one.', 'tainacan' ),
'on_error' => __( 'Invalid image', 'tainacan' ),
//'validation' => v::numeric(),
'default' => ''
@ -189,10 +189,10 @@ class Collections extends Repository {
],
'allow_comments' => [
'map' => 'meta',
'title' => __( 'Allow Items Comments', 'tainacan' ),
'title' => __( 'Allow enabling comments on items', 'tainacan' ),
'type' => 'string',
'description' => __( 'Collection items comment status: "open" means comments are allowed, "closed" means comments are not allowed.', 'tainacan' ),
'default' => 'open',
'description' => __( 'If this option is enabled, items of this collection can be set to enable a comments section on their page. "open" means comments are allowed, "closed" means comments are not allowed.', 'tainacan' ),
'default' => 'closed',
'validation' => v::optional(v::stringType()->in( [ 'open', 'closed' ] )),
],
'submission_anonymous_user' => [

View File

@ -403,7 +403,7 @@ class Item_Metadata extends Repository {
$metadatum = $item_metadata->get_metadatum();
if ( $metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\User' ) {
$options = $metadatum->get_metadata_type_options();
if ( isset($options['default_author']) && $options['default_author'] = 'yes') {
if ( isset($options['default_author']) && $options['default_author'] == 'yes') {
$value = $metadatum->is_multiple() ? [strval(get_current_user_id())] : strval(get_current_user_id());
$item_metadata->set_value($value);
if ( $item_metadata->validate() ) {

View File

@ -46,7 +46,7 @@ class Items extends Repository {
'title' => __( 'Status', 'tainacan' ),
'type' => 'string',
'default' => 'draft',
'description' => __( 'The posts status', 'tainacan' )
'description' => __( 'The current situation of the item. Notice that the item visibility also depends on the collection status.', 'tainacan' )
],
'description' => [
'map' => 'post_content',

View File

@ -63,7 +63,7 @@ class Metadata extends Repository {
'map' => 'post_name',
'title' => __( 'Slug', 'tainacan' ),
'type' => 'string',
'description' => __( 'A unique and santized string representation of the metadata', 'tainacan' ),
'description' => __( 'A unique and sanitized string representation of the metadata', 'tainacan' ),
//'validation' => v::stringType(),
],
'order' => [

View File

@ -89,7 +89,7 @@ abstract class Repository {
* 'map' => 'post_name',
* 'title' => __('Slug', 'tainacan'),
* 'type' => 'string',
* 'description'=> __('A unique and santized string representation of the collection, used to build the collection URL', 'tainacan'),
* 'description'=> __('A unique and sanitized string representation of the collection, used to build the collection URL', 'tainacan'),
* 'validation' => v::stringType(),
* ],
*/

View File

@ -683,6 +683,8 @@ class Theme_Helper {
$excerpt = strip_tags(tainacan_get_the_collection_description());
} elseif ( is_post_type_archive('tainacan-collection') ) {
$title = __('Collections', 'tainacan');
} else {
$title = get_the_archive_title();
}
} elseif ( is_singular() ) {
global $post;

View File

@ -1,10 +1,10 @@
=== Tainacan ===
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, vnmedeiros, tainacan, r-guimaraes
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, vnmedeiros, tainacan, r-guimaraes, suelanesilva, ccaio, alanargomes, ateneagarcia123, rodrigo0freire, clarandreozzi
Tags: museums, libraries, archives, GLAM, collections, repository
Requires at least: 4.8
Requires at least: 5.0
Tested up to: 5.6
Requires PHP: 5.6
Stable tag: 0.17.4
Stable tag: 0.18
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: Open source, powerful 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 repository platform.
Author: Tainacan.org
Version: 0.17.4
Version: 0.18
Text Domain: tainacan
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
const TAINACAN_VERSION = '0.17.4';
const TAINACAN_VERSION = '0.18';
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
$TAINACAN_BASE_URL = plugins_url('', __FILE__);

View File

@ -20,7 +20,7 @@
@click="isMenuCompressed = !isMenuCompressed">
<span
v-tooltip="{
content: $i18n.get('label_shrink_menu'),
content: isMenuCompressed ? $i18n.get('label_expand_menu') : $i18n.get('label_shrink_menu'),
autoHide: true,
placement: 'auto-end',
classes: ['tooltip', 'repository-tooltip']
@ -28,7 +28,8 @@
class="icon">
<i
:class="{ 'tainacan-icon-arrowleft' : !isMenuCompressed, 'tainacan-icon-arrowright' : isMenuCompressed }"
class="tainacan-icon tainacan-icon-1-25em"/>
class="tainacan-icon tainacan-icon-1-25em"
/>
</span>
</button>
<tainacan-header />
@ -99,7 +100,8 @@
hideCancel: true
},
ariaRole: 'alertdialog',
ariaModal: true
ariaModal: true,
customClass: 'tainacan-modal'
});
}
});

View File

@ -204,7 +204,7 @@
:label="$i18n.getHelperTitle('collections', 'hide_items_thumbnail_on_lists')">
&nbsp;
<b-switch
id="tainacan-checkbox-comment-status"
id="tainacan-checkbox-hide-items-thumbnail-on-lists"
size="is-small"
true-value="yes"
false-value="no"
@ -407,7 +407,8 @@
</b-field>
<!-- Parent Collection -------------------------------- -->
<b-field
<!-- DISABLED IN 0.18 AS WE DISCUSS BETTER IMPLEMENTATION FOR COLLECTIONS HIERARCHY -->
<!-- <b-field
:addons="false"
:label="$i18n.get('label_parent_collection')"
:type="editFormErrors['parent'] != undefined ? 'is-danger' : ''"
@ -430,7 +431,7 @@
:value="anotherCollection.id">{{ anotherCollection.name }}
</option>
</b-select>
</b-field>
</b-field> -->
<!-- Slug -------------------------------- -->
<b-field
@ -453,7 +454,7 @@
<!-- Comment Status ------------------------ -->
<b-field
:addons="false"
:label="$i18n.get('label_allow_comments')">
:label="$i18n.getHelperTitle('collections', 'allow_comments')">
&nbsp;
<b-switch
id="tainacan-checkbox-comment-status"
@ -654,7 +655,7 @@ export default {
files:[],
enabled_view_modes: [],
default_view_mode: [],
allow_comments: '',
allow_comments: 'closed',
allows_submission: 'no',
submission_default_status: 'draft',
submission_anonymous_user: 'no',
@ -676,8 +677,8 @@ export default {
isMapped: false,
mapper: false,
headerPlaceholderPath: tainacan_plugin.base_url + '/assets/images/placeholder_rectangle.png',
collections: [],
isFetchingCollections: true,
//collections: [], DISABLED IN 0.18 AS WE DISCUSS BETTER IMPLEMENTATION FOR COLLECTIONS HIERARCHY
//isFetchingCollections: true, DISABLED IN 0.18 AS WE DISCUSS BETTER IMPLEMENTATION FOR COLLECTIONS HIERARCHY
thumbnailMediaFrame: undefined,
headerImageMediaFrame: undefined,
viewModesList: [],
@ -778,21 +779,22 @@ export default {
}
// Generates options for parent collection
this.isFetchingCollections = true;
this.fetchAllCollectionNames()
.then((resp) => {
resp.request.then((collections) => {
this.collections = collections;
this.isFetchingCollections = false;
})
.catch((error) => {
this.$console.error(error);
this.isFetchingCollections = false;
});
})
.catch(() => {
this.isFetchingCollections = false;
});
// DISABLED IN 0.18 AS WE DISCUSS BETTER IMPLEMENTATION FOR COLLECTIONS HIERARCHY
// this.isFetchingCollections = true;
// this.fetchAllCollectionNames()
// .then((resp) => {
// resp.request.then((collections) => {
// this.collections = collections;
// this.isFetchingCollections = false;
// })
// .catch((error) => {
// this.$console.error(error);
// this.isFetchingCollections = false;
// });
// })
// .catch(() => {
// this.isFetchingCollections = false;
// });
this.isLoading = false;
});
@ -949,22 +951,23 @@ export default {
this.form.status = 'publish';
// Generates options for parent collection
this.isFetchingCollections = true;
this.fetchAllCollectionNames()
.then((resp) => {
resp.request.then((collections) => {
this.collections = collections;
this.isFetchingCollections = false;
})
.catch((error) => {
this.$console.error(error);
this.isFetchingCollections = false;
});
})
.catch((error) => {
this.$console.error(error);
this.isFetchingCollections = false;
});
// DISABLED IN 0.18 AS WE DISCUSS BETTER IMPLEMENTATION FOR COLLECTIONS HIERARCHY
// this.isFetchingCollections = true;
// this.fetchAllCollectionNames()
// .then((resp) => {
// resp.request.then((collections) => {
// this.collections = collections;
// this.isFetchingCollections = false;
// })
// .catch((error) => {
// this.$console.error(error);
// this.isFetchingCollections = false;
// });
// })
// .catch((error) => {
// this.$console.error(error);
// this.isFetchingCollections = false;
// });
this.isLoading = false;

View File

@ -72,7 +72,7 @@
<span class="icon has-text-gray3">
<i class="tainacan-icon tainacan-icon-public"/>
</span>
{{ $i18n.get('publish_visibility') }}
{{ $i18n.get('status_public') }}
</b-radio>
<br>
<b-radio
@ -84,7 +84,7 @@
<span class="icon has-text-gray3">
<i class="tainacan-icon tainacan-icon-private"/>
</span>
{{ $i18n.get('private_visibility') }}
{{ $i18n.get('status_private') }}
</b-radio>
</div>
</b-field>

View File

@ -167,8 +167,8 @@
(importer.accepts.file && importer.accepts.url && !importerFile && !url)"
id="button-submit-importer-creation"
@click.prevent="onFinishImporter()"
:class="{'is-loading': isLoadingRun }"
class="button is-success">{{ $i18n.get('run') }}</button>
:class="{ 'is-loading': isLoadingRun, 'is-success': !isLoadingRun }"
class="button">{{ $i18n.get('run') }}</button>
</div>
<div
v-if="importer.manual_mapping"
@ -184,8 +184,8 @@
(importer.accepts.file && importer.accepts.url && !importerFile && !url)"
id="button-submit-collection-creation"
@click.prevent="onFinishImporter()"
:class="{'is-loading': isLoadingUpload }"
class="button is-success">{{ $i18n.get('next') }}</button>
:class="{ 'is-loading': isLoadingUpload, 'is-success': !isLoadingUpload }"
class="button">{{ $i18n.get('next') }}</button>
</div>
</div>
</form>
@ -500,7 +500,7 @@ export default {
margin: 12px 0 6px 0;
}
.modal .animation-content {
.tainacan-modal .animation-content {
width: 100%;
z-index: 99999;

View File

@ -37,7 +37,6 @@
<p>{{ $i18n.get('info_metadata_mapping_helper') }}</p>
<br>
<b-loading
:is-full-page="false"
:active.sync="isLoadingSourceInfo"
@ -48,6 +47,26 @@
v-if="importerSourceInfo != undefined &&
importerSourceInfo != null &&
!isLoading">
<a
v-if="importerSourceInfo.source_metadata && importerSourceInfo.source_metadata.length > 0"
style="margin-left: 2rem; font-size: 0.875em;"
class="is-inline is-pulled-right add-link has-text-secondary"
@click="createAllMetadata()">
<span class="icon">
<i class="tainacan-icon tainacan-icon-approvedcircle"/>
</span>
{{ $i18n.get('label_set_all_create_metadada') }}
</a>
<a
v-if="collectionId != null && collectionId != undefined && importerSourceInfo.source_metadata &&importerSourceInfo.source_metadata.length > 0 && collection && collection.current_user_can_edit_metadata"
style="font-size: 0.875em;"
class="is-inline is-pulled-right add-link has-text-secondary"
@click="createNewMetadatum()">
<span class="icon">
<i class="tainacan-icon tainacan-icon-add"/>
</span>
{{ $i18n.get('label_add_more_metadata') }}
</a>
<div
class="mapping-header"
v-if="importerSourceInfo.source_metadata.length > 0 || (importerSourceInfo.source_special_fields && importerSourceInfo.source_special_fields.length > 0)">
@ -183,7 +202,8 @@
:active.sync="isNewMetadatumModalActive"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus="true"
tabindex="-1"
@ -245,15 +265,6 @@
</div>
</div>
</b-modal>
<a
v-if="collectionId != null && collectionId != undefined && importerSourceInfo.source_metadata.length > 0 && collection && collection.current_user_can_edit_metadata"
style="font-size: 0.875em;"
class="is-inline is-pulled-right add-link has-text-secondary"
@click="createNewMetadatum()">
<span class="icon">
<i class="tainacan-icon tainacan-icon-add"/>
</span>
{{ $i18n.get('label_add_more_metadata') }}</a>
</div>
<div
v-if="importerSourceInfo == undefined ||
@ -276,8 +287,8 @@
:disabled="sessionId == undefined || importer == undefined"
id="button-submit-importer-mapping"
@click.prevent="onRunImporter"
:class="{'is-loading': isLoadingRun }"
class="button is-success">{{ $i18n.get('run') }}</button>
:class="{ 'is-loading': isLoadingRun, 'is-success': !isLoadingRun }"
class="button">{{ $i18n.get('run') }}</button>
</div>
</div>
</form>
@ -293,7 +304,8 @@
autofocus
role="dialog"
tabindex="-1"
aria-modal>
aria-modal
custom-class="tainacan-modal">
<form class="tainacan-modal-content tainacan-form">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('instruction_select_title_mapping') }}</h2>
@ -404,7 +416,7 @@ export default {
metadataSearchCancel: undefined,
showTitlePromptModal: false,
selectedTitle: undefined,
formErrorMessage: ''
formErrorMessage: '',
}
},
computed: {
@ -785,6 +797,12 @@ export default {
this.showTitlePromptModal = false;
this.onRunImporter();
},
createAllMetadata() {
this.mappedCollection['mapping'] = {};
this.importerSourceInfo.source_metadata.forEach((metadatum, index) => {
this.mappedCollection['mapping']['create_metadata'+ index] = metadatum;
});
}
}
}
@ -911,6 +929,7 @@ export default {
}
.mapping-header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
@ -939,7 +958,7 @@ export default {
}
}
.modal .animation-content {
.tainacan-modal .animation-content {
width: 100%;
z-index: 99999;

View File

@ -330,7 +330,8 @@ export default {
collectionId: this.collectionId
},
width: 'calc(100% - (2 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteOneItem(itemId, index) {
@ -351,7 +352,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
}

View File

@ -217,7 +217,8 @@
scroll="keep"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('instruction_write_text') }}</h2>
@ -258,7 +259,8 @@
role="dialog"
tabindex="-1"
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('instruction_insert_url') }}</h2>
@ -314,7 +316,7 @@
class="image">
<span
class="image-placeholder"
v-if="item.document_type == 'empty'">
v-if="item.document_type == 'empty' && item.document_mimetype == 'empty'">
{{ $i18n.get('label_empty_thumbnail') }}
</span>
<img
@ -419,11 +421,11 @@
style="flex-wrap: wrap"
class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.get('label_visibility') }}</label>
<label>{{ $i18n.get('label_status') }}</label>
<span class="required-metadatum-asterisk">*</span>
<help-button
:title="$i18n.get('label_visibility')"
:message="$i18n.get('info_visibility_helper')"/>
:title="$i18n.getHelperTitle('items', 'status')"
:message="$i18n.getHelperMessage('items', 'status')"/>
</div>
<div class="section-status">
<div
@ -436,7 +438,7 @@
<span class="icon">
<i class="tainacan-icon tainacan-icon-public"/>
</span>
{{ $i18n.get('publish_visibility') }}
{{ $i18n.get('status_public') }}
</b-radio>
<b-radio
v-model="visibility"
@ -445,7 +447,7 @@
<span class="icon">
<i class="tainacan-icon tainacan-icon-private"/>
</span>
{{ $i18n.get('private_visibility') }}
{{ $i18n.get('status_private') }}
</b-radio>
</div>
</div>
@ -991,7 +993,8 @@ export default {
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next()
@ -1232,6 +1235,7 @@ export default {
this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type })
.then(item => {
this.item.document_as_html = item.document_as_html;
this.item.document_mimetype = item.document_mimetype;
this.isLoading = false;
})
.catch((errors) => {
@ -1263,6 +1267,7 @@ export default {
this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type })
.then(item => {
this.item.document_as_html = item.document_as_html;
this.item.document_mimetype = item.document_mimetype;
this.isLoading = false;
let oldThumbnail = this.item.thumbnail;
@ -1298,6 +1303,7 @@ export default {
document_type: this.form.document_type
})
.then(() => {
this.item.document_mimetype = 'empty';
this.isLoadingAttachments = true;
this.fetchAttachments({
page: 1,
@ -1359,7 +1365,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
@ -1381,6 +1388,7 @@ export default {
.then((item) => {
this.isLoading = false;
this.item.document_as_html = item.document_as_html;
this.item.document_mimetype = item.document_mimetype;
let oldThumbnail = this.item.thumbnail;
if (item.document_type == 'attachment' && oldThumbnail != item.thumbnail )
@ -1480,7 +1488,8 @@ export default {
this.$router.push(this.$routerHelper.getCollectionPath(this.form.collectionId))
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
loadExistingItem() {

View File

@ -89,7 +89,7 @@
<span class="icon has-text-gray3">
<i class="tainacan-icon tainacan-icon-public"/>
</span>
{{ $i18n.get('publish_visibility') }}
{{ $i18n.get('status_public') }}
</b-radio>
</b-field>
<b-field>
@ -102,7 +102,7 @@
<span class="icon has-text-gray3">
<i class="tainacan-icon tainacan-icon-private"/>
</span>
{{ $i18n.get('private_visibility') }}
{{ $i18n.get('status_private') }}
</b-radio>
</b-field>
</b-field>

View File

@ -193,10 +193,10 @@
</p>
<div class="control">
<button
:class="{ 'is-loading': isLoadingTaxonomy }"
:class="{ 'is-loading': isLoadingTaxonomy, 'is-success': !isLoadingTaxonomy }"
id="button-submit-taxonomy-creation"
@click.prevent="onSubmit"
class="button is-success">{{ $i18n.get('save') }}</button>
class="button">{{ $i18n.get('save') }}</button>
</div>
</div>
</form>
@ -299,7 +299,8 @@
next();
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else if (this.isEditingTerm) {
this.$buefy.modal.open({
@ -313,7 +314,8 @@
next();
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next();

View File

@ -181,7 +181,8 @@
this.loadOptions();
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
}
@ -192,7 +193,7 @@
.view-all-button {
font-size: 0.75em;
font-size: 0.75em !important;
padding: 0.1em 1em;
}

View File

@ -95,16 +95,20 @@
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: 0.75em;
padding-bottom: 0.25em;
}
.collapse-trigger {
margin-left: -7px;
button {
background-color: inherit !important;
color: inherit !important;
}
.icon {
margin-right: 5px;
}
.collapse-label {
display: inline-block;
display: inline;
width: 100%;
overflow-x: hidden;
text-overflow: ellipsis;
@ -128,6 +132,7 @@
align-items: center;
border: none;
background-color: transparent;
color: var(--tainacan-label-color);
text-align: left;
cursor: pointer;
outline: none;

View File

@ -314,7 +314,8 @@
}
},
width: 'calc(100% - (4 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
prepareOptionsForTaxonomy(items) {
@ -351,7 +352,7 @@
<style lang="scss" scoped>
.view-all-button {
font-size: 0.75em;
font-size: 0.75em !important;
padding: 0.1em 1em;
}

View File

@ -183,7 +183,8 @@
approveActivity: (activityId) => this.approveActivity(activityId),
notApproveActivity: (activityId) => this.notApproveActivity(activityId)
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
}

View File

@ -104,7 +104,8 @@ export default {
message: this.$i18n.get('info_warning_terms_not_saved'),
onConfirm: () => { this.removeTerm(); },
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
this.removeTerm();
@ -125,7 +126,8 @@ export default {
this.$eventBusTermsList.onDeleteBasicTermItem(this.term);
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
eventOnEditTerm() {

View File

@ -143,7 +143,8 @@
capability: this.capabilities[capabilityKey],
capabilityKey: capabilityKey
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
getCompleteRolesList(roles, rolesInherited) {

View File

@ -392,7 +392,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.clearContextMenu();
},
@ -432,7 +433,8 @@ export default {
this.allCollectionsOnPageSelected = false;
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
openCollection() {

View File

@ -1240,7 +1240,8 @@ export default {
collectionId: this.$route.params.collectionId,
},
width: 'calc(100% - (2 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
sequenceEditSelectedItems() {
@ -1278,7 +1279,8 @@ export default {
}
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.clearContextMenu();
@ -1310,7 +1312,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteOneItem(itemId) {
@ -1333,7 +1336,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.clearContextMenu();
},
@ -1365,7 +1369,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteSelectedItems() {
@ -1406,7 +1411,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
openItem() {

View File

@ -142,7 +142,8 @@
:active.sync="isMapperMetadataCreating"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus
role="dialog"

View File

@ -420,7 +420,8 @@
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteSelected() {
@ -459,7 +460,8 @@
this.allOnPageSelected = false;
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
getDate(rawDate) {
@ -484,7 +486,8 @@
this.updateProcess({ id: this.processes[index].ID, status: 'closed' });
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
onHeartBitTickList(event, data) {

View File

@ -235,7 +235,8 @@ export default {
message: this.$i18n.get('info_warning_terms_not_saved'),
onConfirm: () => { this.removeTerm(); },
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
this.removeTerm();
@ -277,7 +278,8 @@ export default {
}
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
eventOnChildTermDeleted(parentTermId) {

View File

@ -276,7 +276,8 @@
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteSelected() {
@ -315,7 +316,8 @@
this.allOnPageSelected = false;
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
onClickTaxonomy($event, taxonomyId, index) {

View File

@ -88,7 +88,7 @@
v-if="isMultiple"
:disabled="itemMetadatum.item.id && (childItemMetadataGroups.length > 0 && !someValueOnLastInput)"
@click="addGroup"
class="is-block add-link">
class="is-inline-block add-link">
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>

View File

@ -289,7 +289,8 @@
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next();
@ -382,7 +383,8 @@
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
toggleMetadatumEdition(metadatumId) {

View File

@ -57,7 +57,7 @@
},
methods: {
onInput: _.debounce(function ($event) {
// Emty dates don't need to be validated, they remove the metadata
// Empty dates don't need to be validated, they remove the metadata
if ($event.target.value != '') {
let dateISO = '';
@ -75,7 +75,7 @@
this.$emit('input', dateISO);
} else {
this.$emit('input', [null]);
this.$emit('input', '');
}
}, 300),
onBlur() {

View File

@ -34,12 +34,14 @@ class Date extends Metadata_Type {
if (is_array($value)) {
foreach ($value as $date_value) {
if(!empty($date_value)) {
$d = \DateTime::createFromFormat($format, $date_value);
if (!$d || $d->format($format) !== $date_value) {
$this->add_error($this->format_error_msg($date_value));
return false;
}
}
}
return true;
}

View File

@ -63,7 +63,8 @@
</a>
<b-modal
:width="1200"
:active.sync="createNewItemModal">
:active.sync="createNewItemModal"
custom-class="tainacan-modal">
<iframe
:id="newItemFrame"
width="100%"

View File

@ -228,9 +228,15 @@ class Relationship extends Metadata_Type {
}
if (is_string($link)) {
if ( is_user_logged_in() ||
\is_post_status_viewable( $item->get_status() ) &&
\is_post_status_viewable($item->get_collection()->get_status()) ) {
$return = "<a data-linkto='item' data-id='$id' href='$link'>";
$return.= $label;
$return .= "</a>";
} else {
$return.= $label;
}
}
}

View File

@ -85,7 +85,7 @@
<template v-if="isMultiple">
<a
@click="addValue"
class="is-block add-link">
class="is-inline-block add-link">
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>
@ -180,7 +180,6 @@
// This routine avoids calling the API if the value did not changed
switch(this.itemMetadatum.value.constructor.name) {
// Multivalored Metadata requires checking the whole array
case 'Array': {
@ -188,7 +187,7 @@
let currentValues = [];
// An array of terms
if (this.values.length && this.values[0].constructor.name == 'Object')
if (this.values.length && this.values[0] && this.values[0].constructor.name == 'Object')
currentValues = this.values.map(term => term.value)
else
currentValues = this.values;

View File

@ -79,7 +79,7 @@
:message="$i18n.getHelperMessage('tainacan-taxonomy', 'visible_options_list')"/>
</b-field>
<b-field
v-if="taxonomy_id && taxonomies.length && taxonomies.find((taxonomy) => taxonomy.id == taxonomy_id).allow_insert == 'yes'"
v-if="taxonomy_id && taxonomies.length && isTermCreationAllowedOnCurrentTaxonomy"
:addons="false"
:label="$i18n.get('label_taxonomy_allow_new_terms')">
&nbsp;
@ -200,6 +200,10 @@
this.setErrorsAttributes( '', '' );
}
return true;
},
isTermCreationAllowedOnCurrentTaxonomy() {
const currentTaxonomy = this.taxonomies.find((taxonomy) => taxonomy.id == this.taxonomy_id);
return currentTaxonomy ? currentTaxonomy.allow_insert == 'yes' : false;
}
},
watch: {

View File

@ -32,7 +32,7 @@
/>
<div
v-if="allowNew"
v-if="displayCreateNewTerm"
class="add-new-term">
<a
@click="openTermCreationModal"
@ -50,7 +50,8 @@
trap-focus
aria-role="dialog"
aria-modal
:can-cancel="['outside', 'escape']">
:can-cancel="['outside', 'escape']"
custom-class="tainacan-modal">
<term-edition-form
:taxonomy-id="taxonomyId"
:edit-form="{ id: 'new', name: newTermName ? newTermName : '' }"
@ -103,6 +104,9 @@
return this.itemMetadatum.metadatum.metadata_type_options.input_type;
else
return '';
},
displayCreateNewTerm() {
return this.allowNew;
}
},
watch: {

View File

@ -293,8 +293,8 @@ class Taxonomy extends Metadata_Type {
$item = $item_metadata->get_item();
if ( !in_array($item->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
return true;
// if ( !in_array($item->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
// return true;
$valid = true;

View File

@ -39,7 +39,7 @@
{{ metadatum.name }}
</option>
<optgroup
v-if="metadatum.id && metadatum.metadata_type_object.component === 'tainacan-compound'"
v-if="metadatum.id && metadatum.metadata_type_object.component === 'tainacan-compound' && metadatum.multiple !== 'yes'"
:key="index"
:label="metadatum.name">
<option
@ -275,7 +275,7 @@
<a
:disabled="dones.every((item) => item === true) === false"
@click="addEditionCriterion()"
class="has-text-right is-block add-link">
class="has-text-right is-inline-block add-link">
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>
@ -591,7 +591,7 @@
);
});
if (otherMetadatumOfSameTypeIndex < 0 && metadatum.metadata_type_object.component != 'tainacan-user') {
if ((otherMetadatumOfSameTypeIndex < 0 && metadatum.metadata_type_object.component != 'tainacan-user') || metadatum.parent > 0) {
delete validEditionActions[actionKey];
}
}

View File

@ -116,7 +116,8 @@ export default {
sourceCollection: this.collection.id,
hideWhenManualCollection: true
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
}
}

View File

@ -1124,7 +1124,7 @@
background-color: var(--tainacan-gray1);
&:hover {
background-color: var(--tainacan-blue1);
background-color: var(--tainacan-primary);
}
}

View File

@ -1010,7 +1010,7 @@
background-color: var(--tainacan-gray1);
&:hover {
background-color: var(--tainacan-blue1);
background-color: var(--tainacan-primary);
}
}

View File

@ -4,7 +4,7 @@
aria-modal
autofocus
role="alertdialog"
class="tainacan-form dialog"
class="tainacan-form tainacan-dialog dialog"
ref="customDialog">
<div
class="modal-card"

View File

@ -14,7 +14,8 @@
scroll="keep"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<!-- <div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('label_document') }}</h2>

View File

@ -35,7 +35,8 @@
scroll="keep"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus
role="dialog"

View File

@ -72,6 +72,7 @@ export default {
color: var(--tainacan-secondary);
margin-bottom: 0;
margin-top: 0;
white-space: normal;
}
}

View File

@ -5,7 +5,7 @@
role="alertdialog"
tabindex="-1"
aria-modal
class="tainacan-form dialog"
class="tainacan-form tainacan-dialog dialog"
ref="itemCopyDialog">
<div
class="modal-card"
@ -58,9 +58,9 @@
</button>
<button
v-if="!hasCopied"
:class="{'is-loading': isLoading }"
:class="{'is-loading': isLoading, 'is-success': !isLoading }"
type="submit"
class="button is-success"
class="button"
:disabled="copyCount <= 0 || isNaN(copyCount)"
@click="generateCopies();">
{{ $i18n.get('run') }}
@ -187,7 +187,8 @@
collectionId: this.collectionId
},
width: 'calc(100% - (2 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.$parent.close();
@ -216,6 +217,5 @@
margin-top: 12px;
}
</style>

View File

@ -12,13 +12,6 @@
<div class="label">{{ $i18n.getHelperTitle('metadata', 'semantic_uri') }}</div>
<div class="value">{{ metadatum.semantic_uri }}</div>
</div>
<!-- <div class="field">
<div class="label">{{ $i18n.getHelperTitle('metadata', 'status') }}</div>
<div class="value">
<template v-if="metadatum.status === 'publish'">{{ $i18n.get('publish_visibility') }}</template>
<template v-if="metadatum.status === 'private'">{{ $i18n.get('private_visibility') }}</template>
</div>
</div> -->
<div class="field">
<div class="label">{{ $i18n.get('label_display') }}</div>
<div class="value">

View File

@ -497,7 +497,7 @@
.collapse-all {
display: inline-flex;
align-items: center;
margin-left: -0.65em;
margin-left: -0.5em !important;
}
.collapse-all__text {
font-size: 0.75em !important;

View File

@ -50,7 +50,8 @@ const tainacanErrorHandler = function(error){
hideCancel: true
},
ariaRole: 'alertdialog',
ariaModal: true
ariaModal: true,
customClass: 'tainacan-modal'
});
}
});

View File

@ -31,7 +31,7 @@ export const eventBusItemMetadata = new Vue({
this.$emit('isUpdatingValue', true);
if (values.length > 0 && values[0].value) {
if (values.length > 0 && values[0] && values[0].value) {
let onlyValues = values.map((aValueObject) => aValueObject.value);
values = onlyValues;
}

View File

@ -201,7 +201,7 @@ export const fetchCollection = ({ commit, }, id) => {
export const fetchCollectionBasics = ({ commit }, {collectionId, isContextEdit }) => {
return new Promise((resolve, reject) => {
let endpoint = '/collections/' + collectionId + '?fetch_only=name,url,allow_comments,hide_items_thumbnail_on_lists';
let endpoint = '/collections/' + collectionId + '?fetch_only=name,url,status,allow_comments,hide_items_thumbnail_on_lists';
if (isContextEdit)
endpoint += '&context=edit';

View File

@ -55,12 +55,12 @@ export const fetchMetadataList = ({ commit }, { collectionId, onlyTaxonomies } )
let endpoint = '';
if (collectionId && collectionId != 'default')
endpoint += '/collection/' + collectionId + '/metadata/';
endpoint += '/collection/' + collectionId + '/metadata/?nopaging=1';
else
endpoint += '/metadata/';
endpoint += '/metadata/?nopaging=1';
if (onlyTaxonomies)
endpoint += '?metaquery[0][key]=metadata_type&metaquery[0][value]=Tainacan\\Metadata_Types\\Taxonomy';
endpoint += '&metaquery[0][key]=metadata_type&metaquery[0][value]=Tainacan\\Metadata_Types\\Taxonomy';
return new Promise((resolve, reject) => {
axios.tainacan.get(endpoint)

View File

@ -30,6 +30,10 @@ export const getActivities = state => {
return state.activities;
};
export const getStartDate = state => {
return state.startDate;
};
export const getStackedBarChartOptions = state => {
return state.stackedBarChartOptions;
};
@ -38,6 +42,10 @@ export const getHorizontalBarChartOptions = state => {
return state.horizontalBarChartOptions;
};
export const getVisibilityHorizontalBarChartOptions = state => {
return state.visibilityHorizontalBarChartOptions;
};
export const getDonutChartOptions = state => {
return state.donutChartOptions;
};

View File

@ -12,6 +12,7 @@ const state = {
metadata: {},
metadataList: {},
activities: {},
startDate: '',
stackedBarChartOptions: {
chart: {
type: 'bar',
@ -129,7 +130,6 @@ const state = {
},
fill: {
opacity: 1
},
legend: {
position: 'top',
@ -183,7 +183,7 @@ const state = {
}
}
},
treeMapOptions: {
treeMapChartOptions: {
legend: {
show: false
},
@ -193,8 +193,84 @@ const state = {
},
title: {
text: ''
},
plotOptions: {
treemap: {
enableShades: false
}
}
},
visibilityHorizontalBarChartOptions: {
chart: {
type: 'bar',
height: 350,
stacked: true,
stackType: 'normal',
toolbar: {
show: false
},
zoom: {
type: 'y',
enabled: false,
autoScaleYaxis: true,
}
},
plotOptions: {
bar: {
horizontal: true,
columnWidth: '100%',
barHeight: '80%'
},
},
title: {
text: ''
},
xaxis: {
type: 'category',
categories: [],
tooltip: { enabled: true },
axisBorder: {
show: false
},
axisTicks: {
show: false,
},
labels: {
show: false
}
},
yaxis: {
tooltip: { enabled: true },
axisBorder: {
show: false
},
axisTicks: {
show: false,
},
labels: {
show: true,
style: {
fontSize: '17px',
fontFamily: 'TainacanIcons, Arial, sans-serif',
}
}
},
tooltip: {
enabled: true
},
fill: {
opacity: 1
},
grid: {
show: false
},
legend: {
position: 'top',
horizontalAlign: 'left',
offsetX: 40
}
},
};
export default {

View File

@ -32,6 +32,10 @@ export const setActivities = (state, activities) => {
state.activities = activities;
};
export const setStartDate = (state, startDate) => {
state.startDate = startDate;
};
export const setStackedBarChartOptions = (state, stackedBarChartOptions) => {
state.stackedBarChartOptions = stackedBarChartOptions;
};
@ -40,6 +44,10 @@ export const setHorizontalBarChartOptions = (state, horizontalBarChartOptions) =
state.horizontalBarChartOptions = horizontalBarChartOptions;
};
export const setVisibilityHorizontalBarChartOptions = (state, visibilityHorizontalBarChartOptions) => {
state.visibilityHorizontalBarChartOptions = visibilityHorizontalBarChartOptions;
};
export const setDonutChartOptions = (state, donutChartOptions) => {
state.donutChartOptions = donutChartOptions;
};

View File

@ -477,7 +477,8 @@ export default {
parent: this,
component: AvailableImportersModal,
hasModalCard: true,
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
searchCollections() {

View File

@ -298,7 +298,8 @@
:active.sync="isSelectingFilterType"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus
role="dialog"
@ -455,7 +456,8 @@ export default {
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next()

View File

@ -441,7 +441,7 @@
trap-focus
aria-modal
aria-role="dialog"
custom-class="tainacan-form filters-menu">
custom-class="tainacan-modal tainacan-form filters-menu">
<filters-items-list
:is-loading-items="isLoadingItems"
autofocus="true"
@ -889,7 +889,8 @@
targetCollection: this.collectionId,
hideWhenManualCollection: true
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
openExposersModal(selectedItems) {
@ -902,7 +903,8 @@
totalItems: this.totalItems,
selectedItems: selectedItems
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
})
},
onOpenCollectionsModal() {
@ -910,7 +912,8 @@
parent: this,
component: CollectionsModal,
hasModalCard: true,
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
updateSearch() {
@ -1222,7 +1225,8 @@
showNeverShowAgainOption: offerCheckbox && tainacan_plugin.user_caps != undefined && Object.keys(tainacan_plugin.user_caps).length != undefined && Object.keys(tainacan_plugin.user_caps).length > 0,
messageKeyForUserPrefs: 'ItemsHiddenDueSorting'
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
hideFiltersOnMobile: _.debounce( function() {

View File

@ -451,7 +451,8 @@ export default {
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next();
@ -597,7 +598,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
toggleMetadatumEdition(metadatumId) {

View File

@ -154,23 +154,70 @@
</div>
</div>
<!-- Visibility (status public or private) -------------------------------- -->
<!-- Status (status public or private) -------------------------------- -->
<div class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.get('label_visibility') }}</label>
<label>{{ $i18n.getHelperTitle('items', 'status') }}</label>
</div>
<div class="section-status">
<div class="field has-addons">
<span v-if="item.status != 'private'">
<span class="icon">
<i class="tainacan-icon tainacan-icon-public"/>
</span> {{ $i18n.get('publish_visibility') }}
</span> {{ $i18n.get('status_public') }}
</span>
<span v-if="item.status == 'private'">
<span class="icon">
<i class="tainacan-icon tainacan-icon-private"/>
</span> {{ $i18n.get('private_visibility') }}
</span> {{ $i18n.get('status_private') }}
</span>
</div>
</div>
</div>
<!-- Visibility -->
<div class="column is-narrow">
<div class="section-label">
<label>{{ $i18n.get('label_visibility') }}</label>
</div>
<div class="section-status">
<div class="field has-addons">
<span style="display: flex;">
<span class="icon">
<i
v-if="itemVisibility == 'open_access'"
class="tainacan-icon tainacan-icon-see"/>
<i
class="tainacan-icon tainacan-icon-svg"
style="display: flex;"
v-else>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
width="24px"
height="24px"
viewBox="-1 -1 8 8">
<g
id="layer1"
transform="translate(-71.664352,-160.89128)">
<path
style="fill:var(--tainacan-gray3);fill-opacity:1;stroke:none;stroke-width:0.332731"
d="m 74.839398,162.85685 c 0.09358,0 0.181945,0.0178 0.265146,0.052 0.08321,0.0356 0.153355,0.0831 0.213173,0.14544 0.06238,0.0624 0.110471,0.13511 0.145584,0.21852 0.03768,0.0806 0.05718,0.16896 0.05718,0.26522 0,0.0973 -0.0196,0.18714 -0.05718,0.2702 -0.03494,0.0806 -0.08321,0.14936 -0.145584,0.20783 -0.05978,0.0599 -0.129971,0.10801 -0.213173,0.14544 -0.08321,0.0356 -0.171572,0.052 -0.265146,0.052 -0.09358,0 -0.181945,-0.0179 -0.265146,-0.052 -0.08061,-0.0378 -0.150755,-0.0859 -0.213173,-0.14544 -0.06238,-0.0585 -0.11179,-0.12726 -0.145585,-0.20783 -0.03494,-0.083 -0.05198,-0.17289 -0.05198,-0.2702 0,-0.0962 0.01675,-0.18466 0.05198,-0.26522 0.03386,-0.0831 0.08321,-0.15578 0.145585,-0.21852 0.06238,-0.0624 0.132573,-0.11051 0.213173,-0.14544 0.08321,-0.0321 0.171571,-0.052 0.265146,-0.052 z"
id="path5508" />
<path
id="path5461"
style="fill:var(--tainacan-gray3);fill-opacity:1;stroke:none;stroke-width:0.332732"
d="m 74.840268,161.8152 c -0.284646,0 -0.556123,0.0421 -0.816062,0.12511 -0.257339,0.0834 -0.494574,0.20141 -0.712908,0.35362 -0.215775,0.15329 -0.404697,0.33189 -0.571064,0.53975 -0.16601,0.20497 -0.301577,0.43572 -0.401586,0.68713 0.100026,0.24634 0.235559,0.47502 0.401586,0.68527 0.166367,0.20817 0.355335,0.38752 0.571064,0.53977 0.218341,0.14936 0.45556,0.267 0.712908,0.35006 0.259942,0.083 0.531423,0.12333 0.816062,0.12333 h 0.123411 c 0.04156,0 0.08074,-0.004 0.11974,-0.0107 -0.01034,-0.0732 -0.01461,-0.14473 -0.01461,-0.21745 0.0027,-0.0378 0.0053,-0.0752 0.0053,-0.11408 0.0028,-0.0417 0.0068,-0.0854 0.01462,-0.13083 -0.07667,0.0143 -0.158987,0.0214 -0.248677,0.0214 -0.211852,0 -0.418798,-0.0285 -0.618955,-0.0884 -0.19756,-0.0584 -0.385072,-0.14258 -0.561853,-0.2506 -0.174173,-0.10658 -0.33177,-0.23526 -0.473425,-0.3887 -0.139059,-0.15578 -0.254594,-0.33009 -0.348169,-0.52131 0.09618,-0.20034 0.216239,-0.37725 0.35921,-0.53053 0.145587,-0.15222 0.304788,-0.28054 0.478964,-0.38867 0.176742,-0.1105 0.362449,-0.19464 0.56001,-0.2506 0.197559,-0.0545 0.401772,-0.0828 0.609743,-0.0828 0.210571,0 0.415875,0.0285 0.613431,0.0884 0.200161,0.0599 0.388758,0.14545 0.565538,0.25596 0.176775,0.10765 0.334374,0.23812 0.473428,0.39422 0.137741,0.15329 0.254594,0.32617 0.348169,0.51583 -0.01426,0.0285 -0.02923,0.0524 -0.04605,0.0774 -0.01426,0.025 -0.03101,0.047 -0.04792,0.072 0.155958,0.0356 0.298689,0.10016 0.427371,0.19357 0.06238,-0.11694 0.114785,-0.23065 0.160271,-0.34259 -0.09749,-0.25201 -0.227859,-0.4818 -0.394219,-0.68713 -0.166368,-0.20818 -0.360082,-0.38646 -0.578427,-0.53975 -0.218343,-0.15221 -0.456649,-0.27056 -0.716588,-0.35362 -0.25734,-0.0831 -0.527216,-0.12512 -0.810547,-0.12512 z m 1.541874,2.02267 c -0.08238,0 -0.158347,0.0179 -0.230248,0.0478 -0.07073,0.0321 -0.131931,0.073 -0.186045,0.12726 -0.0529,0.0528 -0.09635,0.11586 -0.127119,0.18786 -0.03137,0.0706 -0.04605,0.1465 -0.04605,0.2285 v 0.23776 h -0.117885 c -0.0658,0 -0.122129,0.025 -0.167652,0.0699 -0.04613,0.0442 -0.06816,0.0987 -0.06816,0.16397 v 1.18268 c 0,0.0639 0.0221,0.11978 0.06816,0.16576 0.04552,0.0456 0.101846,0.0681 0.167652,0.0681 h 1.416601 c 0.06521,0 0.121522,-0.0214 0.16765,-0.0681 0.04549,-0.0442 0.06816,-0.10051 0.06816,-0.16576 v -1.18268 c 0,-0.0652 -0.02281,-0.11977 -0.06816,-0.16397 -0.04613,-0.0456 -0.102451,-0.0699 -0.16765,-0.0699 h -0.117888 v -0.23776 c 0,-0.0816 -0.01533,-0.15757 -0.04605,-0.2285 -0.03137,-0.072 -0.07483,-0.13511 -0.128937,-0.18786 -0.05286,-0.0542 -0.114108,-0.0959 -0.186045,-0.12726 -0.07073,-0.0321 -0.148473,-0.0478 -0.230283,-0.0478 z m 0,0.23777 c 0.0504,0 0.09881,0.007 0.141841,0.025 0.04242,0.018 0.07917,0.0449 0.110544,0.0773 0.03244,0.0321 0.05707,0.0681 0.07554,0.11051 0.01782,0.0431 0.0278,0.0895 0.0278,0.14011 v 0.23775 h -0.70922 v -0.23775 c 0,-0.0503 0.0093,-0.097 0.02745,-0.14011 0.01782,-0.0424 0.04231,-0.0791 0.07368,-0.11051 0.03244,-0.0321 0.06933,-0.0589 0.112361,-0.0773 0.04242,-0.0178 0.08898,-0.025 0.139987,-0.025 z m 0,1.17897 c 0.06517,0 0.121522,0.025 0.16765,0.0699 0.04552,0.046 0.07002,0.1023 0.07002,0.16755 0,0.0659 -0.02462,0.12226 -0.07002,0.16968 -0.04613,0.046 -0.102451,0.0681 -0.16765,0.0681 -0.0658,0 -0.120276,-0.0214 -0.165798,-0.0681 -0.04613,-0.0474 -0.07002,-0.10374 -0.07002,-0.16968 0,-0.0652 0.02388,-0.12157 0.07002,-0.16755 0.04549,-0.0456 0.09999,-0.0699 0.165798,-0.0699 z" />
<g
id="use1344"
transform="matrix(0.157413,0,0,0.157413,74.965914,165.96635)"
style="fill:var(--tainacan-gray3);fill-opacity:1" />
</g>
</svg>
</i>
</span>
{{ $i18n.get('label_' + itemVisibility) }}
</span>
</div>
</div>
@ -369,6 +416,9 @@
},
totalAttachments() {
return this.getTotalAttachments();
},
itemVisibility() {
return (this.collection && this.collection.status == 'publish' && this.item && this.item.status == 'publish') ? 'open_access' : 'restrict_access'
}
},
created() {
@ -433,7 +483,8 @@
itemURL: this.item.url,
totalItems: 1,
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
}
}

View File

@ -6,11 +6,11 @@ button.link-style:active {
cursor: pointer;
font-size: inherit;
text-transform: inherit;
color: var(--tainacan-secondary);
color: var(--tainacan-secondary) !important;
padding: 0;
margin: 0;
font-weight: normal;
background: transparent;
background: transparent !important;
&:hover {
text-decoration: underline;
@ -82,6 +82,11 @@ button.link-style:active {
height: 1.625em !important;
line-height: 0.75em;
}
&.is-loading {
color: transparent !important;
background-color: transparent !important;
border-color: var(--tainacan-gray2) !important;
}
&:not(.is-small):not(.is-medium):not(.is-large) {
height: 1.875em !important;
font-size: 0.875em !important;

View File

@ -6,6 +6,7 @@
}
.modal-content {
background-color: var(--tainacan-background-color);
padding: 24px 18px var(--tainacan-one-column);
padding: 24px 18px 24px 4.1666667vw;
margin: 0;
@ -20,6 +21,7 @@
h3 {
font-size: 1em;
color: var(--tainacan-heading-color);
margin-bottom: 1em;
}
}
@ -40,6 +42,7 @@
margin: 0 12% 0 0;
margin: 0 12vw 0 0;
padding: var(--tainacan-container-padding);
max-width: calc(100% - 12vw) !important;
}
}
}

View File

@ -1,5 +1,5 @@
// Tainacan modals
.modal .animation-content {
.tainacan-modal .animation-content {
background: none;
width: calc(100% - (2 * var(--tainacan-one-column)));
width: 91.6666667vw;
@ -13,11 +13,8 @@
max-height: 95vh;
}
}
.modal.is-full-screen > .animation-content,
.modal.is-full-screen > .animation-content > .modal-card {
background-color: transparent;
}
.modal .modal-close {
.tainacan-modal .modal-close {
z-index: 99999;
@media only screen and (max-width: 768px) {
&:before, &:after { background-color: #298596; }
@ -98,8 +95,9 @@
display: block;
}
}
// Bulma modals customized for Tainacan (custom-dialog.vue)
.dialog {
.tainacan-dialog {
.modal-background {
background-color: rgba(0, 0, 0, 0.70);

View File

@ -12,24 +12,28 @@
&.is-dark .button:hover {
background-color: var(--tainacan-gray2) !important;
color: var(--tainacan-info-color) !important;
font-size: 0.875em;
}
&.is-warning,
&.is-warning .button,
&.is-warning .button:hover {
background-color: var(--tainacan-yellow1) !important;
color: var(--tainacan-warning) !important;
font-size: 0.875em;
}
&.is-danger,
&.is-danger .button,
&.is-danger .button:hover {
background-color: var(--tainacan-red1) !important;
color: var(--tainacan-danger) !important;
font-size: 0.875em;
}
&.is-success,
&.is-success .button,
&.is-success .button:hover {
background-color: var(--tainacan-green1) !important;
color: var(--tainacan-success) !important;
font-size: 0.875em;
}
}
}

View File

@ -62,7 +62,7 @@ class Admin {
$this->menu_slug,
__('Reports', 'tainacan'),
__('Reports', 'tainacan'),
'read',
'manage_tainacan',
'tainacan_reports',
array( &$this, 'reports_page' )
);

View File

@ -12,8 +12,8 @@ function tainacan_blocks_initialize() {
add_action('init', 'tainacan_blocks_add_plugin_settings', 90);
add_action('init', 'tainacan_blocks_add_plugin_admin_settings', 90);
add_action('init', 'register_tainacan_blocks_add_gutenberg_blocks');
add_action('wp_enqueue_scripts', 'unregister_taiancan_blocks');
add_action('admin_enqueue_scripts', 'unregister_taiancan_blocks');
add_action('wp_enqueue_scripts', 'unregister_tainacan_blocks');
add_action('admin_enqueue_scripts', 'unregister_tainacan_blocks');
}
}
@ -33,11 +33,11 @@ function register_tainacan_blocks_add_gutenberg_blocks() {
tainacan_blocks_register_tainacan_carousel_collections_list();
}
function unregister_taiancan_blocks() {
function unregister_tainacan_blocks() {
global $post;
if(!$post) return;
$not_allowed = apply_filters('posts-names-to-unregister-taiancan-blocks', []);
$not_allowed = apply_filters('posts-names-to-unregister-tainacan-blocks', []);
$current_page = $post->post_name;
if ( in_array($current_page, $not_allowed) ) {

View File

@ -189,6 +189,10 @@
@media only screen and (max-width: 768px) { max-width: 80%; }
}
}
.components-radio-control__option .components-radio-control__input {
min-width: 20px;
min-height: 20px;
}
.components-radio-control__option .components-radio-control__input::before {
border-width: 0px;
}

View File

@ -245,6 +245,9 @@ export default {
},
created() {
this.tainacanAxios = axios.create({ baseURL: this.tainacanApiRoot });
if (tainacan_plugin && tainacan_plugin.nonce)
this.tainacanAxios.defaults.headers.common['X-WP-Nonce'] = tainacan_plugin.nonce;
this.fetchCollections();
if (!isNaN(this.maxCollectionsPerScreen)) {

View File

@ -218,6 +218,8 @@ export default {
},
created() {
this.tainacanAxios = axios.create({ baseURL: this.tainacanApiRoot });
if (tainacan_plugin && tainacan_plugin.nonce)
this.tainacanAxios.defaults.headers.common['X-WP-Nonce'] = tainacan_plugin.nonce;
this.offset = 0;
this.fetchFacets();
},

Some files were not shown because too many files have changed in this diff Show More