commit
f24e2398e3
|
@ -31,6 +31,7 @@ module.exports = {
|
|||
'_': true,
|
||||
'jQuery': true,
|
||||
'tainacan_extra_components': true,
|
||||
'tainacan_extra_plugins': true
|
||||
'tainacan_extra_plugins': true,
|
||||
'grecaptcha': true
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ npm-debug.log
|
|||
src/assets/js/*.js
|
||||
src/assets/js/*.js.LICENSE
|
||||
src/assets/js/*.js.LICENSE.txt
|
||||
src/assets/js/*.js.map
|
||||
src/assets/*.js
|
||||
last-js-build.md5
|
||||
last-sass-build.md5
|
||||
|
|
37
build.sh
37
build.sh
|
@ -12,12 +12,12 @@ current_OS=`uname`
|
|||
|
||||
# For macOS (Darwin)
|
||||
if [ $current_OS == "Darwin" ]; then
|
||||
find src ./webpack.config.js -type f \( -name "*.js" -or -name "*.vue" -or -name "webpack.config.js" \) -exec md5 {} \; | sort -k 2 | md5 > last-js-build.md5
|
||||
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 md5 {} \; | sort -k 2 | md5 > 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 md5 {} \; | sort -k 2 | md5 > last-sass-build.md5
|
||||
find ./composer.json -type f \( -name "composer.json" \) -exec md5 {} \; | sort -k 2 | md5 > last-composer-build.md5
|
||||
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 ./webpack.config.js -type f \( -name "*.js" -or -name "*.vue" -or -name "webpack.config.js" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-js-build.md5
|
||||
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 ./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
|
||||
|
@ -45,11 +45,27 @@ then
|
|||
fi
|
||||
|
||||
new_md5_js=$(<last-js-build.md5)
|
||||
|
||||
is_prod_build=false
|
||||
if [ "$current_md5_js" != "$new_md5_js" ]
|
||||
then
|
||||
npm run build
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--prod)
|
||||
is_prod_build=true
|
||||
echo "$(tput setab 4) $(tput sgr 0) $(tput setab 4) $(tput sgr 0) Building in production mode $(tput setab 4) $(tput sgr 0) $(tput setab 4) $(tput sgr 0)"
|
||||
npm run build-prod
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$is_prod_build" == false ]
|
||||
then
|
||||
echo "$(tput setab 2) $(tput sgr 0) $(tput setab 2) $(tput sgr 0) Building in development mode $(tput setab 2) $(tput sgr 0) $(tput setab 2) $(tput sgr 0)"
|
||||
npm run build
|
||||
fi
|
||||
fi
|
||||
### END npm build ###
|
||||
|
||||
## Fetch PDF.js
|
||||
## Commented as we have a modified version of its code.
|
||||
|
@ -61,7 +77,6 @@ fi
|
|||
# rm pdfjs-1.9.426-dist.zip
|
||||
# fi
|
||||
|
||||
|
||||
echo "Updating files in $wp_plugin_dir"
|
||||
|
||||
rm -rf $wp_plugin_dir
|
||||
|
@ -77,7 +92,17 @@ rsync -axz --exclude='vendor/bin/phpc*' --exclude='vendor/squizlabs' --exclude='
|
|||
--exclude='vendor/tecnickcom/tcpdf/examples' \
|
||||
src/* $wp_plugin_dir/
|
||||
|
||||
echo "Removing unecessary source files"
|
||||
rm -rf $wp_plugin_dir/scss
|
||||
find $wp_plugin_dir/views/ -type f -name '*.js' ! -path "${wp_plugin_dir}/views/libs/*" -exec rm {} +
|
||||
find $wp_plugin_dir/views/ -type f -name '*.vue' -exec rm {} +
|
||||
find $wp_plugin_dir/views/ -type f -name '*.scss' -exec rm {} +
|
||||
find $wp_plugin_dir/views/ -type f -name '*.sass' -exec rm {} +
|
||||
find $wp_plugin_dir/views/ -type f -name '*.js' ! -path "${wp_plugin_dir}/views/libs/*" -exec rm {} +
|
||||
find $wp_plugin_dir/views/ -type d -empty -delete
|
||||
|
||||
if [ "$is_prod_build" == true ]
|
||||
then
|
||||
find $wp_plugin_dir/assets/js/ -type f -name '*.js.map' -exec rm {} +
|
||||
fi
|
||||
|
||||
echo "Build complete!"
|
||||
|
|
|
@ -35,7 +35,9 @@ sass -E 'UTF-8' --cache-location .tmp/sass-cache-12 src/views/gutenberg-blocks/t
|
|||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-13 src/views/gutenberg-blocks/tainacan-facets/faceted-search/faceted-search.scss:src/assets/css/tainacan-gutenberg-block-faceted-search.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-14 src/views/gutenberg-blocks/gutenberg-blocks-style.scss:src/assets/css/tainacan-gutenberg-block-common-styles.css
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-14 src/views/gutenberg-blocks/tainacan-items/item-submission-form/item-submission-form.scss:src/assets/css/tainacan-gutenberg-block-item-submission-form.css
|
||||
|
||||
sass -E 'UTF-8' --cache-location .tmp/sass-cache-15 src/views/gutenberg-blocks/gutenberg-blocks-style.scss:src/assets/css/tainacan-gutenberg-block-common-styles.css
|
||||
|
||||
echo "Compilação do Sass Concluído!"
|
||||
exit 0
|
||||
|
|
|
@ -1256,6 +1256,23 @@
|
|||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@npmcli/move-file": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.0.1.tgz",
|
||||
"integrity": "sha512-Uv6h1sT+0DrblvIrolFtbvM1FgWm+/sy4B3pvLp67Zys+thcukzS5ekn7HsZFGpWP4Q3fYJCljbWQE/XivMRLw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mkdirp": "^1.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"mkdirp": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/events": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
||||
|
@ -1273,6 +1290,12 @@
|
|||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/json-schema": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz",
|
||||
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/minimatch": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
|
||||
|
@ -1548,9 +1571,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"aggregate-error": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
||||
"integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
|
||||
"integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"clean-stack": "^2.0.0",
|
||||
|
@ -2362,11 +2385,11 @@
|
|||
}
|
||||
},
|
||||
"buefy": {
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.9.3.tgz",
|
||||
"integrity": "sha512-Xqfo3ppeBo8Fwhb2fLwWnpkIC/1thPErU7DX3HksxTHxrSMixJ2BYkf3f6aWv4Ffx/FWX5UHnUrgtT7o7slnDA==",
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.9.4.tgz",
|
||||
"integrity": "sha512-LRSIYVNrKTPQhmNRegASkntX+ObtZ7aSSA/3cybDKXzGtPNy8g8cl2tp79Rl8/LBVH/KkRT5rmmzJ21nxz9IcQ==",
|
||||
"requires": {
|
||||
"bulma": "0.9.0"
|
||||
"bulma": "0.9.1"
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
|
@ -2405,9 +2428,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"bulma": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.0.tgz",
|
||||
"integrity": "sha512-rV75CJkubNUroAt0qCRkjznZLoaXq/ctfMXsMvKSL84UetbSyx5REl96e8GoQ04G4Tkw0XF3STECffTOQrbzOQ=="
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.1.tgz",
|
||||
"integrity": "sha512-LSF69OumXg2HSKl2+rN0/OEXJy7WFEb681wtBlNS/ulJYR27J3rORHibdXZ6GVb/vyUzzYK/Arjyh56wjbFedA=="
|
||||
},
|
||||
"bytes": {
|
||||
"version": "3.0.0",
|
||||
|
@ -2416,31 +2439,36 @@
|
|||
"dev": true
|
||||
},
|
||||
"cacache": {
|
||||
"version": "13.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz",
|
||||
"integrity": "sha512-5ZvAxd05HDDU+y9BVvcqYu2LLXmPnQ0hW62h32g4xBTgL/MppR4/04NHfj/ycM2y6lmTnbw6HVi+1eN0Psba6w==",
|
||||
"version": "15.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.5.tgz",
|
||||
"integrity": "sha512-lloiL22n7sOjEEXdL8NAjTgv9a1u43xICE9/203qonkZUCj5X1UEWIdf2/Y0d6QcCtMzbKQyhrcDbdvlZTs/+A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chownr": "^1.1.2",
|
||||
"figgy-pudding": "^3.5.1",
|
||||
"@npmcli/move-file": "^1.0.1",
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"glob": "^7.1.4",
|
||||
"graceful-fs": "^4.2.2",
|
||||
"infer-owner": "^1.0.4",
|
||||
"lru-cache": "^5.1.1",
|
||||
"minipass": "^3.0.0",
|
||||
"lru-cache": "^6.0.0",
|
||||
"minipass": "^3.1.1",
|
||||
"minipass-collect": "^1.0.2",
|
||||
"minipass-flush": "^1.0.5",
|
||||
"minipass-pipeline": "^1.2.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"move-concurrently": "^1.0.1",
|
||||
"p-map": "^3.0.0",
|
||||
"mkdirp": "^1.0.3",
|
||||
"p-map": "^4.0.0",
|
||||
"promise-inflight": "^1.0.1",
|
||||
"rimraf": "^2.7.1",
|
||||
"ssri": "^7.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"ssri": "^8.0.0",
|
||||
"tar": "^6.0.2",
|
||||
"unique-filename": "^1.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"chownr": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
|
||||
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
|
||||
"dev": true
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
|
@ -2455,53 +2483,57 @@
|
|||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
|
||||
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
|
||||
"dev": true
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
|
||||
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"yallist": "^3.0.2"
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
|
||||
"dev": true
|
||||
},
|
||||
"p-map": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
|
||||
"integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
|
||||
"integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"aggregate-error": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"ssri": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-7.1.0.tgz",
|
||||
"integrity": "sha512-77/WrDZUWocK0mvA5NTRQyveUf+wsrIc6vyrxpS8tVvYBcX215QbafrJR3KtkpskIzoFLqqNuuYQvxaMjXJ/0g==",
|
||||
"tar": {
|
||||
"version": "6.0.5",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-6.0.5.tgz",
|
||||
"integrity": "sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"figgy-pudding": "^3.5.1",
|
||||
"minipass": "^3.1.1"
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"minipass": "^3.0.0",
|
||||
"minizlib": "^2.1.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
@ -6198,9 +6230,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
||||
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
|
@ -6732,14 +6764,32 @@
|
|||
}
|
||||
},
|
||||
"minipass-pipeline": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.3.tgz",
|
||||
"integrity": "sha512-cFOknTvng5vqnwOpDsZTWhNll6Jf8o2x+/diplafmxpuIymAjzoOolZG0VvQf3V2HgqzJNhnuKHYp2BqDgz8IQ==",
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz",
|
||||
"integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
|
||||
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.0.0",
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"mixin-deep": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
|
||||
|
@ -8919,6 +8969,15 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz",
|
||||
"integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"serve-index": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
|
||||
|
@ -9429,6 +9488,15 @@
|
|||
"resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-2.0.0.tgz",
|
||||
"integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
|
||||
},
|
||||
"ssri": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz",
|
||||
"integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"static-extend": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
|
||||
|
@ -10016,27 +10084,46 @@
|
|||
"inherits": "2"
|
||||
}
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "2.3.6",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.6.tgz",
|
||||
"integrity": "sha512-I8IDsQwZrqjdmOicNeE8L/MhwatAap3mUrtcAKJuilsemUNcX+Hier/eAzwStVqhlCxq0aG3ni9bK/0BESXkTg==",
|
||||
"terser": {
|
||||
"version": "4.8.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz",
|
||||
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cacache": "^13.0.1",
|
||||
"commander": "^2.20.0",
|
||||
"source-map": "~0.6.1",
|
||||
"source-map-support": "~0.5.12"
|
||||
},
|
||||
"dependencies": {
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-3.0.0.tgz",
|
||||
"integrity": "sha512-gHAVFtJz1gQW5cu0btPtb+5Syo7K9hRj3b0lstgfglaBhbtcOCizsaPTnxOBGmF9iIgwsrSIiraBa2xzuWND7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cacache": "^15.0.3",
|
||||
"find-cache-dir": "^3.3.1",
|
||||
"jest-worker": "^25.4.0",
|
||||
"jest-worker": "^25.5.0",
|
||||
"p-limit": "^2.3.0",
|
||||
"schema-utils": "^2.6.6",
|
||||
"serialize-javascript": "^3.0.0",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^4.6.12",
|
||||
"terser": "^4.6.13",
|
||||
"webpack-sources": "^1.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "6.12.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
|
||||
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
|
@ -10046,15 +10133,15 @@
|
|||
}
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz",
|
||||
"integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==",
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"dev": true
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
|
||||
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||
"dev": true
|
||||
},
|
||||
"find-cache-dir": {
|
||||
|
@ -10136,13 +10223,14 @@
|
|||
}
|
||||
},
|
||||
"schema-utils": {
|
||||
"version": "2.6.6",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.6.tgz",
|
||||
"integrity": "sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA==",
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz",
|
||||
"integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "^6.12.0",
|
||||
"ajv-keywords": "^3.4.1"
|
||||
"@types/json-schema": "^7.0.5",
|
||||
"ajv": "^6.12.4",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
|
@ -10151,31 +10239,11 @@
|
|||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz",
|
||||
"integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"terser": {
|
||||
"version": "4.6.13",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-4.6.13.tgz",
|
||||
"integrity": "sha512-wMvqukYgVpQlymbnNbabVZbtM6PN63AzqexpwJL8tbh/mRT9LE5o+ruVduAGL7D6Fpjl+Q+06U5I9Ul82odAhw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^2.20.0",
|
||||
"source-map": "~0.6.1",
|
||||
"source-map-support": "~0.5.12"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -11717,6 +11785,16 @@
|
|||
"uuid": "^3.3.2"
|
||||
}
|
||||
},
|
||||
"webpack-merge": {
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.4.0.tgz",
|
||||
"integrity": "sha512-/scBgu8LVPlHDgqH95Aw1xS+L+PHrpHKOwYVGFaNOQl4Q4wwwWDarwB1WdZAbLQ24SKhY3Awe7VZGYAdp+N+gQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"clone-deep": "^4.0.1",
|
||||
"wildcard": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"webpack-sources": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
|
||||
|
@ -11771,6 +11849,12 @@
|
|||
"string-width": "^1.0.2 || 2"
|
||||
}
|
||||
},
|
||||
"wildcard": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz",
|
||||
"integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==",
|
||||
"dev": true
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
|
|
12
package.json
12
package.json
|
@ -4,12 +4,13 @@
|
|||
"author": "Eduardo <eduardo.humberto1992@gmail.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "cross-env NODE_ENV=development webpack --display-error-details --mode development --progress --hide-modules"
|
||||
"build": "cross-env NODE_ENV=development webpack --config webpack.dev.js --display-error-details --progress --hide-modules",
|
||||
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.prod.js --display-error-details --progress --hide-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"buefy": "^0.9.3",
|
||||
"bulma": "^0.9.0",
|
||||
"buefy": "^0.9.4",
|
||||
"bulma": "^0.9.1",
|
||||
"css-vars-ponyfill": "^2.3.1",
|
||||
"mdi": "^2.2.43",
|
||||
"moment": "^2.25.3",
|
||||
|
@ -44,12 +45,13 @@
|
|||
"postcss-loader": "^3.0.0",
|
||||
"sass-loader": "^7.3.1",
|
||||
"style-loader": "^0.23.1",
|
||||
"terser-webpack-plugin": "^2.3.6",
|
||||
"terser-webpack-plugin": "3.0.0",
|
||||
"vue-loader": "^15.9.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-bundle-analyzer": "^3.7.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-server": "^3.11.0"
|
||||
"webpack-dev-server": "^3.11.0",
|
||||
"webpack-merge": "^5.4.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
.tainacan-embed-container {
|
||||
position: relative;
|
||||
padding-bottom: 56.25%;
|
||||
padding-top: 30px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.tainacan-embed-container:not(.tainacan-embed-without-iframe) {
|
||||
padding-bottom: 56.25%;
|
||||
padding-top: 30px;
|
||||
}
|
||||
.tainacan-embed-container iframe,
|
||||
.tainacan-embed-container object,
|
||||
.tainacan-embed-container embed {
|
||||
|
|
|
@ -124,7 +124,8 @@
|
|||
text-decoration: none;
|
||||
padding: 8px 16px;
|
||||
display: block;
|
||||
line-height: 1.2em; }
|
||||
line-height: 1.2em;
|
||||
word-break: break-word; }
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container a > img {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -131,7 +131,8 @@
|
|||
text-decoration: none;
|
||||
padding: 8px 16px;
|
||||
display: block;
|
||||
line-height: 1.2em; }
|
||||
line-height: 1.2em;
|
||||
word-break: break-word; }
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel .swiper-container a > img {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -124,7 +124,8 @@
|
|||
text-decoration: none;
|
||||
padding: 8px 16px;
|
||||
display: block;
|
||||
line-height: 1.2em; }
|
||||
line-height: 1.2em;
|
||||
word-break: break-word; }
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel .swiper-container a > img {
|
||||
width: 100%;
|
||||
height: auto; }
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -84,6 +84,7 @@
|
|||
.wp-block-tainacan-modal .modal-search-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
margin-bottom: 6px; }
|
||||
.wp-block-tainacan-modal .modal-search-area .components-base-control {
|
||||
width: 60%; }
|
||||
|
@ -128,7 +129,7 @@
|
|||
padding-left: 1px; }
|
||||
.wp-block-tainacan-modal .modal-checkbox-list svg.components-checkbox-control__checked,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field svg.components-checkbox-control__checked {
|
||||
fill: black; }
|
||||
fill: inherit; }
|
||||
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item,
|
||||
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item,
|
||||
|
@ -157,6 +158,9 @@
|
|||
.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::before,
|
||||
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option .components-radio-control__input::before {
|
||||
border-width: 0px; }
|
||||
.wp-block-tainacan-modal .modal-loadmore-section {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAIA,KAAM;EACF,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAA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,MAAM;MAChB,YAAY,EAAE,GAAG;IAGrB;uHAAyC;MACrC,IAAI,EAAE,OAAO;IAGjB;;;gHACkC;MAC9B,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,UAAU;MAE3B;;;sHAAI;QACA,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;MAEtB;;;wHAAM;QACF,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,GAAG;QAEd,yCAA0C;UAP9C;;;4HAAM;YAO0C,SAAS,EAAE,GAAG;IAGlE;yJAA2E;MACvE,YAAY,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"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.wp-block-tainacan-faceted-search {
|
||||
margin: 2em auto; }
|
||||
margin: 0 auto; }
|
||||
.wp-block-tainacan-faceted-search .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1em;
|
||||
|
@ -249,5 +249,14 @@
|
|||
width: 50%; }
|
||||
.wp-block-tainacan-faceted-search .theme-items-list {
|
||||
max-width: 100% !important; }
|
||||
.wp-block-tainacan-faceted-search:not(.alignfull) .theme-items-list .search-control {
|
||||
padding: var(--tainacan-container-padding, 25px) var(--tainacan-container-padding, 25px) 20px var(--tainacan-container-padding, 25px); }
|
||||
.wp-block-tainacan-faceted-search:not(.alignfull) .theme-items-list #filters-modal .modal-content {
|
||||
padding: 24px 18px 24px var(--tainacan-container-padding, 25px); }
|
||||
.wp-block-tainacan-faceted-search:not(.alignfull) .theme-items-list #filter-menu-compress-button {
|
||||
border-radius: 2px; }
|
||||
.wp-block-tainacan-faceted-search:not(.alignfull) .theme-items-list #items-list-results .table-container {
|
||||
padding-left: var(--tainacan-container-padding, 25px);
|
||||
padding-right: var(--tainacan-container-padding, 25px); }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-faceted-search.css.map */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,iCAAkC;EAC9B,MAAM,EAAE,QAAQ;EAGhB,oDAAmB;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,oCAAmC;EAG9C,kDAAiB;IACb,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,MAAM;IAClB,KAAK,EAAE,oCAAmC;IAC1C,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,eAAe;EAE5B,yDAAwB;IACpB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,MAAM;IACjB,cAAc,EAAE,MAAM;IACtB,aAAa,EAAE,GAAG;IAClB,MAAM,EAAE,kCAAgC;IACxC,QAAQ,EAAE,MAAM;IAEhB;;;yEAGY;MACR,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B;UACd,gBAAgB,EAAE,6EAA2E;MAGrG,sFAAkB;QACd,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,QAAQ;QAClB,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,OAAO,EAAE,GAAG;QAEZ,iGAAW;UACP,gBAAgB,EAAE,wDAAsD;MAGhF,qFAAiB;QACb,eAAe,EAAE,KAAK;QACtB,gBAAgB,EAAE,4DAA0D;QAC5E,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;MAEf,2FAAuB;QACnB,gBAAgB,EAAE,qDAAmD;QACrE,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,GAAG;QACV,aAAa,EAAE,GAAG;QAClB,MAAM,EAAE,eAAe;QACvB,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI;QAEV,0GAAiB;UACb,KAAK,EAAE,GAAG;EAM1B,mDAAkB;IACd,SAAS,EAAE,eAAe;EAI1B,mFAAgB;IACZ,OAAO,EAAE,4HAA4H;EAEzI,iGAA8B;IAC1B,OAAO,EAAE,sDAAsD;EAEnE,gGAA6B;IACzB,aAAa,EAAE,GAAG;EAEtB,wGAAqC;IACjC,YAAY,EAAE,uCAAuC;IACrD,aAAa,EAAE,uCAAuC",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-facets/faceted-search/faceted-search.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-faceted-search.css"
|
||||
|
|
|
@ -179,47 +179,6 @@
|
|||
width: 100%;
|
||||
border: 1px solid var(--tainacan-block-gray3, #cbcbcb);
|
||||
box-shadow: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(auto-fill, 220px);
|
||||
grid-gap: 0px;
|
||||
justify-content: space-evenly;
|
||||
list-style-type: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin: 12px;
|
||||
width: 185px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
border: none;
|
||||
font-weight: bold;
|
||||
line-height: normal; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item img {
|
||||
height: auto;
|
||||
width: 185px;
|
||||
min-width: 185px;
|
||||
padding: 0px;
|
||||
margin-bottom: 0.5em; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item span.facet-item-count,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item span.facet-item-count {
|
||||
color: var(--tainacan-block-gray3, #cbcbcb); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item.facet-without-image img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item.facet-without-image img {
|
||||
display: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item:hover a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item:hover a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit li.facet-list-item {
|
||||
display: flex;
|
||||
align-items: flex-start; }
|
||||
|
@ -250,34 +209,288 @@
|
|||
.wp-block-tainacan-facets-list ul.facets-list-edit li.facet-list-item:hover button:hover {
|
||||
background-color: white !important;
|
||||
border: 1px solid var(--tainacan-block-gray3, #cbcbcb) !important; }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid {
|
||||
grid-template-columns: repeat(auto-fill, 100%); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item {
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item img {
|
||||
width: 100%; } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
justify-content: space-evenly;
|
||||
list-style-type: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7),
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7) {
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(5, 1fr); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-7 {
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(7, 1fr); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-6 {
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(6, 1fr); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-5 {
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(5, 1fr); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-4 {
|
||||
-ms-grid-columns: 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(4, 1fr); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-3,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-3 {
|
||||
-ms-grid-columns: 220px 220px 220px;
|
||||
grid-template-columns: repeat(3, 1fr); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-2,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-2 {
|
||||
-ms-grid-columns: 220px 220px;
|
||||
grid-template-columns: repeat(2, 1fr); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-1,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-1 {
|
||||
-ms-grid-columns: 220px;
|
||||
grid-template-columns: repeat(1, 1fr); }
|
||||
@media only screen and (max-width: 1600px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-7, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-6 {
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(6, 1fr); } }
|
||||
@media only screen and (max-width: 1400px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-7, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-6, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-5 {
|
||||
-ms-grid-columns: 220px 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(5, 1fr); } }
|
||||
@media only screen and (max-width: 1280px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7), .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-7, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-6, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-5, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7),
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-4 {
|
||||
-ms-grid-columns: 220px 220px 220px 220px;
|
||||
grid-template-columns: repeat(4, 1fr); } }
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7), .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-7, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-6, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-5, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-4, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-3,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7),
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-3 {
|
||||
-ms-grid-columns: 220px 220px 220px;
|
||||
grid-template-columns: repeat(3, 1fr); } }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7), .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-7, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-6, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-5, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-4, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-3, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-2,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7),
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-3,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-2 {
|
||||
-ms-grid-columns: 220px 220px;
|
||||
grid-template-columns: repeat(2, 1fr); } }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7), .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-7, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-6, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-5, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-4, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-3, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-2, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid.max-columns-count-1,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid:not(.max-columns-count-1):not(.max-columns-count-2):not(.max-columns-count-3):not(.max-columns-count-4):not(.max-columns-count-5):not(.max-columns-count-6):not(.max-columns-count-7),
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-3,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-2,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid.max-columns-count-1 {
|
||||
-ms-grid-columns: 220px;
|
||||
grid-template-columns: repeat(1, 1fr); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
flex-basis: 220px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
border: none;
|
||||
font-weight: bold;
|
||||
line-height: normal;
|
||||
display: block; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item:not(.facet-with-name-inside-image) img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item:not(.facet-with-name-inside-image) img {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
margin-bottom: 0.5em; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item:not(.facet-with-name-inside-image) span.facet-item-count,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item:not(.facet-with-name-inside-image) span.facet-item-count {
|
||||
color: var(--tainacan-block-gray3, #cbcbcb); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item.facet-with-name-inside-image a span,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item.facet-with-name-inside-image a span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
background: rgba(255, 255, 255, 0.75);
|
||||
opacity: 0;
|
||||
padding: 8px 12px;
|
||||
word-break: break-word;
|
||||
transition: opacity 0.5s ease;
|
||||
max-width: 100%; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item.facet-with-name-inside-image a span:first-of-type,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item.facet-with-name-inside-image a span:first-of-type {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
border-top-right-radius: 2px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item.facet-with-name-inside-image a span:last-of-type,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item.facet-with-name-inside-image a span:last-of-type {
|
||||
right: 0;
|
||||
top: 0;
|
||||
border-bottom-left-radius: 2px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item:hover.facet-with-name-inside-image a span,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item:hover.facet-with-name-inside-image a span {
|
||||
opacity: 1; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item:hover a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item:hover a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item svg,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item svg {
|
||||
fill: var(--tainacan-block-gray4, #555758);
|
||||
margin-left: auto;
|
||||
overflow: visible; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list {
|
||||
padding: 0;
|
||||
display: flex;
|
||||
padding-left: 0;
|
||||
margin: 0;
|
||||
margin-left: 0;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
align-items: self-start;
|
||||
list-style-type: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-7 {
|
||||
grid-template-columns: repeat(7, auto); }
|
||||
@media only screen and (max-width: 1600px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-7 {
|
||||
grid-template-columns: repeat(6, auto); } }
|
||||
@media only screen and (max-width: 1400px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-7 {
|
||||
grid-template-columns: repeat(5, auto); } }
|
||||
@media only screen and (max-width: 1280px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-7 {
|
||||
grid-template-columns: repeat(4, auto); } }
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-7 {
|
||||
grid-template-columns: repeat(3, auto); } }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-7 {
|
||||
grid-template-columns: repeat(2, auto); } }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-7,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-7 {
|
||||
grid-template-columns: repeat(1, auto); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-6 {
|
||||
grid-template-columns: repeat(6, auto); }
|
||||
@media only screen and (max-width: 1400px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-6 {
|
||||
grid-template-columns: repeat(5, auto); } }
|
||||
@media only screen and (max-width: 1280px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-6 {
|
||||
grid-template-columns: repeat(4, auto); } }
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-6 {
|
||||
grid-template-columns: repeat(3, auto); } }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-6 {
|
||||
grid-template-columns: repeat(2, auto); } }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-6,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-6 {
|
||||
grid-template-columns: repeat(1, auto); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-5 {
|
||||
grid-template-columns: repeat(5, auto); }
|
||||
@media only screen and (max-width: 1280px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-5 {
|
||||
grid-template-columns: repeat(4, auto); } }
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-5 {
|
||||
grid-template-columns: repeat(3, auto); } }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-5 {
|
||||
grid-template-columns: repeat(2, auto); } }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-5,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-5 {
|
||||
grid-template-columns: repeat(1, auto); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-4 {
|
||||
grid-template-columns: repeat(4, auto); }
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-4 {
|
||||
grid-template-columns: repeat(3, auto); } }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-4 {
|
||||
grid-template-columns: repeat(2, auto); } }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-4,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-4 {
|
||||
grid-template-columns: repeat(1, auto); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-3,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-3 {
|
||||
grid-template-columns: repeat(3, auto); }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-3,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-3 {
|
||||
grid-template-columns: repeat(2, auto); } }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-3,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-3 {
|
||||
grid-template-columns: repeat(1, auto); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-2,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-2 {
|
||||
grid-template-columns: repeat(2, auto); }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-2,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-2 {
|
||||
grid-template-columns: repeat(1, auto); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list.max-columns-count-1,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list.max-columns-count-1 {
|
||||
grid-template-columns: repeat(1, auto); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list > div,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list > div {
|
||||
flex-basis: 220px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
|
||||
position: relative;
|
||||
margin: 12px 12px 24px 12px;
|
||||
margin-bottom: 12px;
|
||||
display: inline-block;
|
||||
padding: 12px 12px 24px 12px;
|
||||
margin-bottom: 0px;
|
||||
min-height: 54px;
|
||||
min-width: calc(20% - 24px);
|
||||
width: calc(20% - 24px); }
|
||||
min-width: 100%;
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
line-height: normal;
|
||||
height: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -290,12 +503,18 @@
|
|||
min-width: 54px;
|
||||
padding: 0px;
|
||||
margin-right: 20px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item svg,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item svg {
|
||||
fill: var(--tainacan-block-gray4, #555758);
|
||||
margin-left: auto;
|
||||
overflow: visible; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item.facet-without-image,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item.facet-without-image {
|
||||
min-height: 0.875em; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item.facet-without-image a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item.facet-without-image a {
|
||||
height: 0.875em; }
|
||||
height: auto;
|
||||
min-height: 0.875em; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item.facet-without-image img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item.facet-without-image img {
|
||||
display: none; }
|
||||
|
@ -307,26 +526,29 @@
|
|||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item:hover a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
text-decoration: none; }
|
||||
@media only screen and (max-width: 1600px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
|
||||
min-width: calc(25% - 24px);
|
||||
width: calc(25% - 24px); } }
|
||||
@media only screen and (max-width: 1024px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
|
||||
min-width: calc(33.333% - 24px);
|
||||
width: calc(33.333% - 24px); } }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
|
||||
min-width: calc(50% - 24px);
|
||||
width: calc(50% - 24px); } }
|
||||
@media only screen and (max-width: 498px) {
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
|
||||
min-width: calc(100% - 24px);
|
||||
width: calc(100% - 24px); } }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item.facet-term-with-children,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item.facet-term-with-children {
|
||||
font-weight: bold !important;
|
||||
cursor: pointer; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item .child-term-facets,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item .child-term-facets {
|
||||
padding-left: 7px;
|
||||
margin: 12px 0px -12px 0px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item .child-term-facets img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item .child-term-facets img {
|
||||
width: 36px;
|
||||
min-width: 36px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item .child-term-facets .facet-list-item,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item .child-term-facets .facet-list-item {
|
||||
padding: 12px;
|
||||
font-weight: normal; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item .child-term-facets .no-child-facet-found,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item .child-term-facets .no-child-facet-found {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
font-size: 0.875em;
|
||||
margin: 0;
|
||||
color: var(--tainacan-block-gray3, #cbcbcb); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud {
|
||||
padding: 0;
|
||||
|
@ -352,15 +574,28 @@
|
|||
min-width: 54px;
|
||||
padding: 0px;
|
||||
margin-right: 20px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item svg,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item svg {
|
||||
fill: var(--tainacan-block-gray4, #555758);
|
||||
margin-left: auto;
|
||||
overflow: visible;
|
||||
margin-bottom: -12px; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item.facet-without-image img,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item.facet-without-image img {
|
||||
display: none; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item span.facet-item-count,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item span.facet-item-count {
|
||||
color: var(--tainacan-block-gray3, #cbcbcb); }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item:hover a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item:hover, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item:hover a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item:hover,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item:hover a {
|
||||
color: var(--tainacan-block-primary, #298596);
|
||||
text-decoration: none;
|
||||
cursor: pointer; }
|
||||
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item:hover.facet-term-with-children, .wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item:hover.facet-term-with-children a,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item:hover.facet-term-with-children,
|
||||
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item:hover.facet-term-with-children a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
text-decoration: none; }
|
||||
.wp-block-tainacan-facets-list .show-more-button {
|
||||
margin: 12px auto;
|
||||
|
@ -376,4 +611,16 @@
|
|||
.wp-block-tainacan-facets-list .show-more-button i > svg {
|
||||
fill: white; }
|
||||
|
||||
.child-reveal-enter-active {
|
||||
overflow: hidden;
|
||||
animation-name: filter-item-in;
|
||||
animation-duration: 0.1s;
|
||||
animation-timing-function: ease; }
|
||||
|
||||
.child-reveal-leave-active {
|
||||
overflow: hidden;
|
||||
animation-name: filter-item-out;
|
||||
animation-duration: 0.1s;
|
||||
animation-timing-function: ease; }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-facets-list.css.map */
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,242 @@
|
|||
#metadata-checkbox-list {
|
||||
margin: 8px 12px 18px 12px; }
|
||||
#metadata-checkbox-list .components-base-control__help {
|
||||
margin-left: 33px;
|
||||
font-size: 0.75rem;
|
||||
color: var(--tainacan-block-gray4, #555758); }
|
||||
|
||||
.wp-block-tainacan-item-submission-form {
|
||||
margin: 2em auto; }
|
||||
.wp-block-tainacan-item-submission-form .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: var(--tainacan-block-gray4, #555758); }
|
||||
.wp-block-tainacan-item-submission-form .preview-warning {
|
||||
width: 100%;
|
||||
font-size: 0.875em;
|
||||
font-style: italic;
|
||||
color: var(--tainacan-block-gray4, #555758);
|
||||
text-align: center;
|
||||
margin: 4px auto; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder {
|
||||
background-color: var(--tainacan-background-color, white);
|
||||
padding: 0 4.1666667%;
|
||||
font-size: 1.125em;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: column;
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(200, 200, 200, 0.3);
|
||||
overflow: hidden; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-text {
|
||||
background-color: var(--tainacan-label-color, rgba(200, 200, 200, 0.3));
|
||||
height: 0.25em;
|
||||
width: 15%;
|
||||
min-width: 1.25em;
|
||||
border-radius: 2px;
|
||||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-text.section-label {
|
||||
display: block;
|
||||
margin-top: 1em;
|
||||
height: 0.32em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-text.fake-text-info {
|
||||
background-color: var(--tainacan-info-color, rgba(200, 200, 200, 0.3));
|
||||
width: 5%;
|
||||
opacity: 0.75;
|
||||
margin-left: 6px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-text.fake-help-button {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3));
|
||||
height: 0.32em;
|
||||
width: 0.32em;
|
||||
min-width: 0.25em;
|
||||
border-radius: 0.2em;
|
||||
margin-left: 6px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-collapse-arrow {
|
||||
position: relative;
|
||||
top: 0.2em;
|
||||
left: -0.75em;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 0.2em 0.2em 0 0.2em;
|
||||
border-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3)) transparent transparent transparent; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-link {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3));
|
||||
height: 0.2em;
|
||||
width: 10%;
|
||||
border-radius: 2px;
|
||||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-icon {
|
||||
background-color: var(--tainacan-info-color, rgba(200, 200, 200, 0.3));
|
||||
height: 0.5em;
|
||||
width: 0.5em;
|
||||
min-height: 0.5em;
|
||||
min-width: 0.5em;
|
||||
max-height: 0.5em;
|
||||
max-width: 0.5em;
|
||||
border-radius: 2px;
|
||||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-image-uploader {
|
||||
background-size: cover;
|
||||
height: 3em;
|
||||
background-color: var(--tainacan-input-background-color, rgba(200, 200, 200, 0.3));
|
||||
border: 2px dashed var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3));
|
||||
width: 100%;
|
||||
border-radius: 2px;
|
||||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-image-uploader:hover {
|
||||
background-color: var(--tainacan-primary, rgba(200, 200, 200, 0.1)); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-tooltip {
|
||||
background-color: var(--tainacan-primary, rgba(200, 200, 200, 0.1));
|
||||
position: absolute;
|
||||
height: 0.75em;
|
||||
width: 4em;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
top: -1.0em;
|
||||
left: 1em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-tooltip .fake-link {
|
||||
width: 100%;
|
||||
margin: 0 4px 0 8px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-tooltip:before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 12px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-tooltip:before {
|
||||
border-color: var(--tainacan-primary) transparent transparent transparent;
|
||||
border-right-width: 6px;
|
||||
border-top-width: 6px;
|
||||
border-left-width: 6px;
|
||||
bottom: -8px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-input {
|
||||
background-color: var(--tainacan-input-background-color, rgba(200, 200, 200, 0.3));
|
||||
height: 1.5em;
|
||||
width: 18%;
|
||||
border: 2px solid var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3));
|
||||
border-radius: 3px;
|
||||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-textarea {
|
||||
background-color: var(--tainacan-input-background-color, rgba(200, 200, 200, 0.3));
|
||||
height: 2.5em;
|
||||
width: 100%;
|
||||
border: 2px solid var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3));
|
||||
border-radius: 3px;
|
||||
display: inline-block; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3));
|
||||
padding: 0.4em 0.7em;
|
||||
height: 0.95em;
|
||||
width: 10%;
|
||||
max-width: 3.25em;
|
||||
min-width: 1em;
|
||||
margin-left: 6px;
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: auto; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button .fake-text {
|
||||
background-color: white;
|
||||
width: 95%;
|
||||
margin: 0 2px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button .fake-icon {
|
||||
background-color: white;
|
||||
flex: 1 0 auto;
|
||||
margin: 0 2px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button.outline {
|
||||
border: 2px solid var(--tainacan-input-border-color rgba(200, 200, 200, 0.3));
|
||||
background-color: var(--tainacan-background-color, white); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-button.outline .fake-text {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.1)); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-switch {
|
||||
padding: 0.5em;
|
||||
display: flex;
|
||||
align-items: center; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-switch .fake-icon {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3));
|
||||
width: 1.5em;
|
||||
height: 0.5em;
|
||||
border-radius: 1em;
|
||||
max-height: 1em;
|
||||
max-width: 1em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .fake-switch .fake-text {
|
||||
margin-left: 0.5em;
|
||||
width: 24%;
|
||||
max-width: 4em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .documents-section {
|
||||
display: flex;
|
||||
padding: 0.5em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .documents-section .fake-circle {
|
||||
margin-right: 1.75em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 3em;
|
||||
height: 3em;
|
||||
border-radius: 100%;
|
||||
background-color: var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3)); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .documents-section .fake-circle .fake-icon {
|
||||
background-color: var(--tainacan-secondary, rgba(200, 200, 200, 0.3)); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .documents-section .fake-circle:hover {
|
||||
background-color: var(--tainacan-primary, rgba(200, 200, 200, 0.2)); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .thumbnail-section {
|
||||
padding: 0.5em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .thumbnail-section .fake-button {
|
||||
position: relative;
|
||||
max-width: 0.85em;
|
||||
min-width: 0.85em;
|
||||
margin-top: -1em;
|
||||
margin-left: 2rem;
|
||||
border-radius: 100%;
|
||||
z-index: 99;
|
||||
padding: 4px; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .thumbnail-section .fake-icon {
|
||||
max-height: 0.2em;
|
||||
max-width: 0.2em;
|
||||
width: 0.2em;
|
||||
height: 0.2em;
|
||||
min-width: 0.2em;
|
||||
min-height: 0.2em;
|
||||
border-radius: 100%; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .attachments-section {
|
||||
padding: 0.5em;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .metadata-section {
|
||||
width: 100%;
|
||||
padding: 0.5em 1em;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: column; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .metadata-section .fake-metadata {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .metadata-section .fake-metadata .fake-input {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
margin: 0.25em 0 0.4em 0; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .metadata-section .fake-metadata.has-collapse {
|
||||
border-bottom: 1px solid var(--tainacan-input-border-color, rgba(200, 200, 200, 0.3));
|
||||
margin-bottom: 0.5em; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .form-footer {
|
||||
padding: 1em 0 2em 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between; }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .form-footer > .fake-text {
|
||||
background-color: var(--tainacan-info-color, rgba(200, 200, 200, 0.3)); }
|
||||
.wp-block-tainacan-item-submission-form .item-submission-form-placeholder .form-footer .fake-button {
|
||||
margin: 0 1em; }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block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K,EAAE,IAAI;MACX,OAAO,EAAE,SAAS;MAClB,OAAO,EAAE,IAAI;MACb,SAAS,EAAE,MAAM;MACjB,cAAc,EAAE,MAAM;MAEtB,0GAAe;QACX,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,MAAM;QACtB,SAAS,EAAE,MAAM;QAEjB,sHAAY;UACR,KAAK,EAAE,IAAI;UACX,SAAS,EAAE,IAAI;UACf,MAAM,EAAE,gBAAgB;QAE5B,uHAAe;UACX,aAAa,EAAE,sEAAoE;UACnF,aAAa,EAAE,KAAK;IAIhC,sFAAa;MACT,OAAO,EAAE,WAAW;MACpB,OAAO,EAAE,IAAI;MACb,WAAW,EAAE,MAAM;MACnB,eAAe,EAAE,aAAa;MAE9B,mGAAa;QACT,gBAAgB,EAAE,oDAAkD;MAExE,mGAAa;QACT,MAAM,EAAE,KAAK",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-items/item-submission-form/item-submission-form.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-item-submission-form.css"
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
.wp-block-tainacan-search-bar .tainacan-search-container {
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-search-bar .tainacan-search-container #tainacan-search-bar-block {
|
||||
height: 32px;
|
||||
height: 2em;
|
||||
max-width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -29,7 +29,9 @@
|
|||
margin: 0;
|
||||
border: none;
|
||||
padding: 4px 0.75em;
|
||||
text-overflow: ellipsis; }
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
font-size: 0.875em; }
|
||||
.wp-block-tainacan-search-bar .tainacan-search-container #tainacan-search-bar-block button {
|
||||
height: auto !important;
|
||||
display: flex;
|
||||
|
@ -41,8 +43,9 @@
|
|||
padding: 4px 1em;
|
||||
font-size: 1em; }
|
||||
.wp-block-tainacan-search-bar .tainacan-search-container #tainacan-search-bar-block button .icon {
|
||||
height: 28px; }
|
||||
height: 1.75em; }
|
||||
.wp-block-tainacan-search-bar .tainacan-search-container #tainacan-search-bar-block button .icon svg {
|
||||
transform: scale(1);
|
||||
fill: var(--tainacan-block-primary, #298596); }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-search-bar .tainacan-search-container #tainacan-search-bar-block {
|
||||
|
@ -89,12 +92,12 @@
|
|||
.wp-block-tainacan-search-bar.is-style-alternate #tainacan-search-bar-block input#tainacan-search-bar-block_input::placeholder {
|
||||
color: var(--tainacan-block-gray3, #cbcbcb); }
|
||||
.wp-block-tainacan-search-bar.is-style-alternate #tainacan-search-bar-block button {
|
||||
margin-right: 0.75em;
|
||||
margin-right: 12px;
|
||||
padding: 0 0.35em;
|
||||
min-height: 28px;
|
||||
min-height: 1.75em;
|
||||
z-index: 2;
|
||||
border: none;
|
||||
background: transparent;
|
||||
background: transparent !important;
|
||||
cursor: pointer; }
|
||||
.wp-block-tainacan-search-bar.is-style-alternate #tainacan-search-bar-block button .icon svg {
|
||||
fill: var(--tainacan-block-gray3, #cbcbcb);
|
||||
|
@ -124,7 +127,7 @@
|
|||
fill: var(--tainacan-block-gray2, #dbdbdb) !important; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block {
|
||||
width: 100%;
|
||||
height: 53px;
|
||||
height: 3.3125em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border: none; }
|
||||
|
@ -132,29 +135,29 @@
|
|||
border: none; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block:hover input#tainacan-search-bar-block_input {
|
||||
width: 100%;
|
||||
padding-right: 52px;
|
||||
padding-left: 24px;
|
||||
padding-right: 3.25em;
|
||||
padding-left: 1.625em;
|
||||
border-width: 0; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block input#tainacan-search-bar-block_input {
|
||||
width: 0%;
|
||||
min-width: 0%;
|
||||
border-radius: 28px;
|
||||
margin-right: -56px;
|
||||
padding-right: 27px;
|
||||
padding-left: 26px;
|
||||
border-radius: 3.3125em;
|
||||
margin-right: -3.5em;
|
||||
padding-right: 1.6875em;
|
||||
padding-left: 1.625em;
|
||||
font-size: 1em;
|
||||
border-width: 0;
|
||||
background: var(--tainacan-block-gray1, #f2f2f2);
|
||||
transition: width 0.5s ease-in, padding 0.5s ease-in; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block input#tainacan-search-bar-block_input:focus, .wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block input#tainacan-search-bar-block_input:active, .wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block input#tainacan-search-bar-block_input:hover {
|
||||
width: 100%;
|
||||
padding-right: 52px;
|
||||
padding-left: 24px;
|
||||
padding-right: 3.25em;
|
||||
padding-left: 1.625em;
|
||||
border-width: 0; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block button {
|
||||
margin-left: 0.75em;
|
||||
margin-left: 0.875em;
|
||||
padding: 0 0.35em;
|
||||
min-height: 28px;
|
||||
min-height: 1.75em;
|
||||
z-index: 2;
|
||||
border: none;
|
||||
background: transparent;
|
||||
|
@ -165,38 +168,38 @@
|
|||
.wp-block-tainacan-search-bar.is-style-stylish #tainacan-search-bar-block button:hover {
|
||||
background: transparent !important; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .tainacan-search-container {
|
||||
width: calc(100% - var(--tainacan-one-column) - 53px);
|
||||
width: calc(100% - 4.1667vw - 53px);
|
||||
width: calc(100% - var(--tainacan-one-column) - 3.3125em);
|
||||
width: calc(100% - 4.1667vw - 3.3125em);
|
||||
bottom: calc(-50% + 38px);
|
||||
position: absolute; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container:not(.is-aligned-right):not(.is-aligned-left) .search-bar-collection-header-title {
|
||||
margin-bottom: 26px; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-right .tainacan-search-container {
|
||||
width: calc(100% - var(--tainacan-one-column) - 26px);
|
||||
width: calc(100% - 4.1667vw - 26px);
|
||||
width: calc(100% - var(--tainacan-one-column) - 1.625em);
|
||||
width: calc(100% - 4.1667vw - 1.625em);
|
||||
top: calc(-50% + 26px);
|
||||
right: calc(var(--tainacan-one-column) + 26px);
|
||||
right: calc(4.1667vw + 26px);
|
||||
right: calc(var(--tainacan-one-column) + 1.625em);
|
||||
right: calc(4.1667vw + 1.625em);
|
||||
position: absolute; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-left .tainacan-search-container {
|
||||
width: calc(100% - 1em - 26px);
|
||||
width: calc(100% - 1em - 1.625em);
|
||||
top: calc(-50% + 26px);
|
||||
left: calc(var(--tainacan-one-column) + 26px);
|
||||
left: calc(4.1667vw + 26px);
|
||||
left: calc(var(--tainacan-one-column) + 1.625em);
|
||||
left: calc(4.1667vw + 1.625em);
|
||||
position: absolute; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container #tainacan-search-bar-block input#tainacan-search-bar-block_input {
|
||||
background: white;
|
||||
border-width: 3px;
|
||||
border-style: solid;
|
||||
margin-right: -56px;
|
||||
padding-right: 24px;
|
||||
padding-left: 24px; }
|
||||
margin-right: -3.5em;
|
||||
padding-right: 1.5em;
|
||||
padding-left: 1.5em; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container #tainacan-search-bar-block input#tainacan-search-bar-block_input:hover {
|
||||
border-width: 3px !important; }
|
||||
@media only screen and (max-width: 768px) {
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container .tainacan-search-container {
|
||||
width: calc(100% - var(--tainacan-one-column) - 53px) !important;
|
||||
width: calc(100% - 4.1667vw - 53px) !important;
|
||||
width: calc(100% - var(--tainacan-one-column) - 3.3125em) !important;
|
||||
width: calc(100% - 4.1667vw - 3.3125em) !important;
|
||||
bottom: calc(-50% + 38px) !important;
|
||||
position: absolute !important; }
|
||||
.wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-right .search-bar-collection-header-title, .wp-block-tainacan-search-bar.is-style-stylish .search-bar-collection-header-container.is-aligned-left .search-bar-collection-header-title {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,yCAA0C;EACtC,MAAM,EAAE,IAAI;EACZ,eAAe,EAAE,MAAM;;AAE3B,6BAA8B;EAC1B,MAAM,EAAE,QAAQ;EAEhB,wDAA2B;IACvB,KAAK,EAAE,IAAI;IAEX,mFAA2B;MACvB,MAAM,EAAE,IAAI;MACZ,SAAS,EAAE,IAAI;MACf,OAAO,EAAE,IAAI;MACb,eAAe,EAAE,MAAM;MACvB,WAAW,EAAE,OAAO;MACpB,MAAM,EAAE,MAAM;MACd,MAAM,EAAE,8CAA6C;MACrD,UAAU,EAAE,sBAAsB;MAElC,mGAAkB;QACd,WAAW,EAAE,CAAC;QACd,eAAe,EAAE,UAAU;MAE/B,oGAAmB;QACf,YAAY,EAAE,CAAC;QACf,eAAe,EAAE,QAAQ;MAE7B,gRAES;QACL,MAAM,EAAE,iBAAiB;MAG7B,yHAAsC;QAClC,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,UAAU;QACnB,aAAa,EAAE,QAAQ;MAE3B,0FAAO;QACH,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,YAAY;QAC3B,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,GAAG;QAEd,gGAAM;UACF,MAAM,EAAE,IAAI;UACZ,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AAU,EAAE,KAAK;MACjB,cAAc,EAAE,GAAG;MACnB,SAAS,EAAE,MAAM;MACjB,eAAe,EAAE,aAAa;MAE9B,0HAAoC;QAAE,UAAU,EAAE,IAAI;IAG1D,yGAAoC;MAChC,KAAK,EAAE,IAAI;MACX,KAAK,EAAE,KAAK;MAEZ,4GAAG;QACC,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,OAAO;QACd,kHAAQ;UACJ,eAAe,EAAE,IAAI;MAG7B,oHAAW;QACP,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,MAAM;QACnB,SAAS,EAAE,GAAG;IAItB,0CAA2C;MACvC,yGAAoC;QAChC,aAAa,EAAE,GAAG",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-search-bar.css"
|
||||
|
|
|
@ -566,8 +566,8 @@ font-weight: normal;
|
|||
}
|
||||
|
||||
.tainacan-icon-spin:before {
|
||||
-webkit-animation: mdi-spin 2s infinite linear;
|
||||
animation: mdi-spin 2s infinite linear;
|
||||
-webkit-animation: mdi-spin 2s infinite linear reverse !important;
|
||||
animation: mdi-spin 2s infinite linear reverse !important;
|
||||
}
|
||||
|
||||
@-webkit-keyframes mdi-spin {
|
||||
|
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
|
@ -101,7 +101,6 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
),
|
||||
|
||||
));
|
||||
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<id>[0-9]+)', array(
|
||||
|
||||
array(
|
||||
|
@ -112,8 +111,6 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
),
|
||||
|
||||
));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -129,10 +126,8 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
return current_user_can('read');
|
||||
}
|
||||
|
||||
|
||||
public function get_items( $request ) {
|
||||
global $wpdb;
|
||||
//$body = json_decode($request->get_body(), true);
|
||||
|
||||
$perpage = isset($request['perpage']) && is_numeric($request['perpage']) ? $request['perpage'] : 10;
|
||||
if ($perpage < 1) {
|
||||
|
@ -150,6 +145,8 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
$user_q = $wpdb->prepare("AND user_id = %d", get_current_user_id());
|
||||
$status_q = "";
|
||||
|
||||
$date_range = '';
|
||||
|
||||
if (current_user_can('edit_users')) {
|
||||
if (isset($request['user_id'])) {
|
||||
$user_q = $wpdb->prepare("AND user_id = %d", $request['user_id']);
|
||||
|
@ -169,12 +166,27 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($request['datequery'])) {
|
||||
$from = $request['datequery'][0]['after'];
|
||||
$to = $request['datequery'][0]['before'];
|
||||
$date_query = "AND processed_last >= %s AND processed_last <= %s";
|
||||
|
||||
$date_range = $wpdb->prepare($date_query, $from, $to);
|
||||
}
|
||||
|
||||
$process_type = '';
|
||||
if (isset($request['search'])) {
|
||||
$name = $request['search'];
|
||||
$process_type = "AND name LIKE '%${name}%'";
|
||||
$process_type = $wpdb->prepare($process_type);
|
||||
}
|
||||
|
||||
$recent_q = '';
|
||||
if ( isset($request['recent']) && $request['recent'] !== false ) {
|
||||
$recent_q = "AND (processed_last >= NOW() - INTERVAL 10 MINUTE OR queued_on >= NOW() - INTERVAL 10 MINUTE)";
|
||||
}
|
||||
|
||||
$base_query = "FROM $this->table WHERE 1=1 $status_q $user_q $recent_q ORDER BY priority DESC, queued_on DESC";
|
||||
$base_query = "FROM $this->table WHERE 1=1 $status_q $user_q $recent_q $date_range $process_type ORDER BY priority DESC, queued_on DESC";
|
||||
|
||||
$query = "SELECT * $base_query $limit_q";
|
||||
$count_query = "SELECT COUNT(ID) $base_query";
|
||||
|
@ -196,7 +208,6 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
$rest_response->header('X-WP-TotalPages', (int) $max_pages);
|
||||
|
||||
return $rest_response;
|
||||
|
||||
}
|
||||
|
||||
public function get_item( $request ) {
|
||||
|
@ -344,9 +355,4 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -141,9 +141,15 @@ class REST_Facets_Controller extends REST_Controller {
|
|||
$second_arg = $val['taxonomy'];
|
||||
}
|
||||
$entity = $metadatum_type_object->get_repository()->fetch( (int) $val['value'], $second_arg );
|
||||
if ($entity) {
|
||||
$val['entity'] = $entity->_toArray();
|
||||
}
|
||||
|
||||
$add_attt_item = function($array_item, $item) {
|
||||
$array_item['thumbnail'] = $item->get_thumbnail();
|
||||
return $array_item;
|
||||
};
|
||||
add_filter('tainacan-item-to-array', $add_attt_item, 10, 2);
|
||||
$val['entity'] = $entity->_toArray();
|
||||
remove_filter( 'tainacan-item-to-array', $add_attt_item, 10);
|
||||
|
||||
return $val;
|
||||
}, $all_values['values']);
|
||||
}
|
||||
|
|
|
@ -382,6 +382,13 @@ class REST_Filters_Controller extends REST_Controller {
|
|||
} else {
|
||||
$collection = $this->collection_repository->fetch($request['collection_id']);
|
||||
$filters = $this->filter_repository->fetch_by_collection($collection, $args);
|
||||
$filters = array_filter($filters, function($filter) {
|
||||
if ( $filter->get_metadatum() !== null ) {
|
||||
$options = $filter->get_metadatum()->get_metadata_type_options();
|
||||
return ($options == null || !isset($options['only_repository']) || $options['only_repository'] == 'no');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
$response = [];
|
||||
|
|
|
@ -183,11 +183,10 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
* @return string|\WP_Error|\WP_REST_Response
|
||||
*/
|
||||
public function update_item( $request ) {
|
||||
$session_id = $request['session_id'];
|
||||
$session_id = $request['session_id'];
|
||||
$body = json_decode($request->get_body(), true);
|
||||
|
||||
$body = json_decode($request->get_body(), true);
|
||||
|
||||
if(!empty($body)){
|
||||
if (!empty($body)) {
|
||||
$attributes = [];
|
||||
|
||||
foreach ($body as $att => $value){
|
||||
|
@ -197,15 +196,13 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
global $Tainacan_Importer_Handler;
|
||||
$importer = $Tainacan_Importer_Handler->get_importer_instance_by_session_id($session_id);
|
||||
|
||||
if($importer) {
|
||||
|
||||
foreach ($body as $att => $value){
|
||||
|
||||
if ($importer) {
|
||||
foreach ($body as $att => $value) {
|
||||
if ($att == 'collection') {
|
||||
if (is_array($value) && isset($value['id'])) {
|
||||
if ($importer->add_collection($value) === false ) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Error on creating metadata, please review the metadata description', 'tainacan' ),
|
||||
'error_message' => __('Error while creating metadatum, please review the metadatum description.', 'tainacan' ),
|
||||
'session_id' => $session_id
|
||||
], 400);
|
||||
}
|
||||
|
@ -383,8 +380,5 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
return new \WP_REST_Response( $importers, 200 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -17,6 +17,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
private $item;
|
||||
private $item_metadata;
|
||||
private $collections_repository;
|
||||
private $metadatum_repository;
|
||||
|
||||
/**
|
||||
* REST_Items_Controller constructor.
|
||||
|
@ -36,6 +37,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$this->item = new Entities\Item();
|
||||
$this->item_metadata = Repositories\Item_Metadata::get_instance();
|
||||
$this->collections_repository = Repositories\Collections::get_instance();
|
||||
$this->metadatum_repository = Repositories\Metadata::get_instance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -131,6 +133,27 @@ class REST_Items_Controller extends REST_Controller {
|
|||
),
|
||||
)
|
||||
);
|
||||
register_rest_route(
|
||||
$this->namespace, '/collection/(?P<collection_id>[\d]+)/' . $this->rest_base . '/submission',
|
||||
array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::CREATABLE,
|
||||
'callback' => array($this, 'submission_item'),
|
||||
'permission_callback' => array($this, 'submission_item_permissions_check'),
|
||||
'args' => $this->get_endpoint_args_for_item_schema(\WP_REST_Server::CREATABLE),
|
||||
),
|
||||
)
|
||||
);
|
||||
register_rest_route(
|
||||
$this->namespace, '/collection/(?P<collection_id>[\d]+)/' . $this->rest_base . '/submission/(?P<submission_id>[\d]+)/finish',
|
||||
array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::CREATABLE,
|
||||
'callback' => array($this, 'submission_item_finish'),
|
||||
'permission_callback' => array($this, 'submission_item_permissions_check'),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -211,6 +234,11 @@ class REST_Items_Controller extends REST_Controller {
|
|||
|
||||
if ( $request->get_method() != 'GET') {
|
||||
$item_arr['thumbnail'] = $item->get_thumbnail();
|
||||
$item_arr['thumbnail_alt'] = get_post_meta( $item->get__thumbnail_id(), '_wp_attachment_image_alt', true );
|
||||
$item_arr['thumbnail_id'] = $item->get__thumbnail_id();
|
||||
$item_arr['nonces'] = array(
|
||||
'update-post_' . $item->get_id() => wp_create_nonce('update-post_' . $item->get_id())
|
||||
);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -248,6 +276,13 @@ class REST_Items_Controller extends REST_Controller {
|
|||
if ( $request['context'] === 'edit' ) {
|
||||
$item_arr['current_user_can_edit'] = $item->can_edit();
|
||||
$item_arr['current_user_can_delete'] = $item->can_delete();
|
||||
$item_arr['nonces'] = array(
|
||||
'update-post_' . $item->get_id() => wp_create_nonce('update-post_' . $item->get_id())
|
||||
);
|
||||
}
|
||||
if( isset($item_arr['thumbnail']) ) {
|
||||
$item_arr['thumbnail_alt'] = get_post_meta( $item->get__thumbnail_id(), '_wp_attachment_image_alt', true );
|
||||
$item_arr['thumbnail_id'] = $item->get__thumbnail_id();
|
||||
}
|
||||
|
||||
$item_arr['url'] = get_permalink( $item_arr['id'] );
|
||||
|
@ -828,6 +863,280 @@ class REST_Items_Controller extends REST_Controller {
|
|||
|
||||
}
|
||||
|
||||
private function submission_item_metadada ( \Tainacan\Entities\Item_Metadata_Entity &$item_metadata, $request) {
|
||||
$collection_id = $item_metadata->get_item()->get_collection_id();
|
||||
$item = $item_metadata->get_item();
|
||||
$collection = $this->collections_repository->fetch($collection_id);
|
||||
if ( $item_metadata->validate() ) {
|
||||
if($item->can_edit() || $collection->get_submission_anonymous_user() == 'yes') {
|
||||
return $this->item_metadata->update( $item_metadata );
|
||||
}
|
||||
elseif($item_metadata->get_metadatum()->get_accept_suggestion()) {
|
||||
return $this->item_metadata->suggest( $item_metadata );
|
||||
}
|
||||
else {
|
||||
return new \WP_REST_Response( [
|
||||
'error_message' => __( 'The metadatum does not accept suggestions', 'tainacan' ),
|
||||
], 400 );
|
||||
}
|
||||
} else {
|
||||
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),
|
||||
], 400 );
|
||||
}
|
||||
}
|
||||
|
||||
public function submission_item ($request) {
|
||||
$collection_id = $request['collection_id'];
|
||||
$item = json_decode($request->get_body(), true);
|
||||
$metadata = $item['metadata'];
|
||||
foreach ($item as $key => $value) {
|
||||
$item[$key] = ( is_string($value) && !is_numeric($value) ? filter_var($value, FILTER_SANITIZE_STRING) : $value );
|
||||
}
|
||||
|
||||
$response_recaptcha = $this->submission_item_check_recaptcha($request);
|
||||
if ($response_recaptcha !== true) {
|
||||
return $response_recaptcha;
|
||||
}
|
||||
|
||||
if(empty($item) || empty($metadata)) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('Body can not be empty.', 'tainacan'),
|
||||
'item' => $item
|
||||
], 400);
|
||||
}
|
||||
|
||||
try {
|
||||
$item['status'] = 'auto-draft';
|
||||
$item = $this->prepare_item_for_database( [ $item, $collection_id ] );
|
||||
|
||||
if ( $item->validate() ) {
|
||||
$item = $this->items_repository->insert( $item );
|
||||
$item_id = $item->get_id();
|
||||
foreach ( $metadata as $m ) {
|
||||
if ( !isset($m['value']) || $m['value'] == null ) continue;
|
||||
$value = $m['value'];
|
||||
$metadatum_id = $m['metadatum_id'];
|
||||
$metadatum = $this->metadatum_repository->fetch( $metadatum_id );
|
||||
$item_metadata = new Entities\Item_Metadata_Entity($item, $metadatum);
|
||||
|
||||
if($metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\Compound') {
|
||||
if ($item_metadata->is_multiple()) {
|
||||
foreach($value as $row) {
|
||||
$parent_meta_id = null;
|
||||
foreach($row as $child) {
|
||||
$child_value = $child['value'];
|
||||
if (is_array($child_value) == true) {
|
||||
$child_value = implode(' ', $child_value);
|
||||
}
|
||||
if (is_numeric($value) != true) {
|
||||
$child_value = filter_var($child_value, FILTER_SANITIZE_STRING);
|
||||
}
|
||||
$metadatum_child = $this->metadatum_repository->fetch( $child['metadatum_id'] );
|
||||
$item_metadata_child = new Entities\Item_Metadata_Entity($item, $metadatum_child, null, $parent_meta_id);
|
||||
$item_metadata_child->set_value($child_value);
|
||||
$item_metadata_child = $this->submission_item_metadada($item_metadata_child, $request);
|
||||
if ($item_metadata_child instanceof \WP_REST_Response) {
|
||||
return $item_metadata_child;
|
||||
}
|
||||
$parent_meta_id = $item_metadata_child->get_parent_meta_id();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$parent_meta_id = null;
|
||||
if( is_array($value) && count($value) == 1 )
|
||||
$value = $value[0];
|
||||
foreach($value as $child) {
|
||||
$child_value = $child['value'];
|
||||
if (is_array($child_value) == true) {
|
||||
$child_value = implode(' ', $child_value);
|
||||
}
|
||||
if (is_numeric($value) != true) {
|
||||
$child_value = filter_var($child_value, FILTER_SANITIZE_STRING);
|
||||
}
|
||||
$metadatum_child = $this->metadatum_repository->fetch( $child['metadatum_id'] );
|
||||
$item_metadata_child = new Entities\Item_Metadata_Entity($item, $metadatum_child, null, $parent_meta_id);
|
||||
$item_metadata_child->set_value($child_value);
|
||||
$item_metadata_child = $this->submission_item_metadada($item_metadata_child, $request);
|
||||
if ($item_metadata_child instanceof \WP_REST_Response) {
|
||||
return $item_metadata_child;
|
||||
}
|
||||
$parent_meta_id = $item_metadata_child->get_parent_meta_id();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (is_array($value) == true) {
|
||||
$value = array_map( function($v) { return is_numeric($v) ? $v : filter_var($v, FILTER_SANITIZE_STRING); }, $value);
|
||||
} else if (is_numeric($value) != true) {
|
||||
$value = filter_var($value, FILTER_SANITIZE_STRING);
|
||||
}
|
||||
if ($item_metadata->is_multiple()) {
|
||||
$item_metadata->set_value( is_array($value) ? $value : [$value] );
|
||||
} else {
|
||||
$item_metadata->set_value( is_array($value) ? implode(' ', $value) : $value);
|
||||
}
|
||||
$item_metadata = $this->submission_item_metadada($item_metadata, $request);
|
||||
if ($item_metadata instanceof \WP_REST_Response) {
|
||||
return $item_metadata;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($item->validate()) {
|
||||
$item = $this->items_repository->insert( $item );
|
||||
$fake_id = \hexdec(\uniqid());
|
||||
$id = $item->get_id();
|
||||
set_transient('tnc_transient_submission_' . $fake_id, $id, 300);
|
||||
$response_item = $this->prepare_item_for_response($item, $request);
|
||||
$response_item['id'] = $fake_id;
|
||||
return new \WP_REST_Response($response_item, 201 );
|
||||
} else {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $item->get_errors(),
|
||||
'item' => $this->prepare_item_for_response($this->item, $request)
|
||||
], 400);
|
||||
}
|
||||
} else {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $item->get_errors(),
|
||||
'item' => $this->prepare_item_for_response($this->item, $request)
|
||||
], 400);
|
||||
}
|
||||
} catch (\Exception $exception){
|
||||
return new \WP_REST_Response($exception->getMessage(), 400);
|
||||
}
|
||||
}
|
||||
|
||||
public function submission_item_finish ( $request ) {
|
||||
define( 'WP_ADMIN', true );
|
||||
$submission_id = $request['submission_id'];
|
||||
$collection_id = $request['collection_id'];
|
||||
$item_id = get_transient('tnc_transient_submission_' . $submission_id);
|
||||
if($item_id === false) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('submission ID not exist.', 'tainacan'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
$item = $this->items_repository->fetch($item_id);
|
||||
$collection = $this->collections_repository->fetch($collection_id);
|
||||
$default_status = $collection->get_submission_default_status();
|
||||
$item->set_status($default_status);
|
||||
|
||||
$TainacanMedia = \Tainacan\Media::get_instance();
|
||||
$files = $request->get_file_params();
|
||||
|
||||
$insert_attachments = [];
|
||||
$entities_erros = [];
|
||||
if( isset($files['document']) && !is_array($files['document']['tmp_name']) == 1 && $files['document']['size'] > 0 ) {
|
||||
$tmp_file_name = sys_get_temp_dir() . DIRECTORY_SEPARATOR . \hexdec(\uniqid()) . '_' . $files['document']['name'];
|
||||
move_uploaded_file($files['document']['tmp_name'], $tmp_file_name);
|
||||
$document_id = $TainacanMedia->insert_attachment_from_file($tmp_file_name, $item_id);
|
||||
if($document_id === false) {
|
||||
$entities_erros[] = ["document" => __('Error while creating document', 'tainacan')];
|
||||
wp_delete_attachment($document_id, true);
|
||||
} else {
|
||||
$item->set_document_type('attachment');
|
||||
$item->set_document($document_id);
|
||||
$insert_attachments[] = $document_id;
|
||||
}
|
||||
unlink($tmp_file_name);
|
||||
}
|
||||
|
||||
if( isset($files['thumbnail']) && !is_array($files['thumbnail']['tmp_name']) == 1 && $files['thumbnail']['size'] > 0 ) {
|
||||
$tmp_file_name = sys_get_temp_dir() . DIRECTORY_SEPARATOR . \hexdec(\uniqid()) . '_' . $files['thumbnail']['name'];
|
||||
move_uploaded_file($files['thumbnail']['tmp_name'], $tmp_file_name);
|
||||
$thumbnail_id = $TainacanMedia->insert_attachment_from_file($tmp_file_name);
|
||||
if($thumbnail_id === false) {
|
||||
$entities_erros[] = ["thumbnail" => __('Error while creating thumbnail', 'tainacan')];
|
||||
wp_delete_attachment($thumbnail_id, true);
|
||||
} else {
|
||||
$item->set__thumbnail_id($thumbnail_id);
|
||||
$insert_attachments[] = $thumbnail_id;
|
||||
}
|
||||
unlink($tmp_file_name);
|
||||
} else {
|
||||
$thumbnail_id = $this->items_repository->get_thumbnail_id_from_document($item);
|
||||
if (!is_null($thumbnail_id)) {
|
||||
set_post_thumbnail( $item_id, (int) $thumbnail_id );
|
||||
$insert_attachments[] = $thumbnail_id;
|
||||
}
|
||||
}
|
||||
|
||||
if( isset($files['attachments']) ) {
|
||||
$attachments = is_array($files['attachments']['tmp_name']) ? $files['attachments']['tmp_name'] : [$files['attachments']['tmp_name']];
|
||||
$attachments_name = is_array($files['attachments']['name']) ? $files['attachments']['name'] : [$files['attachments']['name']];
|
||||
for ($i = 0; $i < count($attachments); $i++) {
|
||||
$tmp_file_name = sys_get_temp_dir() . DIRECTORY_SEPARATOR . \hexdec(\uniqid()) . '_' . $attachments_name[$i];
|
||||
move_uploaded_file($attachments[$i], $tmp_file_name);
|
||||
$attachment_id = $TainacanMedia->insert_attachment_from_file($tmp_file_name, $item_id);
|
||||
unlink($tmp_file_name);
|
||||
if($attachment_id === false) {
|
||||
$entities_erros[] = ['attachments' => __('Error while creating attachment ', 'tainacan') . "($attachments_name[$i])" ];
|
||||
break;
|
||||
}
|
||||
$insert_attachments[] = $attachment_id;
|
||||
}
|
||||
}
|
||||
|
||||
if( !empty($entities_erros) ) {
|
||||
foreach($insert_attachments as $remove_id) {
|
||||
wp_delete_attachment($remove_id, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($entities_erros) & $item->validate()) {
|
||||
$item = $this->items_repository->insert( $item );
|
||||
delete_transient('tnc_transient_submission_' . $submission_id);
|
||||
return new \WP_REST_Response($this->prepare_item_for_response($item, $request), 201 );
|
||||
} else {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => array_merge($item->get_errors(), $entities_erros),
|
||||
'item' => $this->prepare_item_for_response($this->item, $request)
|
||||
], 400);
|
||||
}
|
||||
}
|
||||
|
||||
public function submission_item_permissions_check ( $request ) {
|
||||
$collection = $this->collections_repository->fetch($request['collection_id']);
|
||||
if ($collection instanceof Entities\Collection && $collection->get_allows_submission() == 'yes') {
|
||||
if ($collection->get_submission_anonymous_user() == 'yes') {
|
||||
return true;
|
||||
}
|
||||
return current_user_can($collection->get_items_capabilities()->edit_posts);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function submission_item_check_recaptcha( $request ) {
|
||||
$collection = $this->collections_repository->fetch($request['collection_id']);
|
||||
$body = json_decode($request->get_body(), true);
|
||||
if ($collection instanceof Entities\Collection && $collection->get_submission_use_recaptcha() == 'yes') {
|
||||
$captcha_data = $body['g-recaptcha-response'];
|
||||
if (!$captcha_data) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('reCAPTCHA data it is need.', 'tainacan'),
|
||||
'errors' => []
|
||||
], 400);
|
||||
}
|
||||
$secret_key = get_option("tnc_option_recaptch_secret_key");
|
||||
$response = json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secret_key&response=".$captcha_data."&remoteip=".$_SERVER['REMOTE_ADDR']));
|
||||
if ($response->success) {
|
||||
return true;
|
||||
} else {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('reCAPTCHA not valid.', 'tainacan'),
|
||||
'errors' => []
|
||||
], 400);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method
|
||||
|
|
|
@ -248,10 +248,8 @@ class REST_Logs_Controller extends REST_Controller {
|
|||
* @throws \Exception
|
||||
*/
|
||||
public function get_items( $request ) {
|
||||
|
||||
$args = $this->prepare_filters( $request );
|
||||
|
||||
|
||||
if ($request['item_id']) {
|
||||
$args['item_id'] = $request['item_id'];
|
||||
} elseif ($request['collection_id']) {
|
||||
|
|
|
@ -368,6 +368,10 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
$args['include_disabled'] = true;
|
||||
}
|
||||
|
||||
if ($request['include_control_metadata_types'] === 'true') {
|
||||
$args['include_control_metadata_types'] = true;
|
||||
}
|
||||
|
||||
$collection = new Entities\Collection( $collection_id );
|
||||
|
||||
$result = $this->metadatum_repository->fetch_by_collection( $collection, $args );
|
||||
|
@ -382,6 +386,10 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
]
|
||||
];
|
||||
|
||||
if ($request['include_control_metadata_types'] === 'true') {
|
||||
$args['include_control_metadata_types'] = true;
|
||||
}
|
||||
|
||||
$result = $this->metadatum_repository->fetch( $args, 'OBJECT' );
|
||||
}
|
||||
|
||||
|
@ -474,8 +482,12 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
$attributes = [];
|
||||
|
||||
$metadatum_id = $request['metadatum_id'];
|
||||
|
||||
$confirm_repository = false;
|
||||
foreach ($body as $att => $value){
|
||||
if ($att === "repository_level" && $value === "yes") {
|
||||
$confirm_repository = true;
|
||||
continue;
|
||||
}
|
||||
$attributes[$att] = $value;
|
||||
}
|
||||
|
||||
|
@ -483,25 +495,28 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
|
||||
$error_message = __('Metadata with this ID was not found', 'tainacan');
|
||||
|
||||
if($metadatum){
|
||||
|
||||
if ($metadatum) {
|
||||
// These conditions are for verify if endpoints are used correctly
|
||||
if(!$collection_id && $metadatum->get_collection_id() !== 'default') {
|
||||
$error_message = __('This metadata is not a default metadata', 'tainacan');
|
||||
|
||||
return new \WP_REST_Response( [
|
||||
'error_message' => $error_message,
|
||||
'metadatum_id' => $metadatum_id
|
||||
'metadatum_id' => $metadatum_id
|
||||
] );
|
||||
} elseif ($collection_id && $metadatum->get_collection_id() === 'default'){
|
||||
$error_message = __('This metadata is not a collection metadata', 'tainacan');
|
||||
|
||||
return new \WP_REST_Response( [
|
||||
'error_message' => $error_message,
|
||||
'metadatum_id' => $metadatum_id
|
||||
'metadatum_id' => $metadatum_id
|
||||
] );
|
||||
}
|
||||
|
||||
if (isset($request['repository_level']) && $confirm_repository) {
|
||||
$attributes['collection_id'] = "default";
|
||||
}
|
||||
|
||||
$prepared_metadata = $this->prepare_item_for_updating($metadatum, $attributes);
|
||||
|
||||
if($prepared_metadata->validate()){
|
||||
|
@ -515,7 +530,7 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
return new \WP_REST_Response([
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $prepared_metadata->get_errors(),
|
||||
'metadatum' => $this->prepare_item_for_response($prepared_metadata, $request)
|
||||
'metadatum' => $this->prepare_item_for_response($prepared_metadata, $request)
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class REST_Roles_Controller extends REST_Controller {
|
|||
),
|
||||
'schema' => [$this, 'get_schema']
|
||||
));
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<role>[a-z-]+)', array(
|
||||
register_rest_route($this->namespace, '/' . $this->rest_base . '/(?P<role>[a-z0-9-_]+)', array(
|
||||
array(
|
||||
'methods' => \WP_REST_Server::DELETABLE,
|
||||
'callback' => array($this, 'delete_item'),
|
||||
|
@ -119,6 +119,14 @@ class REST_Roles_Controller extends REST_Controller {
|
|||
|
||||
$role_slug = sanitize_title($name);
|
||||
|
||||
// allow restricted name format ...
|
||||
if( preg_match('/^[a-zA-Z0-9-_ ]*$/', $name) == false ) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('This role name is not allowed. Use only letters, numbers, underscore and hyphen', 'tainacan'),
|
||||
'error' => $name
|
||||
], 400);
|
||||
}
|
||||
|
||||
// avoid confusion ...
|
||||
if ( in_array($role_slug, $this->core_roles) ) {
|
||||
return new \WP_REST_Response([
|
||||
|
@ -236,6 +244,14 @@ class REST_Roles_Controller extends REST_Controller {
|
|||
if ( isset($request['name']) ) {
|
||||
|
||||
$name = esc_html( esc_sql( $request['name'] ) );
|
||||
// allow restricted name format ...
|
||||
if( preg_match('/^[a-zA-Z0-9-_ ]*$/', $name) == false ) {
|
||||
return new \WP_REST_Response([
|
||||
'error_message' => __('This role name is not allowed. Use only letters, numbers, underscore and hyphen', 'tainacan'),
|
||||
'error' => $name
|
||||
], 400);
|
||||
}
|
||||
|
||||
// the slug remains the same
|
||||
\wp_roles()->roles[$role_slug]['name'] = $name;
|
||||
update_option( \wp_roles()->role_key, \wp_roles()->roles );
|
||||
|
@ -294,6 +310,7 @@ class REST_Roles_Controller extends REST_Controller {
|
|||
|
||||
foreach ( $newcaps as $cap => $val ) {
|
||||
\wp_roles()->add_cap($role_slug, $cap, $val);
|
||||
\tainacan_roles()->add_dependencies($role_slug, $cap);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,6 +57,29 @@ class Elastic_Press {
|
|||
unset( $formatted_args['query']['bool']['should'] );
|
||||
unset( $formatted_args["query"]["bool"]["must"][0]["multi_match"]["type"] );
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO
|
||||
* Elasticsearch is not good a substring matches similar to SQL like.
|
||||
* here we replace `match_phrase` with` wildcard`, but this is not an efficient operation.
|
||||
*/
|
||||
if ( ! empty( $formatted_args['post_filter']['bool']['must'] ) ) {
|
||||
$array_must = $formatted_args['post_filter']['bool']['must'];
|
||||
for($i = 0; $i < count($array_must); $i++ ) {
|
||||
$el_must = $array_must[$i];
|
||||
if( ! empty($el_must['bool']['must']) ) {
|
||||
$array_must_nested = $el_must['bool']['must'];
|
||||
for($j = 0; $j < count($array_must_nested); $j++ ) {
|
||||
if ( isset ($array_must_nested[$j]['match_phrase'] ) ) {
|
||||
$formatted_args['post_filter']['bool']['must'][$i]['bool']['must'][$j]['wildcard'] =
|
||||
array_map( function($match) { return "*$match*"; } ,$array_must_nested[$j]['match_phrase']);
|
||||
unset($formatted_args['post_filter']['bool']['must'][$i]['bool']['must'][$j]['match_phrase']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $formatted_args;
|
||||
} );
|
||||
|
||||
|
@ -102,7 +125,7 @@ class Elastic_Press {
|
|||
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
|
||||
|
||||
|
||||
$metadatas = $Tainacan_Item_Metadata->fetch($item, 'OBJECT', [ 'post__in' => $ids_meta, 'order' => 'id', 'metadata_type' => 'Tainacan\Metadata_Types\Relationship' ] );
|
||||
|
||||
if ( is_array( $metadatas ) ) {
|
||||
|
@ -134,7 +157,7 @@ class Elastic_Press {
|
|||
$args['ep_integrate'] = true;
|
||||
|
||||
add_action('ep_valid_response', function ( $response, $query, $query_args ) {
|
||||
$aggregations = $response['aggregations'];
|
||||
$aggregations = isset($response['aggregations']) ? $response['aggregations'] : [];
|
||||
$this->last_aggregations = $this->format_aggregations($aggregations);
|
||||
}, 10, 3);
|
||||
|
||||
|
|
|
@ -125,7 +125,13 @@ class Embed {
|
|||
* @return string Updated embed markup
|
||||
*/
|
||||
function responsive_embed($html, $url, $attr) {
|
||||
return $html !== '' ? '<div class="tainacan-embed-container">'.$html.'</div>' : '';
|
||||
|
||||
$class = 'tainacan-embed-container';
|
||||
|
||||
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>' : '';
|
||||
}
|
||||
|
||||
}
|
|
@ -42,7 +42,7 @@ class Media {
|
|||
if( ob_get_level() > 0 ) {
|
||||
ob_flush();
|
||||
}
|
||||
flush();
|
||||
// flush();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,6 +195,7 @@ class Media {
|
|||
|
||||
// Include image.php
|
||||
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
||||
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
||||
|
||||
// Define attachment metadata
|
||||
$attach_data = wp_generate_attachment_metadata( $attach_id, $file_path );
|
||||
|
|
|
@ -5,16 +5,6 @@ use Tainacan\Repositories\Repository;
|
|||
|
||||
class Roles {
|
||||
|
||||
|
||||
public static $dependencies = [
|
||||
"tainacan-items" => [
|
||||
'edit_posts' => 'upload_files',
|
||||
"edit_private_posts" => 'upload_files',
|
||||
"edit_published_posts" => 'upload_files',
|
||||
"edit_others_posts" => 'upload_files'
|
||||
]
|
||||
];
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
private $capabilities;
|
||||
|
@ -536,6 +526,8 @@ class Roles {
|
|||
}
|
||||
}
|
||||
|
||||
$collection_capabilities = tainacan_collections()->get_capabilities();
|
||||
|
||||
foreach ( $caps as $cap ) {
|
||||
|
||||
if ( array_key_exists($cap, $allcaps) && $allcaps[$cap] === true ) {
|
||||
|
@ -548,24 +540,64 @@ class Roles {
|
|||
|
||||
$allcaps = array_merge($allcaps, [ $cap => true ]);
|
||||
|
||||
} elseif ( \strpos($cap, 'tnc_col_') === 0 ) {
|
||||
/**
|
||||
* Handle checks for collection specific capabilities.
|
||||
* Either tnc_col_* or tnc_rep_*_collections
|
||||
*/
|
||||
} elseif ( \strpos($cap, 'tnc_col_') === 0 || in_array( $cap, (array) $collection_capabilities ) ) {
|
||||
|
||||
$col_id = preg_replace('/[a-z_]+(\d+)[a-z_]+?$/', '$1', $cap );
|
||||
$check_all_collections_cap = false;
|
||||
$has_all_collections_cap = false;
|
||||
|
||||
|
||||
/**
|
||||
* We are only interested in checks for a specific collection.
|
||||
* $args[2] will be set if this came from a meta cap of a specific collection ( e.g. current_user_can('tnc_rep_edit_collection', 3) ).
|
||||
*/
|
||||
if ( isset( $args[2] ) && is_numeric( $args[2] ) ) {
|
||||
$col_id = $args[2];
|
||||
/**
|
||||
* Or we extract the collectino id from the capability itself. Example: tnc_col_3_delete_items
|
||||
*/
|
||||
} else {
|
||||
$col_id = preg_replace('/[a-z_]+(\d+)[a-z_]+?$/', '$1', $cap );
|
||||
$check_all_collections_cap = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* If there is no specific collection, do nothing.
|
||||
*/
|
||||
if ( ! is_numeric($col_id) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// check for tnc_col_all_* capabilities
|
||||
$all_collections_cap = preg_replace('/([a-z_]+)(\d+)([a-z_]+?)$/', '${1}all${3}', $cap );
|
||||
// In case of a tnc_col_* capability check,
|
||||
// Let's see if the user has the respective tnc_col_all_* capability
|
||||
if ( $check_all_collections_cap ) {
|
||||
$all_collections_cap = preg_replace('/([a-z_]+)(\d+)([a-z_]+?)$/', '${1}all${3}', $cap );
|
||||
$has_all_collections_cap = $user->has_cap( $all_collections_cap );
|
||||
}
|
||||
|
||||
if (
|
||||
$user->has_cap('manage_tainacan_collection_' . $col_id) ||
|
||||
$user->has_cap('manage_tainacan_collection_all') ||
|
||||
$user->has_cap($all_collections_cap) ) {
|
||||
$has_all_collections_cap
|
||||
) {
|
||||
|
||||
$allcaps = array_merge($allcaps, [ $cap => true ]);
|
||||
} else {
|
||||
// check if the user is the owner
|
||||
|
||||
/**
|
||||
* If a user is trying to edit a collection relying on the manage_tainacan_collection_* cap
|
||||
* they will also need the edit_others_posts capability. But since it is 'manage_tainacan',
|
||||
* we have to treat this here because this check will not get here since we are only handling
|
||||
* caps that starts with tnc_
|
||||
*/
|
||||
if ( $collection_capabilities->edit_posts === $cap ) {
|
||||
$allcaps = array_merge($allcaps, [ $collection_capabilities->edit_others_posts => true ]);
|
||||
}
|
||||
|
||||
} elseif ( \strpos($cap, 'tnc_col_') === 0 ) {
|
||||
// check if the user is the owner only when checking tnc_col_* capabilities
|
||||
$collection = tainacan_collections()->fetch( (int) $col_id );
|
||||
if ( $collection instanceof \Tainacan\Entities\Collection ) {
|
||||
if ( (int) $collection->get_author_id() == (int) $user->ID ) {
|
||||
|
@ -580,7 +612,6 @@ class Roles {
|
|||
|
||||
return $allcaps;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,144 @@
|
|||
<?php
|
||||
|
||||
namespace Tainacan;
|
||||
|
||||
use WP_CLI;
|
||||
use Tainacan\Repositories;
|
||||
|
||||
class Cli_Control_Metadata {
|
||||
|
||||
private $collection_repository;
|
||||
private $items_repository;
|
||||
private $result_count;
|
||||
private $dry_run = false;
|
||||
|
||||
public function __construct() {
|
||||
$this->collection_repository = Repositories\Collections::get_instance();
|
||||
$this->items_repository = Repositories\Items::get_instance();
|
||||
$this->result_count = [
|
||||
'items' => 0,
|
||||
'items_collection' => 0,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* recalculete values of metadata control
|
||||
*
|
||||
* ## OPTIONS
|
||||
* [--collection=<value>]
|
||||
* : <value> Collection specific ID into which the control metadata will be recalculated, or 'all' for all collections.
|
||||
*
|
||||
* [--dry-run]
|
||||
* : only count the total of item which will recalculated, just output a report
|
||||
*
|
||||
* [--recreate-control-metadata-definitions]
|
||||
* : recreate the control metadata collection definitions
|
||||
*
|
||||
* ## EXAMPLES
|
||||
*
|
||||
* wp tainacan control-metadata --collection=416
|
||||
* recalculate control metadata for items to collection 416: 100% [====================================================] 0:00 / 0:00
|
||||
* Success:
|
||||
* 710 items recalculate
|
||||
*
|
||||
*
|
||||
* wp tainacan control-metadata --collection=all
|
||||
* recalculate control metadata for items to collection 416: 100% [====================================================] 0:00 / 0:00
|
||||
* Success:
|
||||
* 710 items recalculate
|
||||
* recalculate control metadata for items to collection 301: 100% [====================================================] 0:00 / 0:00
|
||||
* Success:
|
||||
* 156 items recalculate
|
||||
*
|
||||
*/
|
||||
public function __invoke($args, $assoc_args) {
|
||||
$this->dry_run = false;
|
||||
if ( !empty($assoc_args['dry-run']) ) {
|
||||
$this->dry_run = true;
|
||||
}
|
||||
|
||||
if( empty($assoc_args['collection']) ) {
|
||||
\WP_CLI::error( 'Wrong parameters', true );
|
||||
}
|
||||
|
||||
if ( !empty($assoc_args['recreate-control-metadata-definitions']) ) {
|
||||
$this->recreate_control_metadata_collection_definitions();
|
||||
}
|
||||
|
||||
$collection = $assoc_args['collection'];
|
||||
if ($collection == 'all') {
|
||||
$this->recalculate_items_for_all_collections();
|
||||
} else {
|
||||
$this->recalculate_items($collection);
|
||||
}
|
||||
$msg = "\n\n" . $this->result_count['items'] . " items recalculated.";
|
||||
\WP_CLI::success( $msg );
|
||||
}
|
||||
|
||||
private function recalculate_items_for_all_collections() {
|
||||
$collections = $this->collection_repository->fetch(['posts_per_page' => -1], 'OBJECT');
|
||||
foreach ($collections as $collection) {
|
||||
$this->result_count['items_collection'] = 0;
|
||||
$this->recalculate_items($collection->get_id());
|
||||
}
|
||||
}
|
||||
|
||||
private function recalculate_items($collection_id) {
|
||||
$per_page = 50; $page = 1;
|
||||
$args = [
|
||||
'posts_per_page'=> $per_page,
|
||||
'paged' => $page,
|
||||
'post_status' => get_post_stati()
|
||||
];
|
||||
$collection_items = $this->items_repository->fetch($args, $collection_id, 'WP_Query');
|
||||
$total = $collection_items->found_posts;
|
||||
$last_page = ceil($total/$per_page);
|
||||
|
||||
$progress = \WP_CLI\Utils\make_progress_bar( "recalculate control metadata for items to collection $collection_id:", $total );
|
||||
while ($page++ <= $last_page) {
|
||||
if ($collection_items->have_posts()) {
|
||||
while ( $collection_items->have_posts() ) {
|
||||
$collection_items->the_post();
|
||||
$item = new Entities\Item($collection_items->post);
|
||||
$this->perform_item_recalculation($item);
|
||||
$progress->tick();
|
||||
}
|
||||
}
|
||||
$args['paged'] = $page;
|
||||
$collection_items = $this->items_repository->fetch($args, $collection_id, 'WP_Query');
|
||||
}
|
||||
$progress->finish();
|
||||
|
||||
$this->result_count['items'] += $this->result_count['items_collection'];
|
||||
$msg = $this->result_count['items_collection'] . " items recalculated in collection";
|
||||
|
||||
\WP_CLI::success( $msg );
|
||||
}
|
||||
|
||||
private function recreate_control_metadata_collection_definitions() {
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$collections = $this->collection_repository->fetch(['posts_per_page' => -1], 'OBJECT');
|
||||
foreach ($collections as $collection) {
|
||||
$Tainacan_Metadata->register_control_metadata( $collection, true );
|
||||
}
|
||||
$msg = "recreate control metadata collection definitions completed successfully";
|
||||
\WP_CLI::success( $msg );
|
||||
}
|
||||
|
||||
private function perform_item_recalculation($item) {
|
||||
if (! $item instanceof Entities\Item) {
|
||||
\WP_CLI::error( 'An item with this ID was not found', true );
|
||||
}
|
||||
|
||||
$this->result_count['items_collection']++;
|
||||
|
||||
if ($this->dry_run)
|
||||
return true;
|
||||
|
||||
$helper = \Tainacan\Metadata_Types\Control::get_helper();
|
||||
$helper->update_control_metadatum($item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
|
@ -25,11 +25,11 @@ class Cli {
|
|||
}
|
||||
|
||||
function add_commands() {
|
||||
|
||||
\WP_CLI::add_command('tainacan garbage-collector', 'Tainacan\Cli_Garbage_Collector');
|
||||
\WP_CLI::add_command('tainacan move-attachments-to-items-folder', 'Tainacan\Cli_Move_Attachments');
|
||||
\WP_CLI::add_command('tainacan collection', 'Tainacan\Cli_Collection');
|
||||
\WP_CLI::add_command('tainacan index-content', 'Tainacan\Cli_Document');
|
||||
\WP_CLI::add_command('tainacan collection', 'Tainacan\Cli_Collection');
|
||||
\WP_CLI::add_command('tainacan index-content', 'Tainacan\Cli_Document');
|
||||
\WP_CLI::add_command('tainacan control-metadata', 'Tainacan\Cli_Control_Metadata');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,35 +9,39 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
*/
|
||||
class Collection extends Entity {
|
||||
|
||||
protected
|
||||
$diplay_name,
|
||||
$full,
|
||||
$_thumbnail_id,
|
||||
$modification_date,
|
||||
$creation_date,
|
||||
$author_id,
|
||||
$url,
|
||||
$name,
|
||||
$slug,
|
||||
$order,
|
||||
$parent,
|
||||
$description,
|
||||
$default_order,
|
||||
$default_orderby,
|
||||
$columns,
|
||||
protected
|
||||
$diplay_name,
|
||||
$full,
|
||||
$_thumbnail_id,
|
||||
$modification_date,
|
||||
$creation_date,
|
||||
$author_id,
|
||||
$url,
|
||||
$name,
|
||||
$slug,
|
||||
$order,
|
||||
$parent,
|
||||
$description,
|
||||
$default_order,
|
||||
$default_orderby,
|
||||
$columns,
|
||||
$default_view_mode,
|
||||
$enabled_view_modes,
|
||||
$metadata_order,
|
||||
$filters_order,
|
||||
$enable_cover_page,
|
||||
$cover_page_id,
|
||||
$header_image_id,
|
||||
$header_image,
|
||||
$comment_status,
|
||||
$metadata_order,
|
||||
$filters_order,
|
||||
$enable_cover_page,
|
||||
$cover_page_id,
|
||||
$header_image_id,
|
||||
$header_image,
|
||||
$comment_status,
|
||||
$allow_comments,
|
||||
$hide_items_thumbnail_on_lists;
|
||||
$allows_submission,
|
||||
$hide_items_thumbnail_on_lists,
|
||||
$submission_anonymous_user,
|
||||
$submission_default_status,
|
||||
$submission_use_recaptcha;
|
||||
|
||||
/**
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Tainacan\Entities\Entity::post_type
|
||||
* @var string
|
||||
|
@ -131,7 +135,7 @@ class Collection extends Entity {
|
|||
'revisions',
|
||||
'page-attributes',
|
||||
'post-formats',
|
||||
'comments'
|
||||
'comments'
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -227,7 +231,7 @@ class Collection extends Entity {
|
|||
return apply_filters("tainacan-collection-get-attachments", $attachments, $exclude, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function get_author_name() {
|
||||
|
@ -242,11 +246,11 @@ class Collection extends Entity {
|
|||
|
||||
$sizes = get_intermediate_image_sizes();
|
||||
|
||||
array_unshift($sizes, 'full');
|
||||
array_unshift($sizes, 'full');
|
||||
|
||||
foreach ( $sizes as $size ) {
|
||||
$thumbs[$size] = wp_get_attachment_image_src( $this->get__thumbnail_id(), $size );
|
||||
}
|
||||
foreach ( $sizes as $size ) {
|
||||
$thumbs[$size] = wp_get_attachment_image_src( $this->get__thumbnail_id(), $size );
|
||||
}
|
||||
|
||||
return apply_filters("tainacan-collection-get-thumbnail", $thumbs, $this);
|
||||
}
|
||||
|
@ -271,10 +275,10 @@ class Collection extends Entity {
|
|||
*/
|
||||
|
||||
function get__thumbnail_id() {
|
||||
$_thumbnail_id = $this->get_mapped_property("_thumbnail_id");
|
||||
if ( isset( $_thumbnail_id ) ) {
|
||||
return $_thumbnail_id;
|
||||
}
|
||||
$_thumbnail_id = $this->get_mapped_property("_thumbnail_id");
|
||||
if ( isset( $_thumbnail_id ) ) {
|
||||
return $_thumbnail_id;
|
||||
}
|
||||
|
||||
return get_post_thumbnail_id( $this->get_id() );
|
||||
}
|
||||
|
@ -430,8 +434,8 @@ class Collection extends Entity {
|
|||
* @return boolean
|
||||
*/
|
||||
function is_cover_page_enabled() {
|
||||
return $this->get_enable_cover_page() === 'yes';
|
||||
}
|
||||
return $this->get_enable_cover_page() === 'yes';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enable cover page attribute
|
||||
|
@ -533,7 +537,7 @@ class Collection extends Entity {
|
|||
* @return string "open"|"closed"
|
||||
*/
|
||||
public function get_comment_status() {
|
||||
return $this->get_mapped_property('comment_status');
|
||||
return $this->get_mapped_property('comment_status');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -541,7 +545,34 @@ class Collection extends Entity {
|
|||
* @return bool
|
||||
*/
|
||||
public function get_allow_comments() {
|
||||
return $this->get_mapped_property('allow_comments');
|
||||
return $this->get_mapped_property('allow_comments');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enable submission with anonymous user
|
||||
*
|
||||
* @return string "yes"|"no"
|
||||
*/
|
||||
function get_submission_anonymous_user() {
|
||||
return $this->get_mapped_property( 'submission_anonymous_user' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default submission status
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_submission_default_status() {
|
||||
return $this->get_mapped_property( 'submission_default_status' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if submission items are allowed for the current collection.
|
||||
*
|
||||
* @return string "yes"|"no"
|
||||
*/
|
||||
function get_allows_submission() {
|
||||
return $this->get_mapped_property( 'allows_submission' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -553,6 +584,15 @@ class Collection extends Entity {
|
|||
return $this->get_mapped_property( 'hide_items_thumbnail_on_lists' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if submission items use a recaptcha.
|
||||
*
|
||||
* @return string "yes"|"no"
|
||||
*/
|
||||
function get_submission_use_recaptcha() {
|
||||
return $this->get_mapped_property( 'submission_use_recaptcha' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the collection name
|
||||
*
|
||||
|
@ -730,7 +770,7 @@ class Collection extends Entity {
|
|||
* @param $value string "open"|"closed"
|
||||
*/
|
||||
public function set_comment_status( $value ) {
|
||||
$this->set_mapped_property('comment_status', $value);
|
||||
$this->set_mapped_property('comment_status', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -739,7 +779,40 @@ class Collection extends Entity {
|
|||
* @param $value bool
|
||||
*/
|
||||
public function set_allow_comments( $value ) {
|
||||
$this->set_mapped_property('allow_comments', $value );
|
||||
$this->set_mapped_property('allow_comments', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set enable submission with anonymous user
|
||||
*
|
||||
* @param [string] $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function set_submission_anonymous_user( $value ) {
|
||||
$this->set_mapped_property( 'submission_anonymous_user', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set default submission status
|
||||
*
|
||||
* @param [string] $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function set_submission_default_status( $value ) {
|
||||
$this->set_mapped_property( 'submission_default_status', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if submission items are allowes for the current collection.
|
||||
*
|
||||
* @param [string] $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function set_allows_submission( $value ) {
|
||||
$this->set_mapped_property( 'allows_submission', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -753,6 +826,17 @@ class Collection extends Entity {
|
|||
$this->set_mapped_property( 'hide_items_thumbnail_on_lists', $value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if submission items are use recaptcha.
|
||||
*
|
||||
* @param [string] $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function set_submission_use_recaptcha( $value ) {
|
||||
return $this->set_mapped_property( 'submission_use_recaptcha', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Collection
|
||||
*
|
||||
|
|
|
@ -466,128 +466,131 @@ class Item_Metadata_Entity extends Entity {
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function validate() {
|
||||
$value = $this->get_value();
|
||||
$metadatum = $this->get_metadatum();
|
||||
$item = $this->get_item();
|
||||
function validate() {
|
||||
$value = $this->get_value();
|
||||
$metadatum = $this->get_metadatum();
|
||||
$item = $this->get_item();
|
||||
|
||||
if (empty($value) && $this->is_required() && in_array( $item->get_status(), apply_filters( 'tainacan-status-require-validation', [
|
||||
'publish',
|
||||
'future',
|
||||
'private'
|
||||
] ) )
|
||||
) {
|
||||
$this->add_error('required', $metadatum->get_name() . ' is required');
|
||||
return false;
|
||||
} elseif (empty($value) && !$this->is_required()) {
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
} elseif(empty($value) && $this->is_required() && !in_array( $item->get_status(), apply_filters( 'tainacan-status-require-validation', [
|
||||
'publish',
|
||||
'future',
|
||||
'private'
|
||||
] ) )) {
|
||||
if( !isset($metadatum) ) {
|
||||
$this->add_error('not_found', ['metadatum not found'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
}
|
||||
if (empty($value) && $this->is_required() && in_array( $item->get_status(), apply_filters( 'tainacan-status-require-validation', [
|
||||
'publish',
|
||||
'future',
|
||||
'private'
|
||||
] ) )
|
||||
) {
|
||||
$this->add_error('required', $metadatum->get_name() . ' is required');
|
||||
return false;
|
||||
} elseif (empty($value) && !$this->is_required()) {
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
} elseif(empty($value) && $this->is_required() && !in_array( $item->get_status(), apply_filters( 'tainacan-status-require-validation', [
|
||||
'publish',
|
||||
'future',
|
||||
'private'
|
||||
] ) )) {
|
||||
|
||||
$classMetadatumType = $metadatum->get_metadata_type_object();
|
||||
if( is_object( $classMetadatumType ) ){
|
||||
if( method_exists ( $classMetadatumType , 'validate' ) ){
|
||||
if( ! $classMetadatumType->validate( $this ) ) {
|
||||
$this->add_error('metadata_type_error', $classMetadatumType->get_errors() );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->is_multiple()) {
|
||||
|
||||
if (is_array($value)) {
|
||||
|
||||
// if its required, at least one must be filled
|
||||
$one_filled = false;
|
||||
$valid = true;
|
||||
$dupe_array = array();
|
||||
foreach($value as $val) {
|
||||
if (!empty($val))
|
||||
$one_filled = true;
|
||||
|
||||
if ($this->is_collection_key()) {
|
||||
if (++$dupe_array[$val] > 1) {
|
||||
$this->add_error( 'key_exists', sprintf( __('%s is a collection key and there is another item with the same value', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
$test = $Tainacan_Items->fetch([
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => $this->metadatum->get_id(),
|
||||
'value' => $val
|
||||
]
|
||||
],
|
||||
'post__not_in' => [$item->get_id()]
|
||||
], $item->get_collection());
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
}
|
||||
|
||||
$classMetadatumType = $metadatum->get_metadata_type_object();
|
||||
if( is_object( $classMetadatumType ) ){
|
||||
if( method_exists ( $classMetadatumType , 'validate' ) ){
|
||||
if( ! $classMetadatumType->validate( $this ) ) {
|
||||
$this->add_error('metadata_type_error', $classMetadatumType->get_errors() );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->is_multiple()) {
|
||||
if (is_array($value)) {
|
||||
// if its required, at least one must be filled
|
||||
$one_filled = false;
|
||||
$valid = true;
|
||||
$dupe_array = array();
|
||||
foreach($value as $val) {
|
||||
if (!empty($val))
|
||||
$one_filled = true;
|
||||
|
||||
if ($this->is_collection_key()) {
|
||||
if (++$dupe_array[$val] > 1) {
|
||||
$this->add_error( 'key_exists', sprintf( __('%s is a collection key and there is another item with the same value', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
$test = $Tainacan_Items->fetch([
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => $this->metadatum->get_id(),
|
||||
'value' => $val
|
||||
]
|
||||
],
|
||||
'post__not_in' => [$item->get_id()]
|
||||
], $item->get_collection());
|
||||
|
||||
if ($test->have_posts()) {
|
||||
// translators: %s = metadatum name. ex: Register ID is a collection key and there is another item with the same value
|
||||
$this->add_error( 'key_exists', sprintf( __('%s is a collection key and there is another item with the same value', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->is_required() && !$one_filled) {
|
||||
// translators: %s = metadatum name. ex: Title is required
|
||||
$this->add_error( 'required', sprintf( __('%s is required', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$valid) {
|
||||
// translators: %s = metadatum name. ex: Title is invalid
|
||||
$this->add_error( 'invalid', sprintf( __('%s is invalid', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
} else {
|
||||
// translators: %s = metadatum name. ex: Title is invalid
|
||||
$this->add_error( 'invalid', sprintf( __('%s is invalid', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
if( is_array($value) ){
|
||||
// translators: %s = metadatum name. ex: Title accepts only one single value and not a list of values
|
||||
$this->add_error( 'not_multiple', sprintf( __('%s accepts only one single value and not a list of values', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->is_collection_key()) {
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
|
||||
if ($test->have_posts()) {
|
||||
// translators: %s = metadatum name. ex: Register ID is a collection key and there is another item with the same value
|
||||
$this->add_error( 'key_exists', sprintf( __('%s is a collection key and there is another item with the same value', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->is_required() && !$one_filled) {
|
||||
// translators: %s = metadatum name. ex: Title is required
|
||||
$this->add_error( 'required', sprintf( __('%s is required', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$valid) {
|
||||
// translators: %s = metadatum name. ex: Title is invalid
|
||||
$this->add_error( 'invalid', sprintf( __('%s is invalid', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
} else {
|
||||
// translators: %s = metadatum name. ex: Title is invalid
|
||||
$this->add_error( 'invalid', sprintf( __('%s is invalid', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$test = $Tainacan_Items->fetch([
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => $this->metadatum->get_id(),
|
||||
'value' => $value
|
||||
],
|
||||
],
|
||||
'post__not_in' => [$item->get_id()]
|
||||
], $item->get_collection());
|
||||
|
||||
if( is_array($value) ){
|
||||
// translators: %s = metadatum name. ex: Title accepts only one single value and not a list of values
|
||||
$this->add_error( 'not_multiple', sprintf( __('%s accepts only one single value and not a list of values', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->is_collection_key()) {
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
|
||||
$test = $Tainacan_Items->fetch([
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => $this->metadatum->get_id(),
|
||||
'value' => $value
|
||||
],
|
||||
],
|
||||
'post__not_in' => [$item->get_id()]
|
||||
], $item->get_collection());
|
||||
if ($test->have_posts()) {
|
||||
// translators: %s = metadatum name. ex: Register ID is a collection key and there is another item with the same value
|
||||
$this->add_error( 'key_exists', sprintf( __('%s is a collection key and there is another item with the same value', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($test->have_posts()) {
|
||||
// translators: %s = metadatum name. ex: Register ID is a collection key and there is another item with the same value
|
||||
$this->add_error( 'key_exists', sprintf( __('%s is a collection key and there is another item with the same value', 'tainacan'), $metadatum->get_name() ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -93,6 +93,8 @@ class Item extends Entity {
|
|||
}
|
||||
|
||||
$attachments_query = [
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC',
|
||||
'post_type' => 'attachment',
|
||||
'posts_per_page' => -1,
|
||||
'post_parent' => $item_id,
|
||||
|
@ -405,7 +407,7 @@ class Item extends Entity {
|
|||
$is_valid = false;
|
||||
}
|
||||
|
||||
$arrayItemMetadata = $this->get_metadata(['parent'=>'any']);
|
||||
$arrayItemMetadata = $this->get_metadata(['parent'=>'any', 'include_control_metadata_types' => 'true']);
|
||||
if ( $arrayItemMetadata ) {
|
||||
foreach ( $arrayItemMetadata as $itemMetadata ) {
|
||||
|
||||
|
|
|
@ -9,35 +9,35 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|||
*/
|
||||
class Metadatum extends Entity {
|
||||
protected
|
||||
$name,
|
||||
$slug,
|
||||
$order,
|
||||
$parent,
|
||||
$description,
|
||||
$required,
|
||||
$multiple,
|
||||
$name,
|
||||
$slug,
|
||||
$order,
|
||||
$parent,
|
||||
$description,
|
||||
$required,
|
||||
$multiple,
|
||||
$display,
|
||||
$cardinality,
|
||||
$collection_key,
|
||||
$mask,
|
||||
$default_value,
|
||||
$metadata_type,
|
||||
$metadata_type_options;
|
||||
$cardinality,
|
||||
$collection_key,
|
||||
$mask,
|
||||
$default_value,
|
||||
$metadata_type,
|
||||
$metadata_type_options;
|
||||
|
||||
// Collection getter and setter declared here
|
||||
use \Tainacan\Traits\Entity_Collection_Relation;
|
||||
// Collection getter and setter declared here
|
||||
use \Tainacan\Traits\Entity_Collection_Relation;
|
||||
|
||||
public $enabled_for_collection = true;
|
||||
|
||||
static $post_type = 'tainacan-metadatum';
|
||||
|
||||
static $post_type = 'tainacan-metadatum';
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Tainacan\Entities\Entity::capability_type
|
||||
* @see \Tainacan\Entities\Entity::capability_type
|
||||
* @var string
|
||||
*/
|
||||
protected static $capability_type = ['tainacan-metadatum', 'tainacan-metadata'];
|
||||
protected static $capability_type = ['tainacan-metadatum', 'tainacan-metadata'];
|
||||
|
||||
|
||||
/**
|
||||
|
@ -66,329 +66,332 @@ class Metadatum extends Entity {
|
|||
return $this->get_mapped_property('display');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the metadatum name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_name() {
|
||||
return $this->get_mapped_property('name');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get metadatum slug
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_slug() {
|
||||
return $this->get_mapped_property('slug');
|
||||
}
|
||||
/**
|
||||
* Return the metadatum name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_name() {
|
||||
return $this->get_mapped_property('name');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get metadatum slug
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_slug() {
|
||||
return $this->get_mapped_property('slug');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the metadatum order type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_order() {
|
||||
return $this->get_mapped_property('order');
|
||||
}
|
||||
/**
|
||||
* Return the metadatum order type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_order() {
|
||||
return $this->get_mapped_property('order');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the parent ID
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_parent() {
|
||||
return $this->get_mapped_property('parent');
|
||||
}
|
||||
/**
|
||||
* Return the parent ID
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_parent() {
|
||||
return $this->get_mapped_property('parent');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the metadatum description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_description() {
|
||||
return $this->get_mapped_property('description');
|
||||
}
|
||||
/**
|
||||
* Return the metadatum description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_description() {
|
||||
return $this->get_mapped_property('description');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if is a required metadatum
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function get_required(){
|
||||
return $this->get_mapped_property('required');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if is a multiple metadatum
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function get_multiple(){
|
||||
return $this->get_mapped_property('multiple');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the cardinality
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_cardinality(){
|
||||
return $this->get_mapped_property('cardinality');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if metadatum is key
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function get_collection_key(){
|
||||
return $this->get_mapped_property('collection_key');
|
||||
}
|
||||
/**
|
||||
* Return if is a required metadatum
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function get_required(){
|
||||
return $this->get_mapped_property('required');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if is a multiple metadatum
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function get_multiple(){
|
||||
return $this->get_mapped_property('multiple');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the cardinality
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_cardinality(){
|
||||
return $this->get_mapped_property('cardinality');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if metadatum is key
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function get_collection_key(){
|
||||
return $this->get_mapped_property('collection_key');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the mask
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_mask(){
|
||||
return $this->get_mapped_property('mask');
|
||||
}
|
||||
/**
|
||||
* Return the mask
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_mask(){
|
||||
return $this->get_mapped_property('mask');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the metadatum default value
|
||||
*
|
||||
* @return string || integer
|
||||
*/
|
||||
function get_default_value(){
|
||||
return $this->get_mapped_property('default_value');
|
||||
}
|
||||
/**
|
||||
* Return the metadatum default value
|
||||
*
|
||||
* @return string || integer
|
||||
*/
|
||||
function get_default_value(){
|
||||
return $this->get_mapped_property('default_value');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the an object child of \Tainacan\metadatum_Types\Metadata_Type with options
|
||||
*
|
||||
* @return \Tainacan\Metadata_Types\Metadata_Type The metadatum type class with filled options
|
||||
*/
|
||||
function get_metadata_type_object(){
|
||||
$class_name = $this->get_metadata_type();
|
||||
/**
|
||||
* Return the an object child of \Tainacan\metadatum_Types\Metadata_Type with options
|
||||
*
|
||||
* @return \Tainacan\Metadata_Types\Metadata_Type The metadatum type class with filled options
|
||||
*/
|
||||
function get_metadata_type_object(){
|
||||
$class_name = $this->get_metadata_type();
|
||||
|
||||
if( !class_exists( $class_name ) ){
|
||||
return null;
|
||||
}
|
||||
|
||||
$object_type = new $class_name();
|
||||
$object_type->set_options( $this->get_mapped_property('metadata_type_options') );
|
||||
return $object_type;
|
||||
}
|
||||
if( !class_exists( $class_name ) ) {
|
||||
$class_name = "Tainacan\\Metadata_Types\\Text";
|
||||
if( !class_exists( $class_name ) ){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class name for the metadatum type
|
||||
*
|
||||
* @return string The
|
||||
*/
|
||||
function get_metadata_type(){
|
||||
return $this->get_mapped_property('metadata_type');
|
||||
}
|
||||
$object_type = new $class_name();
|
||||
$object_type->set_options( $this->get_mapped_property('metadata_type_options') );
|
||||
return $object_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the actual options for the current metadatum type
|
||||
*
|
||||
* @return array Configurations for the metadatum type object
|
||||
*/
|
||||
function get_metadata_type_options(){
|
||||
/**
|
||||
* Return the class name for the metadatum type
|
||||
*
|
||||
* @return string The
|
||||
*/
|
||||
function get_metadata_type(){
|
||||
return $this->get_mapped_property('metadata_type');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the actual options for the current metadatum type
|
||||
*
|
||||
* @return array Configurations for the metadatum type object
|
||||
*/
|
||||
function get_metadata_type_options(){
|
||||
$object = $this->get_metadata_type_object();
|
||||
if ($object) {
|
||||
return $object->get_options(); // merge with dedault metadata type options
|
||||
}
|
||||
if ($object) {
|
||||
return $object->get_options(); // merge with dedault metadata type options
|
||||
}
|
||||
return $this->get_mapped_property('metadata_type_options');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this metadatum allow community suggestions, false otherwise
|
||||
* @return bool
|
||||
*/
|
||||
function get_accept_suggestion() {
|
||||
return $this->get_mapped_property('accept_suggestion');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array of exposer mapping configurations
|
||||
* @return array
|
||||
*/
|
||||
public function get_exposer_mapping() {
|
||||
return $this->get_mapped_property('exposer_mapping');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the semantic_uri
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_semantic_uri(){
|
||||
return $this->get_mapped_property('semantic_uri');
|
||||
}
|
||||
/**
|
||||
* Return true if this metadatum allow community suggestions, false otherwise
|
||||
* @return bool
|
||||
*/
|
||||
function get_accept_suggestion() {
|
||||
return $this->get_mapped_property('accept_suggestion');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array of exposer mapping configurations
|
||||
* @return array
|
||||
*/
|
||||
public function get_exposer_mapping() {
|
||||
return $this->get_mapped_property('exposer_mapping');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the semantic_uri
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_semantic_uri(){
|
||||
return $this->get_mapped_property('semantic_uri');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the metadatum name
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_name($value) {
|
||||
$this->set_mapped_property('name', $value);
|
||||
}
|
||||
/**
|
||||
* Set the metadatum name
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_name($value) {
|
||||
$this->set_mapped_property('name', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the metadatum slug
|
||||
*
|
||||
* If you dont set the metadatum slug, it will be set automatically based on the name and
|
||||
* following WordPress default behavior of creating slugs for posts.
|
||||
*
|
||||
* If you set the slug for an existing one, WordPress will append a number at the end of in order
|
||||
* to make it unique (e.g slug-1, slug-2)
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_slug($value) {
|
||||
$this->set_mapped_property('slug', $value);
|
||||
}
|
||||
/**
|
||||
* Set the metadatum slug
|
||||
*
|
||||
* If you dont set the metadatum slug, it will be set automatically based on the name and
|
||||
* following WordPress default behavior of creating slugs for posts.
|
||||
*
|
||||
* If you set the slug for an existing one, WordPress will append a number at the end of in order
|
||||
* to make it unique (e.g slug-1, slug-2)
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_slug($value) {
|
||||
$this->set_mapped_property('slug', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set manually the order of the metadatum
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_order($value) {
|
||||
$this->set_mapped_property('order', $value);
|
||||
}
|
||||
/**
|
||||
* Set manually the order of the metadatum
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_order($value) {
|
||||
$this->set_mapped_property('order', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the metadatum parent ID
|
||||
*
|
||||
* @param [integer] $value The ID from parent
|
||||
* @return void
|
||||
*/
|
||||
function set_parent($value) {
|
||||
$this->set_mapped_property('parent', $value);
|
||||
}
|
||||
/**
|
||||
* Set the metadatum parent ID
|
||||
*
|
||||
* @param [integer] $value The ID from parent
|
||||
* @return void
|
||||
*/
|
||||
function set_parent($value) {
|
||||
$this->set_mapped_property('parent', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set metadatum description
|
||||
*
|
||||
* @param [string] $value The text description
|
||||
* @return void
|
||||
*/
|
||||
function set_description($value) {
|
||||
$this->set_mapped_property('description', $value);
|
||||
}
|
||||
/**
|
||||
* Set metadatum description
|
||||
*
|
||||
* @param [string] $value The text description
|
||||
* @return void
|
||||
*/
|
||||
function set_description($value) {
|
||||
$this->set_mapped_property('description', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow the metadatum be required
|
||||
*
|
||||
* @param [boolean] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_required( $value ){
|
||||
$this->set_mapped_property('required', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow multiple metadata
|
||||
*
|
||||
* @param [boolean] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_multiple( $value ){
|
||||
$this->set_mapped_property('multiple', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of possible metadata
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_cardinality( $value ){
|
||||
$this->set_mapped_property('cardinality', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define if the value is key on the collection
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_collection_key( $value ){
|
||||
$this->set_mapped_property('collection_key', $value);
|
||||
}
|
||||
/**
|
||||
* Allow the metadatum be required
|
||||
*
|
||||
* @param [boolean] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_required( $value ){
|
||||
$this->set_mapped_property('required', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow multiple metadata
|
||||
*
|
||||
* @param [boolean] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_multiple( $value ){
|
||||
$this->set_mapped_property('multiple', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of possible metadata
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_cardinality( $value ){
|
||||
$this->set_mapped_property('cardinality', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define if the value is key on the collection
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_collection_key( $value ){
|
||||
$this->set_mapped_property('collection_key', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mask for the metadatum
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_mask( $value ){
|
||||
$this->set_mapped_property('mask', $value);
|
||||
}
|
||||
/**
|
||||
* Set mask for the metadatum
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_mask( $value ){
|
||||
$this->set_mapped_property('mask', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set default value
|
||||
*
|
||||
* @param [string || integer] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_default_value( $value ){
|
||||
$this->set_mapped_property('default_property', $value);
|
||||
}
|
||||
/**
|
||||
* Set default value
|
||||
*
|
||||
* @param [string || integer] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_default_value( $value ){
|
||||
$this->set_mapped_property('default_property', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* set the metadatum type class name
|
||||
*
|
||||
* @param string | \Tainacan\Metadata_Types\Metadata_Type $value The name of the class or the instance
|
||||
*/
|
||||
public function set_metadata_type( $value ){
|
||||
$this->set_mapped_property('metadata_type', ( is_object( $value ) ) ? get_class( $value ) : $value ) ; // Encode to avoid backslaches removal
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if this metadatum allow community suggestions
|
||||
* @param bool $value
|
||||
*/
|
||||
function set_accept_suggestion( $value ) {
|
||||
$this->set_mapped_property('accept_suggestion', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Metadatum type options
|
||||
*
|
||||
* @param [string || integer] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_metadata_type_options( $value ){
|
||||
$this->set_mapped_property('metadata_type_options', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set exposers mapping configuration for this metadatum
|
||||
* @param array $value
|
||||
*/
|
||||
public function set_exposer_mapping( $value ) {
|
||||
$this->set_mapped_property('exposer_mapping', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Semantic URI for the metadatum
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_semantic_uri( $value ){
|
||||
$this->set_mapped_property('semantic_uri', $value);
|
||||
}
|
||||
/**
|
||||
* set the metadatum type class name
|
||||
*
|
||||
* @param string | \Tainacan\Metadata_Types\Metadata_Type $value The name of the class or the instance
|
||||
*/
|
||||
public function set_metadata_type( $value ){
|
||||
$this->set_mapped_property('metadata_type', ( is_object( $value ) ) ? get_class( $value ) : $value ) ; // Encode to avoid backslaches removal
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if this metadatum allow community suggestions
|
||||
* @param bool $value
|
||||
*/
|
||||
function set_accept_suggestion( $value ) {
|
||||
$this->set_mapped_property('accept_suggestion', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Metadatum type options
|
||||
*
|
||||
* @param [string || integer] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_metadata_type_options( $value ){
|
||||
$this->set_mapped_property('metadata_type_options', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set exposers mapping configuration for this metadatum
|
||||
* @param array $value
|
||||
*/
|
||||
public function set_exposer_mapping( $value ) {
|
||||
$this->set_mapped_property('exposer_mapping', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Semantic URI for the metadatum
|
||||
*
|
||||
* @param [string] $value
|
||||
* @return void
|
||||
*/
|
||||
function set_semantic_uri( $value ){
|
||||
$this->set_mapped_property('semantic_uri', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transient property used to store the status of the metadatum for a particular collection
|
||||
|
@ -404,7 +407,7 @@ class Metadatum extends Entity {
|
|||
}
|
||||
|
||||
|
||||
// helpers
|
||||
// helpers
|
||||
|
||||
/**
|
||||
* Return true if is multiple, else return false
|
||||
|
@ -412,8 +415,8 @@ class Metadatum extends Entity {
|
|||
* @return boolean
|
||||
*/
|
||||
function is_multiple() {
|
||||
return $this->get_multiple() === 'yes';
|
||||
}
|
||||
return $this->get_multiple() === 'yes';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if is collection key, else return false
|
||||
|
@ -421,8 +424,8 @@ class Metadatum extends Entity {
|
|||
* @return boolean
|
||||
*/
|
||||
function is_collection_key() {
|
||||
return $this->get_collection_key() === 'yes';
|
||||
}
|
||||
return $this->get_collection_key() === 'yes';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if is required, else return false
|
||||
|
@ -430,8 +433,8 @@ class Metadatum extends Entity {
|
|||
* @return boolean
|
||||
*/
|
||||
function is_required() {
|
||||
return $this->get_required() === 'yes';
|
||||
}
|
||||
return $this->get_required() === 'yes';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc }
|
||||
|
@ -441,13 +444,12 @@ class Metadatum extends Entity {
|
|||
* @return bool valid or not
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function validate() {
|
||||
|
||||
$is_valid = parent::validate();
|
||||
|
||||
if (false === $is_valid)
|
||||
return false;
|
||||
|
||||
public function validate() {
|
||||
$is_valid = parent::validate();
|
||||
|
||||
if (false === $is_valid)
|
||||
return false;
|
||||
|
||||
// You cant have a multiple metadatum inside a compound metadatum (except taxonomy)
|
||||
if ($this->get_parent() > 0) {
|
||||
if ( $this->is_multiple() && $this->get_metadata_type_object()->get_primitive_type() != 'term') {
|
||||
|
@ -464,7 +466,8 @@ class Metadatum extends Entity {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
if ( $this->get_metadata_type() == 'Tainacan\Metadata_Types\Compound' && $this->is_multiple() ) {
|
||||
if ( $this->get_metadata_type() == 'Tainacan\Metadata_Types\Compound' && $this->is_multiple() && $this->get_id() != null ) {
|
||||
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$children_taxonomy = $Tainacan_Metadata->fetch(
|
||||
[
|
||||
|
@ -492,30 +495,26 @@ class Metadatum extends Entity {
|
|||
$this->add_error($this->get_id(), __("Compound metadata with multiple values can't have a children metadata set to as required", 'tainacan'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$fto = $this->get_metadata_type_object();
|
||||
$fto = $this->get_metadata_type_object();
|
||||
if (is_object($fto)) {
|
||||
$is_valid = $fto->validate_options($this);
|
||||
}
|
||||
|
||||
if (true === $is_valid) {
|
||||
$this->set_as_valid();
|
||||
|
||||
if (is_object($fto)) {
|
||||
$is_valid = $fto->validate_options($this);
|
||||
}
|
||||
|
||||
if (true === $is_valid) {
|
||||
$this->set_as_valid();
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!is_array($is_valid)) {
|
||||
throw new \Exception( "Return of validate_options metadatum type method should be an Array in case of error" );
|
||||
}
|
||||
if (!is_array($is_valid)) {
|
||||
throw new \Exception( "Return of validate_options metadatum type method should be an Array in case of error" );
|
||||
}
|
||||
|
||||
$this->add_error('metadata_type_options', $is_valid);
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
$this->add_error('metadata_type_options', $is_valid);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,17 +5,25 @@ use Tainacan;
|
|||
use Tainacan\Entities;
|
||||
|
||||
class CSV extends Exporter {
|
||||
private $collection_name;
|
||||
|
||||
public function __construct($attributes = array()) {
|
||||
parent::__construct($attributes);
|
||||
$this->set_accepted_mapping_methods('any'); // set all method to mapping
|
||||
$this->accept_no_mapping = true;
|
||||
if ($current_collection = $this->get_current_collection_object()) {
|
||||
$name = $current_collection->get_name();
|
||||
$this->collection_name = sanitize_title($name) . "_csv_export.csv";;
|
||||
} else {
|
||||
$this->collection_name = "csv_export.csv";
|
||||
}
|
||||
|
||||
//$this->set_accepted_mapping_methods('list', [ "dublin-core" ]); // set specific list of methods to mapping
|
||||
$this->set_default_options([
|
||||
'delimiter' => ',',
|
||||
'multivalued_delimiter' => '||',
|
||||
'enclosure' => '"'
|
||||
]);
|
||||
'delimiter' => ',',
|
||||
'multivalued_delimiter' => '||',
|
||||
'enclosure' => '"'
|
||||
]);
|
||||
}
|
||||
|
||||
public function filter_multivalue_separator($separator) {
|
||||
|
@ -61,7 +69,6 @@ class CSV extends Exporter {
|
|||
remove_filter('tainacan-item-metadata-get-multivalue-separator', [$this, 'filter_multivalue_separator']);
|
||||
remove_filter('tainacan-terms-hierarchy-html-separator', [$this, 'filter_hierarchy_separator']);
|
||||
|
||||
|
||||
$line[] = $item->get_status();
|
||||
|
||||
$line[] = $this->get_document_cell($item);
|
||||
|
@ -79,10 +86,8 @@ class CSV extends Exporter {
|
|||
$line[] = $item->get_modification_date();
|
||||
|
||||
$line_string = $this->str_putcsv($line, $this->get_option('delimiter'), $this->get_option('enclosure'));
|
||||
|
||||
|
||||
$this->append_to_file('csvexporter.csv', $line_string."\n");
|
||||
|
||||
|
||||
$this->append_to_file($this->collection_name, $line_string."\n");
|
||||
}
|
||||
|
||||
function get_compound_metadata_cell($meta) {
|
||||
|
@ -214,7 +219,7 @@ class CSV extends Exporter {
|
|||
|
||||
$line_string = $this->str_putcsv($line, $this->get_option('delimiter'), $this->get_option('enclosure'));
|
||||
|
||||
$this->append_to_file('csvexporter.csv', $line_string."\n");
|
||||
$this->append_to_file($this->collection_name, $line_string."\n");
|
||||
|
||||
}
|
||||
|
||||
|
@ -237,10 +242,15 @@ class CSV extends Exporter {
|
|||
public function get_output() {
|
||||
$files = $this->get_output_files();
|
||||
|
||||
if ( is_array($files) && isset($files['csvexporter.csv'])) {
|
||||
$file = $files['csvexporter.csv'];
|
||||
if ( is_array($files) && isset($files[$this->collection_name])) {
|
||||
$file = $files[$this->collection_name];
|
||||
$current_user = wp_get_current_user();
|
||||
$author_name = $current_user->user_login;
|
||||
|
||||
$message = __('target collections:', 'tainacan');
|
||||
$message .= " <b>" . implode(", ", $this->get_collections_names() ) . "</b><br/>";
|
||||
$message .= __('Exported by:', 'tainacan');
|
||||
$message .= " <b> ${author_name} </b><br/>";
|
||||
$message .= __('Your CSV file is ready! Access it in the link below:', 'tainacan');
|
||||
$message .= '<br/><br/>';
|
||||
$message .= '<a href="' . $file['url'] . '">Download</a>';
|
||||
|
@ -267,7 +277,7 @@ class CSV extends Exporter {
|
|||
|
||||
public function options_form() {
|
||||
ob_start();
|
||||
?>
|
||||
?>
|
||||
<div class="field">
|
||||
<label class="label"><?php _e('CSV Delimiter', 'tainacan'); ?></label>
|
||||
<span class="help-wrapper">
|
||||
|
@ -283,13 +293,13 @@ class CSV extends Exporter {
|
|||
<div class="help-tooltip-body">
|
||||
<p><?php _e('The character used to separate each column in your CSV (e.g. , or ;)', 'tainacan'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<div class="control is-clearfix">
|
||||
<input class="input" type="text" name="delimiter" maxlength="1" value="<?php echo $this->get_option('delimiter'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<label class="label"><?php _e('Multivalued metadata delimiter', 'tainacan'); ?></label>
|
||||
<span class="help-wrapper">
|
||||
|
@ -305,13 +315,13 @@ class CSV extends Exporter {
|
|||
<div class="help-tooltip-body">
|
||||
<p><?php _e('The character used to separate each value inside a cell with multiple values (e.g. ||). Note that the target metadatum must accept multiple values.', 'tainacan'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<div class="control is-clearfix">
|
||||
<input class="input" type="text" name="multivalued_delimiter" value="<?php echo $this->get_option('multivalued_delimiter'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<label class="label"><?php _e('Enclosure', 'tainacan'); ?></label>
|
||||
<span class="help-wrapper">
|
||||
|
@ -327,19 +337,14 @@ class CSV extends Exporter {
|
|||
<div class="help-tooltip-body">
|
||||
<p><?php _e('The character that wraps the content of each cell in your CSV. (e.g. ")', 'tainacan'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<div class="control is-clearfix">
|
||||
<input class="input" type="text" name="enclosure" value="<?php echo esc_attr($this->get_option('enclosure')); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
return ob_get_clean();
|
||||
|
||||
}
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
}
|
|
@ -84,7 +84,7 @@ abstract class Exporter {
|
|||
* This array holds the structure that the default step 'process_collections' will handle.
|
||||
*
|
||||
* Its an array of the target collections, with their IDs, an identifier from the source, the total number of items to be importer/exporter, the mapping array
|
||||
* from the source structure to the ID of the metadata metadata in tainacan
|
||||
* from the source structure to the ID of the metadata in tainacan
|
||||
*
|
||||
* The format of the map is an array where the keys are the metadata IDs of the destination collection and the
|
||||
* values are the identifier from the source. This could be an ID or a string or whatever the importer/exporter finds appropriate to handle
|
||||
|
@ -568,7 +568,13 @@ abstract class Exporter {
|
|||
|
||||
$processed_items = $this->get_items($current_collection_item, $collection_definition);
|
||||
foreach ($processed_items as $processed_item) {
|
||||
$init = microtime(true);
|
||||
$this->process_item( $processed_item['item'], $processed_item['metadata'] );
|
||||
$final = microtime(true);
|
||||
$total = ($final - $init);
|
||||
$time_log = sprintf( __('Processed in %f seconds', 'tainacan'), $total );
|
||||
|
||||
$this->add_log($time_log);
|
||||
}
|
||||
|
||||
$this->process_footer($current_collection_item, $collection_definition);
|
||||
|
@ -618,7 +624,6 @@ abstract class Exporter {
|
|||
$this->update_current_collection($collection_definition);
|
||||
}
|
||||
|
||||
|
||||
$data = [];
|
||||
while ($items->have_posts()) {
|
||||
$items->the_post();
|
||||
|
@ -681,14 +686,15 @@ abstract class Exporter {
|
|||
$upload_dir = trailingslashit( $upload_dir_info['basedir'] );
|
||||
$upload_url = trailingslashit( $upload_dir_info['baseurl'] );
|
||||
$exporter_folder = 'tainacan/exporter';
|
||||
$file_suffix = "{$exporter_folder}/{$prefix}_{$key}";
|
||||
|
||||
if (!is_dir($upload_dir . $exporter_folder)) {
|
||||
if (!mkdir($upload_dir . $exporter_folder)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$file_name = "$upload_dir$exporter_folder/$prefix$key";
|
||||
$file_url = "$upload_url$exporter_folder/$prefix$key";
|
||||
$file_name = "{$upload_dir}{$file_suffix}";
|
||||
$file_url = "{$upload_url}{$file_suffix}";
|
||||
$this->output_files[$key] = [
|
||||
'filename' => $file_name,
|
||||
'url' => $file_url
|
||||
|
@ -716,7 +722,7 @@ abstract class Exporter {
|
|||
* Method called by Exporters classes to set accepted mapping method
|
||||
*
|
||||
* @param string $method THe accepted methods. any or list. If list, Exporter must also inform
|
||||
* default mapper and the list of accepted mappers
|
||||
* default mapper and the list of accepted mappers
|
||||
* @param string $default_mapping The default mapping method. Required if list is chosen
|
||||
* @param array $list List of accepted mapping methods
|
||||
*/
|
||||
|
|
|
@ -9,13 +9,13 @@ namespace Tainacan\Exposers;
|
|||
class JSON_flat extends Exposer {
|
||||
|
||||
public $slug = 'json-flat'; // type slug for url safe
|
||||
public $name = 'simple JSON (JavaScript Object Notation) for tainacan items';
|
||||
public $name = 'Simple JSON (JavaScript Object Notation) for tainacan items';
|
||||
public $accept_no_mapper = true;
|
||||
protected $mappers = true;
|
||||
|
||||
function __construct() {
|
||||
$this->set_name( __('Simple JSON', 'tainacan') );
|
||||
$this->set_description( __('simple JSON for tainacan items', 'tainacan') );
|
||||
$this->set_description( __('Simple JSON for tainacan items', 'tainacan') );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -83,10 +83,45 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
}
|
||||
|
||||
public function get_output() {
|
||||
$message = __('Bulk edit finished', 'tainacan');
|
||||
$name = $this->get_bulk_edit_collection_name();
|
||||
$metadata = $this->get_changed_metadata();
|
||||
$current_user = wp_get_current_user();
|
||||
$author_name = $current_user->user_login;
|
||||
|
||||
$title_label = __('Collection', 'tainacan');
|
||||
$author_label = __('Edited by', 'tainacan');
|
||||
$metadata_label = __('Changed metadata', 'tainacan');
|
||||
|
||||
$message = __('Bulk edit finished', 'tainacan');
|
||||
$message .= "<p> <strong> ${title_label}: </strong> ${name} </p>";
|
||||
$message .= "<p> <strong> ${author_label}: </strong> ${author_name} </p>";
|
||||
$message .= "<p> <strong> ${metadata_label}: </strong> ${metadata} </p>";
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
private function get_bulk_edit_collection_name() {
|
||||
$params = $this->get_options();
|
||||
if ($params['collection_id']) {
|
||||
$collection = $params['collection_id'];
|
||||
$bulk_collection = Tainacan\Repositories\Collections::get_instance()->fetch($collection);
|
||||
|
||||
if ($bulk_collection instanceof \Tainacan\Entities\Collection) {
|
||||
return $bulk_collection->get_name();
|
||||
}
|
||||
}
|
||||
|
||||
return __('Collection', 'tainacan');
|
||||
}
|
||||
|
||||
private function get_changed_metadata() {
|
||||
$metadatum = $this->metadatum_repository->fetch($this->bulk_edit_data['metadatum_id']);
|
||||
if ($metadatum instanceof \Tainacan\Entities\Metadatum) {
|
||||
return $metadatum->get_name();
|
||||
}
|
||||
return __('Metadata', 'tainacan');
|
||||
}
|
||||
|
||||
public function set_bulk_edit_data($bulk_edit_data = false) {
|
||||
$this->bulk_edit_data = $bulk_edit_data;
|
||||
}
|
||||
|
|
|
@ -50,18 +50,18 @@ abstract class Generic_Process {
|
|||
];
|
||||
|
||||
/**
|
||||
* Transients is used to store temporary data to be used accross multiple requests
|
||||
* Transients are used to store temporary data to be used across multiple requests
|
||||
*
|
||||
* Add and remove transient data using add_transient() and delete_transient() methods
|
||||
*
|
||||
* Transitens can be strings, numbers or arrays. Avoid storing objects.
|
||||
* Transients can be strings, numbers or arrays. Avoid storing objects.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $transients = [];
|
||||
|
||||
/**
|
||||
* Wether to abort process execution.
|
||||
* Whether to abort process execution.
|
||||
* @var bool
|
||||
*/
|
||||
protected $abort = false;
|
||||
|
@ -73,8 +73,8 @@ abstract class Generic_Process {
|
|||
protected $error_log = [];
|
||||
|
||||
/**
|
||||
* List of attributes that are saved in DB and that are used to
|
||||
* reconstruct the object, this property need be overwrite.
|
||||
* List of attributes saved in DB, used to reconstruct the object.
|
||||
* This property needs to be overwritten.
|
||||
* @var array
|
||||
*/
|
||||
protected $array_attributes = [
|
||||
|
@ -84,7 +84,7 @@ abstract class Generic_Process {
|
|||
];
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string the process unique id
|
||||
*/
|
||||
public function get_id(){
|
||||
return $this->id;
|
||||
|
|
|
@ -63,8 +63,4 @@ class Background_Importer extends Background_Process {
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
}
|
|
@ -283,7 +283,6 @@ class CSV extends Importer {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function options_form() {
|
||||
ob_start();
|
||||
?>
|
||||
|
@ -654,7 +653,7 @@ class CSV extends Importer {
|
|||
*
|
||||
* @param array $processed_item Associative array with metadatum source's as index with
|
||||
* its value or values
|
||||
* @param integet $collection_index The index in the $this->collections array of the collection the item is beeing inserted into
|
||||
* @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
|
||||
*/
|
||||
|
@ -722,7 +721,7 @@ class CSV extends Importer {
|
|||
if( is_array( $processed_item ) ) {
|
||||
foreach ( $processed_item as $metadatum_source => $values ) {
|
||||
|
||||
if ( $metadatum_source == 'special_document' ||
|
||||
if ($metadatum_source == 'special_document' ||
|
||||
$metadatum_source == 'special_attachments' ||
|
||||
$metadatum_source == 'special_item_status' ||
|
||||
$metadatum_source == 'special_comment_status') {
|
||||
|
@ -736,9 +735,9 @@ class CSV extends Importer {
|
|||
}
|
||||
$metadatum = $Tainacan_Metadata->fetch( $tainacan_metadatum_id );
|
||||
|
||||
if( $this->is_empty_value( $values ) ) continue;
|
||||
if ($this->is_empty_value($values)) continue;
|
||||
|
||||
if( $metadatum instanceof Entities\Metadatum ) {
|
||||
if ($metadatum instanceof Entities\Metadatum) {
|
||||
$singleItemMetadata = new Entities\Item_Metadata_Entity( $item, $metadatum); // *empty item will be replaced by inserted in the next foreach
|
||||
if( $metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\Taxonomy' ) {
|
||||
if( !is_array( $values ) ) {
|
||||
|
@ -959,18 +958,25 @@ class CSV extends Importer {
|
|||
public function add_collection(array $collection) {
|
||||
if (isset($collection['id'])) {
|
||||
|
||||
if( isset($collection['mapping']) && is_array($collection['mapping']) ){
|
||||
if (isset($collection['mapping']) && is_array($collection['mapping'])) {
|
||||
|
||||
foreach( $collection['mapping'] as $metadatum_id => $header ){
|
||||
|
||||
if( !is_numeric($metadatum_id) ) {
|
||||
$metadatum = $this->create_new_metadata( $header, $collection['id']);
|
||||
if ( $metadatum == false ) {
|
||||
$this->add_error_log( __("Error on creating metadata metadata, please review the metadata description.", 'tainacan') );
|
||||
if (!is_numeric($metadatum_id)) {
|
||||
$repo_key = "create_repository_metadata";
|
||||
$collection_id = $collection['id'];
|
||||
if (strpos($metadatum_id, $repo_key) !== false) {
|
||||
$collection_id = "default";
|
||||
}
|
||||
$metadatum = $this->create_new_metadata($header, $collection_id);
|
||||
|
||||
if ($metadatum == false) {
|
||||
$this->add_error_log( __("Error while creating metadatum, please review the metadatum description.", 'tainacan') );
|
||||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
if( is_object($metadatum) && $metadatum instanceof \Tainacan\Entities\Metadatum ){
|
||||
|
||||
if (is_object($metadatum) && $metadatum instanceof \Tainacan\Entities\Metadatum) {
|
||||
$collection['mapping'][$metadatum->get_id()] = $header;
|
||||
} elseif ( is_array($metadatum) && sizeof($metadatum) == 2) {
|
||||
$parent_header = key($header);
|
||||
|
@ -981,13 +987,16 @@ class CSV extends Importer {
|
|||
}
|
||||
|
||||
$this->save_mapping( $collection['id'], $collection['mapping'] );
|
||||
|
||||
|
||||
$coll = \Tainacan\Repositories\Collections::get_instance()->fetch($collection['id']);
|
||||
$metadata_order = array_map(
|
||||
function($meta) { return ["enabled"=>true, "id"=>$meta]; },
|
||||
array_keys( $collection['mapping'] )
|
||||
);
|
||||
$coll->set_metadata_order( $metadata_order );
|
||||
if(empty($coll->get_metadata_order())) {
|
||||
$metadata_order = array_map(
|
||||
function($meta) { return ["enabled"=>true, "id"=>$meta]; },
|
||||
array_keys( $collection['mapping'] )
|
||||
);
|
||||
$coll->set_metadata_order( $metadata_order );
|
||||
}
|
||||
|
||||
if ( $coll->validate() ) {
|
||||
\Tainacan\Repositories\Collections::get_instance()->update( $coll );
|
||||
} else {
|
||||
|
@ -1018,9 +1027,17 @@ class CSV extends Importer {
|
|||
* @return string
|
||||
*/
|
||||
public function get_output() {
|
||||
$imported_file = basename($this->get_tmp_file());
|
||||
$current_user = wp_get_current_user();
|
||||
$author = $current_user->user_login;
|
||||
|
||||
$message = __('target collections:', 'tainacan');
|
||||
$message = __('imported file:', 'tainacan');
|
||||
$message .= " <b> ${imported_file} </b><br/>";
|
||||
$message .= __('target collections:', 'tainacan');
|
||||
$message .= " <b>" . implode(", ", $this->get_collections_names() ) . "</b><br/>";
|
||||
$message .= __('Imported by:', 'tainacan');
|
||||
$message .= " <b> ${author} </b><br/>";
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ class Importer_Handler {
|
|||
$this->bg_importer = new Background_Importer();
|
||||
|
||||
add_action('init', array(&$this, 'init'));
|
||||
|
||||
}
|
||||
|
||||
public function init() {
|
||||
|
@ -220,5 +219,3 @@ class Importer_Handler {
|
|||
|
||||
global $Tainacan_Importer_Handler;
|
||||
$Tainacan_Importer_Handler = new Importer_Handler();
|
||||
|
||||
?>
|
|
@ -26,7 +26,7 @@ abstract class Importer {
|
|||
* This array holds the structure that the default step 'process_collections' will handle.
|
||||
*
|
||||
* Its an array of the target collections, with their IDs, an identifier from the source, the total number of items to be imported, the mapping array
|
||||
* from the source structure to the ID of the metadata metadata in tainacan
|
||||
* from the source structure to the ID of the metadata in tainacan
|
||||
*
|
||||
* The format of the map is an array where the keys are the metadata IDs of the destination collection and the
|
||||
* values are the identifier from the source. This could be an ID or a string or whatever the importer finds appropriate to handle
|
||||
|
@ -761,8 +761,6 @@ abstract class Importer {
|
|||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -913,8 +911,6 @@ abstract class Importer {
|
|||
}
|
||||
|
||||
return $return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -984,13 +980,20 @@ abstract class Importer {
|
|||
|
||||
if( $taxonomy->validate() ){
|
||||
$inserted_tax = $taxonomy_repo->insert( $taxonomy );
|
||||
$newMetadatum->set_metadata_type_options([
|
||||
'taxonomy_id' => $inserted_tax->get_id(),
|
||||
'allow_new_terms' => 'yes',
|
||||
'input_type' => 'tainacan-taxonomy-checkbox'
|
||||
]);
|
||||
if(is_array($properties) && in_array( 'multiple', $properties) ){
|
||||
$newMetadatum->set_metadata_type_options([
|
||||
'taxonomy_id' => $inserted_tax->get_id(),
|
||||
'allow_new_terms' => 'yes',
|
||||
'input_type' => 'tainacan-taxonomy-checkbox'
|
||||
]);
|
||||
} else {
|
||||
$newMetadatum->set_metadata_type_options([
|
||||
'taxonomy_id' => $inserted_tax->get_id(),
|
||||
'allow_new_terms' => 'no',
|
||||
'input_type' => 'tainacan-taxonomy-radio'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*Properties of metadatum*/
|
||||
|
|
|
@ -195,6 +195,31 @@ class Collections extends Repository {
|
|||
'default' => 'open',
|
||||
'validation' => v::optional(v::stringType()->in( [ 'open', 'closed' ] )),
|
||||
],
|
||||
'submission_anonymous_user' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Allows submission by anonymous user', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'If enabled, allows submission by anonymous users, whose does not have to be logged in with permissions on the WordPress system.', 'tainacan' ),
|
||||
'default' => 'no',
|
||||
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
|
||||
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
|
||||
],
|
||||
'submission_default_status' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Default submission item status', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'The default status of the item that will be created in the collection after submission.', 'tainacan' ),
|
||||
'default' => 'draft'
|
||||
],
|
||||
'allows_submission' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Allows item submission', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'If enabled, the collection allows item submission, for example via the Item Submission block.', 'tainacan' ),
|
||||
'default' => 'no',
|
||||
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
|
||||
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
|
||||
],
|
||||
'hide_items_thumbnail_on_lists' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Hide items thumbnail on lists', 'tainacan' ),
|
||||
|
@ -204,6 +229,16 @@ class Collections extends Repository {
|
|||
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
|
||||
'default' => 'no'
|
||||
],
|
||||
'submission_use_recaptcha' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Use reCAPTCHA verification on submission form', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'If enabled, the collection allows item submission using a reCAPTCHA', 'tainacan' ),
|
||||
'default' => 'no',
|
||||
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
|
||||
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
|
||||
],
|
||||
|
||||
] );
|
||||
}
|
||||
|
||||
|
@ -270,10 +305,12 @@ class Collections extends Repository {
|
|||
public function insert( $collection ) {
|
||||
|
||||
$this->pre_process( $collection );
|
||||
|
||||
|
||||
$this->handle_parent_order_clone( $collection );
|
||||
$new_collection = parent::insert( $collection );
|
||||
|
||||
$this->handle_core_metadata( $new_collection );
|
||||
$this->handle_control_metadata( $new_collection );
|
||||
|
||||
$collection->register_collection_item_post_type();
|
||||
flush_rewrite_rules( false ); // needed to activate items post type archive url
|
||||
|
@ -374,6 +411,30 @@ class Collections extends Repository {
|
|||
}
|
||||
}
|
||||
|
||||
function handle_control_metadata( $collection ) {
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
|
||||
$Tainacan_Metadata->register_control_metadata( $collection );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function guarantees that children collections has its own clone
|
||||
* of "metadata_order" from the parent collention.
|
||||
*
|
||||
* @param \Tainacan\Entities\Collection $collection, children collection
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function handle_parent_order_clone( &$collection ) {
|
||||
if ($collection instanceof Entities\Collection && $collection->get_parent() != 0) {
|
||||
$parent_collection = $this->fetch( $collection->get_parent() );
|
||||
$collection->set_metadata_order($parent_collection->get_metadata_order());
|
||||
$collection->set_filters_order($parent_collection->get_filters_order());
|
||||
|
||||
if (!$collection->validate()) {
|
||||
throw new \Exception( implode(",", $collection->get_errors()) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -70,7 +70,8 @@ class Item_Metadata extends Repository {
|
|||
return $item_metadata;
|
||||
} else {
|
||||
if ( $unique ) {
|
||||
if( empty( $item_metadata->get_value() ) ) {
|
||||
|
||||
if ( !is_numeric($item_metadata->get_value()) && empty( $item_metadata->get_value() ) ) {
|
||||
if ( $item_metadata->get_metadatum()->get_parent() > 0 )
|
||||
delete_metadata_by_mid( 'post', $item_metadata->get_meta_id() );
|
||||
else
|
||||
|
@ -101,7 +102,7 @@ class Item_Metadata extends Repository {
|
|||
$values = $item_metadata->get_value();
|
||||
|
||||
foreach ( $values as $value ) {
|
||||
if( empty($value) || $value == "" ) {
|
||||
if ( !is_numeric($value) && empty($value) ) {
|
||||
continue;
|
||||
}
|
||||
add_post_meta( $item_metadata->get_item()->get_id(), $item_metadata->get_metadatum()->get_id(), wp_slash( $value ) );
|
||||
|
|
|
@ -231,7 +231,7 @@ class Items extends Repository {
|
|||
$no_collection_set = false;
|
||||
|
||||
/**
|
||||
* We can not user $collections->fetch() here because facets
|
||||
* We can not use $collections->fetch() here because facets
|
||||
* filter wp_query to just return the query and not the results
|
||||
* See Repositories\Metadata::fetch_all_metadatum_values()
|
||||
*
|
||||
|
|
|
@ -199,7 +199,17 @@ class Metadata extends Repository {
|
|||
'validation' => v::optional( v::url() ),
|
||||
'description' => __( 'The semantic metadatum description URI like: ', 'tainacan' ) . 'https://schema.org/URL',
|
||||
'default' => ''
|
||||
]
|
||||
],
|
||||
'repository_level' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Repository metadata', 'tainacan' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'Makes this metadatum a repository level metadatum instead of collection metadatum', 'tainacan' ),
|
||||
'on_error' => __( 'Invalid value for repository metadata', 'tainacan' ),
|
||||
'validation' => v::stringType()->in( [ 'yes', 'no' ] ),
|
||||
// yes or no. It cant be multiple if its collection_key
|
||||
'default' => 'no'
|
||||
],
|
||||
] );
|
||||
}
|
||||
|
||||
|
@ -326,17 +336,27 @@ class Metadata extends Repository {
|
|||
return [];
|
||||
}
|
||||
} elseif ( is_array( $args ) ) {
|
||||
|
||||
$args = array_merge( [
|
||||
'posts_per_page' => - 1,
|
||||
], $args );
|
||||
|
||||
if ( ! (isset($args['include_control_metadata_types']) && $args['include_control_metadata_types'] == true) ) {
|
||||
if( !isset($args['meta_query']) )
|
||||
$args['meta_query'] = [];
|
||||
$args['meta_query'][] = [
|
||||
'key' => 'metadata_type',
|
||||
'value' => 'Tainacan\Metadata_Types\Control',
|
||||
'compare' => 'NOT IN'
|
||||
];
|
||||
}
|
||||
|
||||
$args = $this->parse_fetch_args( $args );
|
||||
|
||||
$args['post_type'] = Entities\Metadatum::get_post_type();
|
||||
|
||||
$args = apply_filters( 'tainacan_fetch_args', $args, 'metadata' );
|
||||
|
||||
|
||||
$wp_query = new \WP_Query( $args );
|
||||
|
||||
return $this->fetch_output( $wp_query, $output );
|
||||
|
@ -422,9 +442,7 @@ class Metadata extends Repository {
|
|||
$args['meta_query'] = $original_meta_q;
|
||||
$args['meta_query'][] = $meta_query;
|
||||
|
||||
//var_dump($args);
|
||||
$results = array_merge($results, $this->fetch( $args, 'OBJECT' ));
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -447,9 +465,14 @@ class Metadata extends Repository {
|
|||
$args['meta_query'][] = $meta_query;
|
||||
|
||||
$results = $this->fetch( $args, 'OBJECT' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!isset($args['add_only_repository']) || $args['add_only_repository'] !== true) {
|
||||
$results = array_filter($results, function($meta) {
|
||||
return ( !isset($meta->get_metadata_type_options()['only_repository']) || $meta->get_metadata_type_options()['only_repository'] == 'no' );
|
||||
});
|
||||
}
|
||||
|
||||
return $this->order_result(
|
||||
$results,
|
||||
|
@ -562,6 +585,7 @@ class Metadata extends Repository {
|
|||
*/
|
||||
public function order_result( $result, Entities\Collection $collection, $include_disabled = false ) {
|
||||
$order = $collection->get_metadata_order();
|
||||
|
||||
if ( $order ) {
|
||||
$order = ( is_array( $order ) ) ? $order : unserialize( $order );
|
||||
|
||||
|
@ -644,15 +668,12 @@ class Metadata extends Repository {
|
|||
|
||||
do_action( 'register_metadata_types' );
|
||||
|
||||
if ( $output === 'NAME' ) {
|
||||
foreach ( $this->metadata_types as $metadata_type ) {
|
||||
$return[] = str_replace( 'Tainacan\Metadata_Types\\', '', $metadata_type );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
return $this->metadata_types;
|
||||
return array_map(
|
||||
function($metadata_type) use ($output) {
|
||||
return $output === 'NAME' ? str_replace( 'Tainacan\\Metadata_Types\\', '', $metadata_type ) : $metadata_type;
|
||||
},
|
||||
array_filter($this->metadata_types, function($metadata_type) { return $metadata_type != 'Tainacan\Metadata_Types\Control';})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -773,6 +794,90 @@ class Metadata extends Repository {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entities\Collection $collection
|
||||
* @param bool $force if true will register control metadata even if collection is auto draft
|
||||
*
|
||||
* @return bool
|
||||
* @throws \ErrorException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function register_control_metadata( Entities\Collection $collection, $force = false ) {
|
||||
|
||||
if ( $force !== true && $collection->get_status() == 'auto-draft' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$metadata = $this->fetch( [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => 'metadata_type',
|
||||
'value' => 'Tainacan\Metadata_Types\Control',
|
||||
'compare' => '='
|
||||
],[
|
||||
'key' => 'collection_id',
|
||||
'value' => 'default',
|
||||
'compare' => '='
|
||||
]
|
||||
],
|
||||
'include_disabled' => true,
|
||||
'include_control_metadata_types' => true
|
||||
], 'OBJECT' );
|
||||
|
||||
$data_control_metadata = [
|
||||
'document_type' => [
|
||||
'name' => __('Document type', 'tainacan'),
|
||||
'description' => __('The item main document type', 'tainacan'),
|
||||
'collection_id' => 'default',
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Control',
|
||||
'status' => 'publish',
|
||||
'display' => 'never',
|
||||
'metadata_type_options' => [ 'control_metadatum' => 'document_type' ]
|
||||
],
|
||||
'collection_id' => [
|
||||
'name' => __('Collection', 'tainacan'),
|
||||
'description' => __('The item collection ID', 'tainacan'),
|
||||
'collection_id' => 'default',
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Control',
|
||||
'status' => 'publish',
|
||||
'display' => 'never',
|
||||
'metadata_type_options' => [
|
||||
'control_metadatum' => 'collection_id',
|
||||
'only_repository' => 'yes'
|
||||
]
|
||||
],
|
||||
'has_thumbnail' => [
|
||||
'name' => __('Has thumbnail', 'tainacan'),
|
||||
'description' => __('Does the item has a thumbnail set?', 'tainacan'),
|
||||
'collection_id' => 'default',
|
||||
'metadata_type' => 'Tainacan\Metadata_Types\Control',
|
||||
'status' => 'publish',
|
||||
'display' => 'never',
|
||||
'metadata_type_options' => [ 'control_metadatum' => 'has_thumbnail' ]
|
||||
],
|
||||
];
|
||||
|
||||
foreach ( $data_control_metadata as $index => $data_control_metadatum ) {
|
||||
if ( empty( $metadata ) ) {
|
||||
$this->insert_array_metadatum( $data_control_metadatum );
|
||||
} else {
|
||||
$exists = false;
|
||||
foreach ( $metadata as $metadatum ) {
|
||||
if (
|
||||
$metadatum->get_metadata_type() === $data_control_metadatum['metadata_type'] &&
|
||||
$metadatum->get_metadata_type_options()['control_metadatum'] == $data_control_metadatum['metadata_type_options']['control_metadatum']
|
||||
) {
|
||||
$exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $exists ) {
|
||||
$this->insert_array_metadatum( $data_control_metadatum );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* block user from remove core metadata
|
||||
*
|
||||
|
@ -912,7 +1017,6 @@ class Metadata extends Repository {
|
|||
$set_ = 'set_' . $attribute;
|
||||
$metadatum->$set_( $value );
|
||||
}
|
||||
|
||||
if ( $metadatum->validate() ) {
|
||||
$metadatum = $this->insert( $metadatum );
|
||||
|
||||
|
@ -1249,6 +1353,9 @@ class Metadata extends Repository {
|
|||
continue;
|
||||
}
|
||||
$label = $_post->post_title;
|
||||
} elseif ( $metadatum_type === 'Tainacan\Metadata_Types\Control' ) {
|
||||
$metadata_type_object = $metadatum->get_metadata_type_object();
|
||||
$label = $metadata_type_object->get_control_metadatum_value($r, $metadatum_options['control_metadatum'], 'string' );
|
||||
} elseif ( $metadatum_type === 'Tainacan\Metadata_Types\User' ) {
|
||||
$name = get_the_author_meta( 'display_name', $label );
|
||||
$label = apply_filters("tainacan-item-get-author-name", $name);
|
||||
|
|
|
@ -128,9 +128,10 @@ abstract class Repository {
|
|||
$old = '';
|
||||
|
||||
$diffs = [];
|
||||
|
||||
do_action( 'tainacan-pre-insert', $obj );
|
||||
do_action( 'tainacan-pre-insert-' . $obj->get_post_type(), $obj );
|
||||
$obj_post_type = $obj->get_post_type();
|
||||
if( $obj_post_type != false )
|
||||
do_action( "tainacan-pre-insert-$obj_post_type", $obj );
|
||||
|
||||
$map = $this->get_map();
|
||||
|
||||
|
@ -159,6 +160,8 @@ abstract class Repository {
|
|||
|
||||
$post_t = $collection->get_db_identifier();
|
||||
$obj->WP_Post->post_type = $post_t;
|
||||
$obj_post_type = 'tainacan-item';
|
||||
do_action( "tainacan-pre-insert-$obj_post_type", $obj );
|
||||
}
|
||||
|
||||
// TODO verificar se salvou mesmo
|
||||
|
@ -176,7 +179,9 @@ abstract class Repository {
|
|||
update_post_meta( $id, '_user_edit_lastr', get_current_user_id() );
|
||||
|
||||
do_action( 'tainacan-insert', $obj, $diffs, $is_update );
|
||||
do_action( 'tainacan-insert-' . $obj->get_post_type(), $obj );
|
||||
if( $obj_post_type != false ) {
|
||||
do_action( "tainacan-insert-$obj_post_type", $obj );
|
||||
}
|
||||
|
||||
// return a brand new object
|
||||
return new $this->entities_type( $obj->WP_Post );
|
||||
|
|
|
@ -49,7 +49,8 @@ class Theme_Helper {
|
|||
add_filter('get_the_archive_title', array($this, 'filter_archive_title'));
|
||||
|
||||
add_shortcode( 'tainacan-search', array($this, 'search_shortcode'));
|
||||
|
||||
add_shortcode( 'tainacan-item-submission', array($this, 'item_submission_shortcode'));
|
||||
|
||||
add_action( 'generate_rewrite_rules', array( &$this, 'rewrite_rules' ), 10, 1 );
|
||||
add_filter( 'query_vars', array( &$this, 'rewrite_rules_query_vars' ) );
|
||||
add_filter( 'template_include', array( &$this, 'rewrite_rule_template_include' ) );
|
||||
|
@ -366,6 +367,28 @@ class Theme_Helper {
|
|||
return $image;
|
||||
}
|
||||
|
||||
public function item_submission_shortcode($args) {
|
||||
global $TAINACAN_BASE_URL;
|
||||
|
||||
$props = ' ';
|
||||
|
||||
// Passes arguments to custom props
|
||||
if ($args) {
|
||||
foreach ($args as $key => $value) {
|
||||
if ($value == true || $value == 'true') {
|
||||
$props .= str_replace('_', '-', $key) . '="' . $value . '" ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script('jcrop');
|
||||
wp_enqueue_script('tainacan-item-submission', $TAINACAN_BASE_URL . '/assets/js/item_submission.js' , ['underscore', 'jcrop', 'media-editor', 'media-views', 'customize-controls'] , TAINACAN_VERSION);
|
||||
wp_localize_script('tainacan-item-submission', 'tainacan_plugin', \Tainacan\Admin::get_instance()->get_admin_js_localization_params());
|
||||
|
||||
return "<div id='tainacan-item-submission-form' $props ></div>";
|
||||
}
|
||||
|
||||
public function search_shortcode($args) {
|
||||
|
||||
$props = ' ';
|
||||
|
@ -487,7 +510,7 @@ class Theme_Helper {
|
|||
*
|
||||
* @type string $label Label, visible to users. Default to $slug
|
||||
* @type string $description Description, visible only to editors in the admin. Default none.
|
||||
* @type string $type Type. Accepted values are 'template' or 'component'. Defautl 'template'
|
||||
* @type string $type Type. Accepted values are 'template' or 'component'. Default 'template'
|
||||
* @type string $template Full path to the template file to be used. Required if $type is set to template.
|
||||
* Default: theme-path/tainacan/view-mode-{$slug}.php
|
||||
* @type string $component Component tag name. The web component js must be included and must accept two props:
|
||||
|
@ -567,7 +590,7 @@ class Theme_Helper {
|
|||
$title = tainacan_get_the_collection_name();
|
||||
$img_info = ( has_post_thumbnail( tainacan_get_collection_id() ) ) ? wp_get_attachment_image_src( get_post_thumbnail_id( tainacan_get_collection_id() ), 'full' ) : $logo;
|
||||
$url_src = home_url( $wp->request );
|
||||
$excerpt = tainacan_get_the_collection_description();
|
||||
$excerpt = strip_tags(tainacan_get_the_collection_description());
|
||||
} elseif ( is_post_type_archive('tainacan-collection') ) {
|
||||
$title = __('Collections', 'tainacan');
|
||||
}
|
||||
|
@ -589,7 +612,7 @@ class Theme_Helper {
|
|||
$tainacan_term = tainacan_get_term();
|
||||
|
||||
$title = $term->name;
|
||||
$excerpt = $term->description;
|
||||
$excerpt = strip_tags($term->description);
|
||||
|
||||
$url_src = get_term_link($term->term_id, $term->taxonomy);
|
||||
|
||||
|
|
|
@ -445,6 +445,41 @@ class Migrations {
|
|||
|
||||
}
|
||||
|
||||
static function create_control_metadata() {
|
||||
$items_repository = \Tainacan\Repositories\Items::get_instance();
|
||||
$collection_repository = \Tainacan\Repositories\Collections::get_instance();
|
||||
$metadata_repository = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$collections = $collection_repository->fetch(['posts_per_page' => -1], 'OBJECT');
|
||||
$helper = \Tainacan\Metadata_Types\Control::get_helper();
|
||||
|
||||
foreach ($collections as $collection) {
|
||||
$collection_id = $collection->get_id();
|
||||
$metadata_repository->register_control_metadata( $collection );
|
||||
$per_page = 50; $page = 1;
|
||||
$args = [
|
||||
'posts_per_page'=> $per_page,
|
||||
'paged' => $page,
|
||||
'post_status' => get_post_stati()
|
||||
];
|
||||
$collection_items = $items_repository->fetch($args, $collection_id, 'WP_Query');
|
||||
$total = $collection_items->found_posts;
|
||||
$last_page = ceil($total/$per_page);
|
||||
while ($page++ <= $last_page) {
|
||||
if ($collection_items->have_posts()) {
|
||||
while ( $collection_items->have_posts() ) {
|
||||
$collection_items->the_post();
|
||||
$item = new \Tainacan\Entities\Item($collection_items->post);
|
||||
if ( $item instanceof \Tainacan\Entities\Item) {
|
||||
$helper->update_control_metadatum($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
$args['paged'] = $page;
|
||||
$collection_items = $items_repository->fetch($args, $collection_id, 'WP_Query');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, vnmedeiros, tainacan
|
||||
Tags: museums, libraries, archives, GLAM, collections, repository
|
||||
Requires at least: 4.8
|
||||
Tested up to: 5.4
|
||||
Tested up to: 5.6
|
||||
Requires PHP: 5.6
|
||||
Stable tag: 0.16.3
|
||||
Stable tag: 0.17.2
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
@ -13,7 +13,7 @@ Tainacan is an open-source, powerful and flexible digital repository platform fo
|
|||
|
||||
== Description ==
|
||||
|
||||
[Tainacan](https://tainacan.org/) is an open-source, powerful and flexible digital repository platform for WordPress. Manage and publish your digital collections just as easily as you post to your blog, having all the tools of a professional repository platform. It can be used for the creation of a digital collection, a digital library or a digital repository for your institutional or personal collection.
|
||||
[Tainacan](https://tainacan.org/) is an [open-source](https://github.com/tainacan/tainacan), powerful and flexible digital repository platform for WordPress. Manage and publish your digital collections just as easily as you post to your blog, having all the tools of a professional repository platform. It can be used for the creation of a digital collection, a digital library or a digital repository for your institutional or personal collection.
|
||||
|
||||
Tainacan aims to facilitate the activities of organizing, documenting, disseminating and displaying digital objects based on simple and accessible principles of digital curation. The plugin integrates with the Wordpress block engine, making it easy to reuse objects for different and varied uses.
|
||||
|
||||
|
@ -80,6 +80,7 @@ If you have Imagick installed in your server, Tainacan will be able to automatic
|
|||
== Find out more ==
|
||||
|
||||
* Visit our official website: [https://tainacan.org/](https://tainacan.org/)
|
||||
* Contribute to the source code: [https://github.com/tainacan/tainacan](https://github.com/tainacan/tainacan)
|
||||
* Check our documentation Wiki: [https://wiki.tainacan.org/](https://wiki.tainacan.org/)
|
||||
|
||||
== Screenshots ==
|
||||
|
|
|
@ -4,13 +4,13 @@ Plugin Name: Tainacan
|
|||
Plugin URI: https://tainacan.org/
|
||||
Description: Open source, powerfull and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional respository platform.
|
||||
Author: Tainacan.org
|
||||
Version: 0.16.3
|
||||
Version: 0.17.2
|
||||
Text Domain: tainacan
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
|
||||
const TAINACAN_VERSION = '0.16.3';
|
||||
const TAINACAN_VERSION = '0.17.2';
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
$TAINACAN_BASE_URL = plugins_url('', __FILE__);
|
||||
|
@ -34,3 +34,9 @@ add_action( 'after_setup_theme', function() {
|
|||
} );
|
||||
|
||||
add_action('init', ['Tainacan\Migrations', 'run_migrations']);
|
||||
|
||||
//https://core.trac.wordpress.org/ticket/23022
|
||||
//https://core.trac.wordpress.org/ticket/23022#comment:13
|
||||
add_filter( 'wp_untrash_post_status', function( $new_status, $post_id, $previous_status ) {
|
||||
return $previous_status;
|
||||
}, 10, 3 );
|
|
@ -431,7 +431,7 @@
|
|||
:addons="false"
|
||||
:label="$i18n.get('label_slug')"
|
||||
:type="editFormErrors['slug'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['slug'] != undefined ? editFormErrors['slug'] : ''">
|
||||
:message="isUpdatingSlug ? $i18n.get('info_validating_slug') : (editFormErrors['slug'] != undefined ? editFormErrors['slug'] : '')">
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'slug')"
|
||||
:message="$i18n.getHelperMessage('collections', 'slug')"/>
|
||||
|
@ -439,7 +439,9 @@
|
|||
id="tainacan-text-slug"
|
||||
@input="updateSlug"
|
||||
v-model="form.slug"
|
||||
@focus="clearErrors('slug')"/>
|
||||
@focus="clearErrors('slug')"
|
||||
:disabled="isUpdatingSlug"
|
||||
:loading="isUpdatingSlug"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Comment Status ------------------------ -->
|
||||
|
@ -458,6 +460,97 @@
|
|||
:message="$i18n.getHelperMessage('collections', 'allow_comments')"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Allows Submissions ------------------------ -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.getHelperTitle('collections', 'allows_submission')"
|
||||
:type="editFormErrors['allows_submission'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['allows_submission'] != undefined ? editFormErrors['allows_submission'] : ''">
|
||||
|
||||
<b-switch
|
||||
id="tainacan-checkbox-allow-submission"
|
||||
size="is-small"
|
||||
true-value="yes"
|
||||
false-value="no"
|
||||
v-model="form.allows_submission" />
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'allows_submission')"
|
||||
:message="$i18n.getHelperMessage('collections', 'allows_submission')"/>
|
||||
</b-field>
|
||||
|
||||
<transition name="filter-item">
|
||||
<div
|
||||
v-if="form.allows_submission === 'yes'"
|
||||
class="item-submission-options">
|
||||
|
||||
<!-- Allows Submissions by anonynmous user ------------------------ -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.getHelperTitle('collections', 'submission_anonymous_user')"
|
||||
:type="editFormErrors['submission_anonymous_user'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['submission_anonymous_user'] != undefined ? editFormErrors['submission_anonymous_user'] : ''">
|
||||
|
||||
<b-switch
|
||||
id="tainacan-checkbox-allow-submission"
|
||||
size="is-small"
|
||||
true-value="yes"
|
||||
false-value="no"
|
||||
v-model="form.submission_anonymous_user" />
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'submission_anonymous_user')"
|
||||
:message="$i18n.getHelperMessage('collections', 'submission_anonymous_user')"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Item submission default Status -------------------------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.getHelperTitle('collections', 'submission_default_status')"
|
||||
:type="editFormErrors['submission_default_status'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['submission_default_status'] != undefined ? editFormErrors['submission_default_status'] : ''">
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'submission_default_status')"
|
||||
:message="$i18n.getHelperMessage('collections', 'submission_default_status')"/>
|
||||
<div class="status-radios">
|
||||
<b-radio
|
||||
v-model="form.submission_default_status"
|
||||
v-for="(statusOption, index) of $statusHelper.getStatuses().filter((status) => status.slug != 'trash')"
|
||||
:key="index"
|
||||
:native-value="statusOption.slug">
|
||||
<span class="icon has-text-gray">
|
||||
<i
|
||||
class="tainacan-icon tainacan-icon-18px"
|
||||
:class="$statusHelper.getIcon(statusOption.slug)"/>
|
||||
</span>
|
||||
{{ statusOption.name }}
|
||||
</b-radio>
|
||||
</div>
|
||||
</b-field>
|
||||
|
||||
<!-- Submission process uses reCAPTCHA ------------------------ -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.getHelperTitle('collections', 'submission_use_recaptcha')"
|
||||
:type="editFormErrors['submission_use_recaptcha'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['submission_use_recaptcha'] != undefined ? editFormErrors['submission_use_recaptcha'] : ''">
|
||||
|
||||
<b-switch
|
||||
id="tainacan-checkbox-submission-use-recaptcha"
|
||||
size="is-small"
|
||||
true-value="yes"
|
||||
false-value="no"
|
||||
v-model="form.submission_use_recaptcha" />
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'submission_use_recaptcha')"
|
||||
:message="$i18n.getHelperMessage('collections', 'submission_use_recaptcha')"/>
|
||||
<p
|
||||
v-if="form.submission_use_recaptcha == 'yes'"
|
||||
v-html="$i18n.getWithVariables('info_recaptcha_link_%s', [ reCAPTCHASettingsPagePath ])" />
|
||||
</b-field>
|
||||
|
||||
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
<template
|
||||
v-if="formHooks != undefined &&
|
||||
|
@ -486,14 +579,14 @@
|
|||
style="margin-left: auto;"
|
||||
class="control">
|
||||
<button
|
||||
v-if="isNewCollection && $userCaps.hasCapability('tnc_rep_edit_metadata')"
|
||||
v-if="isNewCollection && $userCaps.hasCapability('tnc_rep_edit_metadata') && !fromImporter"
|
||||
id="button-submit-goto-metadata"
|
||||
@click.prevent="onSubmit('metadata')"
|
||||
class="button is-secondary">{{ $i18n.get('label_save_goto_metadata') }}</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
v-if="isNewCollection && $userCaps.hasCapability('tnc_rep_edit_metadata')"
|
||||
v-if="isNewCollection && $userCaps.hasCapability('tnc_rep_edit_metadata') && !fromImporter"
|
||||
id="button-submit-goto-filter"
|
||||
@click.prevent="onSubmit('filters')"
|
||||
class="button is-secondary">{{ $i18n.get('label_save_goto_filter') }}</button>
|
||||
|
@ -556,7 +649,11 @@ export default {
|
|||
enabled_view_modes: [],
|
||||
default_view_mode: [],
|
||||
allow_comments: '',
|
||||
hide_items_thumbnail_on_lists: ''
|
||||
allows_submission: 'no',
|
||||
submission_default_status: 'draft',
|
||||
submission_anonymous_user: 'no',
|
||||
hide_items_thumbnail_on_lists: '',
|
||||
submission_use_recaptcha: 'no'
|
||||
},
|
||||
thumbnail: {},
|
||||
cover: {},
|
||||
|
@ -581,6 +678,7 @@ export default {
|
|||
viewModesList: [],
|
||||
fromImporter: '',
|
||||
registeredViewModes: tainacan_plugin.registered_view_modes,
|
||||
reCAPTCHASettingsPagePath: tainacan_plugin.admin_url + 'admin.php?page=tainacan_item_submission',
|
||||
newPagePath: tainacan_plugin.admin_url + 'post-new.php?post_type=page',
|
||||
isUpdatingSlug: false,
|
||||
entityName: 'collection'
|
||||
|
@ -650,6 +748,10 @@ export default {
|
|||
this.form.default_view_mode = this.collection.default_view_mode;
|
||||
this.form.enabled_view_modes = JSON.parse(JSON.stringify(this.collection.enabled_view_modes.reduce((result, viewMode) => { typeof viewMode == 'string' ? result.push(viewMode) : null; return result }, [])));
|
||||
this.form.allow_comments = this.collection.allow_comments;
|
||||
this.form.allows_submission = this.collection.allows_submission;
|
||||
this.form.submission_anonymous_user = this.collection.submission_anonymous_user;
|
||||
this.form.submission_default_status = this.collection.submission_default_status;
|
||||
this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha;
|
||||
this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists;
|
||||
|
||||
// Generates CoverPage from current cover_page_id info
|
||||
|
@ -731,7 +833,7 @@ export default {
|
|||
|
||||
this.isUpdatingSlug = false;
|
||||
});
|
||||
}, 500),
|
||||
}, 1000),
|
||||
onSubmit(goTo) {
|
||||
|
||||
this.isLoading = true;
|
||||
|
@ -747,6 +849,10 @@ export default {
|
|||
parent: this.form.parent,
|
||||
enabled_view_modes: this.form.enabled_view_modes,
|
||||
default_view_mode: this.form.default_view_mode,
|
||||
allows_submission: this.form.allows_submission,
|
||||
submission_anonymous_user: this.form.submission_anonymous_user,
|
||||
submission_default_status: this.form.submission_default_status,
|
||||
submission_use_recaptcha: this.form.submission_use_recaptcha,
|
||||
allow_comments: this.form.allow_comments,
|
||||
hide_items_thumbnail_on_lists: this.form.hide_items_thumbnail_on_lists
|
||||
};
|
||||
|
@ -770,15 +876,19 @@ export default {
|
|||
this.form.enabled_view_modes = this.collection.enabled_view_modes.map((viewMode) => viewMode.viewMode);
|
||||
this.form.default_view_mode = this.collection.default_view_mode;
|
||||
this.form.allow_comments = this.collection.allow_comments;
|
||||
this.form.allows_submission = this.collection.allows_submission;
|
||||
this.form.submission_anonymous_user = this.collection.submission_anonymous_user;
|
||||
this.form.submission_default_status = this.collection.submission_default_status;
|
||||
this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha;
|
||||
this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists;
|
||||
|
||||
this.isLoading = false;
|
||||
this.formErrorMessage = '';
|
||||
this.editFormErrors = {};
|
||||
|
||||
if (this.fromImporter)
|
||||
if (this.fromImporter) {
|
||||
this.$router.go(-1);
|
||||
else {
|
||||
} else {
|
||||
if (goTo == 'metadata')
|
||||
this.$router.push(this.$routerHelper.getCollectionMetadataPath(this.collectionId));
|
||||
else if (goTo == 'filters')
|
||||
|
@ -824,6 +934,10 @@ export default {
|
|||
this.form.default_view_mode = this.collection.default_view_mode;
|
||||
this.form.enabled_view_modes = [];
|
||||
this.form.allow_comments = this.collection.allow_comments;
|
||||
this.form.allows_submission = this.collection.allows_submission;
|
||||
this.form.submission_anonymous_user = this.collection.submission_anonymous_user;
|
||||
this.form.submission_default_status = this.collection.submission_default_status;
|
||||
this.form.submission_use_recaptcha = this.collection.submission_use_recaptcha;
|
||||
this.form.hide_items_thumbnail_on_lists = this.collection.hide_items_thumbnail_on_lists;
|
||||
|
||||
// Pre-fill status with publish to incentivate it
|
||||
|
@ -1129,6 +1243,12 @@ export default {
|
|||
align-items: center;
|
||||
}
|
||||
}
|
||||
.item-submission-options {
|
||||
padding-left: 1em;
|
||||
padding-top: 1.25em;
|
||||
margin-top: -1.5em;
|
||||
border-left: 1px solid var(--tainacan-gray2);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
|
|
@ -80,6 +80,11 @@
|
|||
:value="'create_metadata' + index">
|
||||
{{ $i18n.get('label_create_metadatum') }}
|
||||
</option>
|
||||
<option
|
||||
v-if="collection && collection.current_user_can_edit_metadata"
|
||||
:value="'create_repository_metadata' + index">
|
||||
{{ $i18n.get('label_create_repository_metadata') }}
|
||||
</option>
|
||||
<option
|
||||
v-for="(collectionMetadatum, metadatumIndex) of collectionMetadata"
|
||||
:key="metadatumIndex"
|
||||
|
|
|
@ -351,6 +351,20 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="form.thumbnail_id"
|
||||
class="thumbnail-alt-input">
|
||||
<label class="label">{{ $i18n.get('label_thumbnail_alt') }}</label>
|
||||
<help-button
|
||||
:title="$i18n.get('label_thumbnail_alt')"
|
||||
:message="$i18n.get('info_thumbnail_alt')"/>
|
||||
<b-input
|
||||
type="textarea"
|
||||
lazy
|
||||
:placeholder="$i18n.get('instruction_thumbnail_alt')"
|
||||
:value="form.thumbnail_alt ? form.thumbnail_alt : ''"
|
||||
@input="onUpdateThumbnailAlt" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
|
@ -485,6 +499,7 @@
|
|||
:key="index"
|
||||
:item-metadatum="itemMetadatum"
|
||||
:is-collapsed="metadataCollapses[index]"
|
||||
:is-last-metadatum="index > 2 && (index == metadatumList.length - 1)"
|
||||
@changeCollapse="onChangeCollapse($event, index)"/>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
|
@ -516,25 +531,20 @@
|
|||
</template>
|
||||
|
||||
<div v-if="item != undefined && item.id != undefined">
|
||||
<br>
|
||||
<button
|
||||
style="margin-left: calc(var(--tainacan-one-column) + 12px)"
|
||||
type="button"
|
||||
class="button is-secondary"
|
||||
@click.prevent="attachmentMediaFrame.openFrame($event)"
|
||||
:disabled="isLoadingAttachments">
|
||||
{{ $i18n.get("label_edit_attachments") }}
|
||||
</button>
|
||||
<!--
|
||||
<button
|
||||
style="margin-left: calc(var(--tainacan-one-column) + 12px)"
|
||||
type="button"
|
||||
class="button is-secondary"
|
||||
@click.prevent="openNewAttachmentsMediaFrame"
|
||||
:disabled="isLoadingAttachments">
|
||||
{{ $i18n.get("label_edit_attachments") + ' 2' }}
|
||||
</button>
|
||||
-->
|
||||
<div class="attachments-list-heading">
|
||||
<button
|
||||
style="margin-left: calc(var(--tainacan-one-column) + 12px)"
|
||||
type="button"
|
||||
class="button is-secondary"
|
||||
@click.prevent="attachmentMediaFrame.openFrame($event)"
|
||||
:disabled="isLoadingAttachments">
|
||||
{{ $i18n.get("label_edit_attachments") }}
|
||||
</button>
|
||||
<p>
|
||||
{{ $i18n.get("info_edit_attachments") }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<attachments-list
|
||||
v-if="item != undefined && item.id != undefined"
|
||||
:item="item"
|
||||
|
@ -819,7 +829,9 @@ export default {
|
|||
status: '',
|
||||
document: '',
|
||||
document_type: '',
|
||||
comment_status: ''
|
||||
comment_status: '',
|
||||
thumbnail_id: '',
|
||||
thumbnail_alt: ''
|
||||
},
|
||||
thumbnail: {},
|
||||
formErrorMessage: '',
|
||||
|
@ -987,6 +999,7 @@ export default {
|
|||
'sendItem',
|
||||
'updateItem',
|
||||
'updateItemDocument',
|
||||
'updateThumbnailAlt',
|
||||
'fetchItemMetadata',
|
||||
'fetchItem',
|
||||
'cleanItemMetadata',
|
||||
|
@ -1053,6 +1066,8 @@ export default {
|
|||
this.form.document = this.item.document;
|
||||
this.form.document_type = this.item.document_type;
|
||||
this.form.comment_status = this.item.comment_status;
|
||||
this.form.thumbnail_id = this.item.thumbnail_id;
|
||||
this.form.thumbnail_alt = this.item.thumbnail_alt;
|
||||
|
||||
this.isLoading = false;
|
||||
|
||||
|
@ -1151,6 +1166,8 @@ export default {
|
|||
this.form.document = this.item.document;
|
||||
this.form.document_type = this.item.document_type;
|
||||
this.form.comment_status = this.item.comment_status;
|
||||
this.form.thumbnail_id = this.item.thumbnail_id;
|
||||
this.form.thumbnail_alt = this.item.thumbnail_alt;
|
||||
|
||||
// If a parameter was passed with a suggestion of item title, also send a patch to item metadata
|
||||
if (this.$route.query.newitemtitle) {
|
||||
|
@ -1279,7 +1296,13 @@ export default {
|
|||
})
|
||||
.then(() => {
|
||||
this.isLoadingAttachments = true;
|
||||
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document })
|
||||
this.fetchAttachments({
|
||||
page: 1,
|
||||
attachmentsPerPage: 24,
|
||||
itemId: this.itemId,
|
||||
documentId: this.form.document,
|
||||
thumbnailId: this.form.thumbnail_id
|
||||
})
|
||||
.then(() => this.isLoadingAttachments = false)
|
||||
.catch(() => this.isLoadingAttachments = false);
|
||||
})
|
||||
|
@ -1296,9 +1319,10 @@ export default {
|
|||
});
|
||||
},
|
||||
deleteThumbnail() {
|
||||
this.updateThumbnail({itemId: this.itemId, thumbnailId: 0})
|
||||
this.updateThumbnail({ itemId: this.itemId, thumbnailId: 0 })
|
||||
.then(() => {
|
||||
this.item.thumbnail = false;
|
||||
this.item.thumbnail_id = null;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$console.error(error);
|
||||
|
@ -1317,7 +1341,13 @@ export default {
|
|||
.then(() => {
|
||||
this.isLoadingAttachments = true;
|
||||
|
||||
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document })
|
||||
this.fetchAttachments({
|
||||
page: 1,
|
||||
attachmentsPerPage: 24,
|
||||
itemId: this.itemId,
|
||||
documentId: this.form.document,
|
||||
thumbnailId: this.form.thumbnail_id
|
||||
})
|
||||
.then(() => this.isLoadingAttachments = false)
|
||||
.catch(() => this.isLoadingAttachments = false);
|
||||
})
|
||||
|
@ -1343,6 +1373,7 @@ export default {
|
|||
this.isLoading = true;
|
||||
this.form.document_type = 'attachment';
|
||||
this.form.document = file.id + '';
|
||||
|
||||
this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type })
|
||||
.then((item) => {
|
||||
this.isLoading = false;
|
||||
|
@ -1371,29 +1402,42 @@ export default {
|
|||
button_labels: {
|
||||
frame_title: this.$i18n.get('instruction_select_item_thumbnail'),
|
||||
},
|
||||
thumbnail: this.form.thumbnail_id,
|
||||
relatedPostId: this.itemId,
|
||||
onSave: (media) => {
|
||||
this.updateThumbnail({itemId: this.itemId, thumbnailId: media.id})
|
||||
.then((res) => {
|
||||
this.item.thumbnail = res.thumbnail;
|
||||
})
|
||||
.catch(error => this.$console.error(error));
|
||||
this.updateThumbnail({ itemId: this.itemId, thumbnailId: media.id})
|
||||
.then((res) => {
|
||||
this.item.thumbnail = res.thumbnail;
|
||||
this.item.thumbnail_id = res.thumbnail_id;
|
||||
this.item.thumbnail_alt = res.thumbnail_alt;
|
||||
this.form.thumbnail = res.thumbnail;
|
||||
this.form.thumbnail_id = res.thumbnail_id;
|
||||
this.form.thumbnail_alt = res.thumbnail_alt;
|
||||
})
|
||||
.catch(error => this.$console.error(error));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.attachmentMediaFrame = new wpMediaFrames.attachmentControl(
|
||||
'my-attachment-media-frame', {
|
||||
button_labels: {
|
||||
frame_title: this.$i18n.get('instruction_select_files_to_attach_to_item'),
|
||||
frame_button: this.$i18n.get('label_attach_to_item'),
|
||||
},
|
||||
nonce: this.item.nonces ? this.item.nonces['update-post_' + this.item.id] : null,
|
||||
relatedPostId: this.itemId,
|
||||
document: this.item.document,
|
||||
document: this.form.document_type == 'attachment' ? this.form.document : null,
|
||||
thumbnailId: this.form.thumbnail_id ? this.form.thumbnail_id : null,
|
||||
onSave: () => {
|
||||
// Fetch current existing attachments
|
||||
this.isLoadingAttachments = true;
|
||||
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document })
|
||||
this.fetchAttachments({
|
||||
page: 1,
|
||||
attachmentsPerPage: 24,
|
||||
itemId: this.itemId,
|
||||
documentId: this.form.document,
|
||||
thumbnailId: this.form.thumbnail_id
|
||||
})
|
||||
.then(() => this.isLoadingAttachments = false)
|
||||
.catch(() => this.isLoadingAttachments = false);
|
||||
}
|
||||
|
@ -1401,27 +1445,15 @@ export default {
|
|||
);
|
||||
|
||||
},
|
||||
// openNewAttachmentsMediaFrame() {
|
||||
// const newAttachmentMediaFrame = new wpMediaFrames.customAttachmentsControl({
|
||||
// existingAttachments: this.getAttachments().map((attachment) => attachment.id),
|
||||
// button_labels: {
|
||||
// frame_title: this.$i18n.get('instruction_select_files_to_attach_to_item'),
|
||||
// frame_button_new: this.$i18n.get('label_attach_to_item'),
|
||||
// frame_button_update: this.$i18n.get('finish')
|
||||
// },
|
||||
// relatedPostId: this.itemId,
|
||||
// onSelect: (selected) => {
|
||||
// console.log(selected);
|
||||
// // Fetch current existing attachments
|
||||
// this.isLoadingAttachments = true;
|
||||
// this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document })
|
||||
// .then(() => this.isLoadingAttachments = false)
|
||||
// .catch(() => this.isLoadingAttachments = false);
|
||||
|
||||
// }
|
||||
// });
|
||||
// setTimeout(() => newAttachmentMediaFrame.openModal(), 1000);
|
||||
// },
|
||||
onUpdateThumbnailAlt(updatedThumbnailAlt) {
|
||||
|
||||
this.updateThumbnailAlt({ thumbnailId: this.item.thumbnail_id, thumbnailAlt: updatedThumbnailAlt })
|
||||
.then((res) => {
|
||||
this.form.thumbnail_id = res.thumbnail_id;
|
||||
this.form.thumbnail_alt = res.thumbnail_alt;
|
||||
})
|
||||
.catch(error => this.$console.error(error));
|
||||
},
|
||||
toggleCollapseAll() {
|
||||
this.collapseAll = !this.collapseAll;
|
||||
|
||||
|
@ -1494,6 +1526,8 @@ export default {
|
|||
this.form.document = this.item.document;
|
||||
this.form.document_type = this.item.document_type;
|
||||
this.form.comment_status = this.item.comment_status;
|
||||
this.form.thumbnail_id = this.item.thumbnail_id;
|
||||
this.form.thumbnail_alt = this.item.thumbnail_alt;
|
||||
|
||||
if (this.form.document_type != undefined && this.form.document_type == 'url')
|
||||
this.urlLink = this.form.document;
|
||||
|
@ -1507,7 +1541,12 @@ export default {
|
|||
this.setLastUpdated(this.item.modification_date);
|
||||
|
||||
// Fetch current existing attachments now that item.document
|
||||
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document });
|
||||
this.fetchAttachments({
|
||||
page: 1,
|
||||
attachmentsPerPage: 24,
|
||||
itemId: this.itemId,
|
||||
documentId: this.form.document,
|
||||
thumbnailId: this.form.thumbnail_id });
|
||||
|
||||
// Initializes Media Frames now that itemId and item.document exists
|
||||
this.initializeMediaFrames();
|
||||
|
@ -1571,7 +1610,7 @@ export default {
|
|||
}
|
||||
.status-tag {
|
||||
color: var(--tainacan-white);
|
||||
background: var(--tainacan-turquoise5);
|
||||
background: var(--tainacan-secondary);
|
||||
padding: 0.15em 0.5em;
|
||||
font-size: 0.75em;
|
||||
margin: 0 1em 0 0;
|
||||
|
@ -1637,7 +1676,7 @@ export default {
|
|||
label {
|
||||
font-size: 1em !important;
|
||||
font-weight: 500 !important;
|
||||
color: var(--tainacan-gray5) !important;
|
||||
color: var(--tainacan-label-color) !important;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
}
|
||||
|
@ -1669,7 +1708,7 @@ export default {
|
|||
color: var(--tainacan-secondary);
|
||||
margin-bottom: 6px;
|
||||
&:hover {
|
||||
background-color: var(--tainacan-turquoise2);
|
||||
background-color: var(--tainacan-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
@ -1699,6 +1738,9 @@ export default {
|
|||
}
|
||||
|
||||
.document-field {
|
||||
/deep/ iframe {
|
||||
max-width: 100%;
|
||||
}
|
||||
.document-buttons-row {
|
||||
text-align: right;
|
||||
top: -21px;
|
||||
|
@ -1757,6 +1799,27 @@ export default {
|
|||
left: 90px;
|
||||
bottom: 1.0em;
|
||||
}
|
||||
|
||||
.thumbnail-alt-input {
|
||||
.label {
|
||||
font-size: 0.875em;
|
||||
font-weight: 500;
|
||||
margin-left: 15px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0.15em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.attachments-list-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
button {
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
|
@ -1808,7 +1871,7 @@ export default {
|
|||
|
||||
.sequence-progress {
|
||||
height: 5px;
|
||||
background: var(--tainacan-turquoise5);
|
||||
background: var(--tainacan-secondary);
|
||||
width: 0%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
@ -1826,7 +1889,7 @@ export default {
|
|||
|
||||
.sequence-button {
|
||||
background-color: transparent;
|
||||
color: var(--tainacan-turquoise5);
|
||||
color: var(--tainacan-secondary);
|
||||
border: none;
|
||||
|
||||
.icon {
|
||||
|
@ -1837,7 +1900,7 @@ export default {
|
|||
&:focus,
|
||||
&:active {
|
||||
background-color: transparent !important;
|
||||
color: var(--tainacan-turquoise5) !important;
|
||||
color: var(--tainacan-secondary) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,6 +209,24 @@
|
|||
:message="$i18n.getHelperMessage('metadata', 'collection_key')"/>
|
||||
</b-checkbox>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
v-if="!isRepositoryLevel && isOnModal"
|
||||
>
|
||||
<b-checkbox
|
||||
class="is-inline-block"
|
||||
v-model="editForm.repository_level"
|
||||
@input="clearErrors('repository_level')"
|
||||
name="repository_level"
|
||||
true-value="yes"
|
||||
false-value="no"
|
||||
>
|
||||
{{ $i18n.get('label_repository_metadata') }}
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('metadata', 'repository_level')"
|
||||
:message="$i18n.getHelperMessage('metadata', 'repository_level')"/>
|
||||
</b-checkbox>
|
||||
</b-field>
|
||||
</b-field>
|
||||
|
||||
<component
|
||||
|
@ -282,13 +300,10 @@
|
|||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
this.editForm = this.editedMetadatum;
|
||||
this.formErrors = this.editForm.formErrors != undefined ? this.editForm.formErrors : {};
|
||||
this.formErrorMessage = this.editForm.formErrors != undefined ? this.editForm.formErrorMessage : '';
|
||||
|
||||
this.oldForm = JSON.parse(JSON.stringify(this.originalMetadatum));
|
||||
|
||||
},
|
||||
mounted() {
|
||||
// Fills hook forms with it's real values
|
||||
|
@ -312,10 +327,13 @@
|
|||
...mapActions('metadata', [
|
||||
'updateMetadatum'
|
||||
]),
|
||||
saveEdition(metadatum) {
|
||||
saveEdition(metadatum) {
|
||||
if ((metadatum.metadata_type_object && metadatum.metadata_type_object.form_component) || metadatum.edit_form == '') {
|
||||
let repository = this.editForm.repository_level;
|
||||
if (repository && repository === 'yes') {
|
||||
this.isRepositoryLevel = true;
|
||||
}
|
||||
|
||||
if ((metadatum.metadata_type_object && metadatum.metadata_type_object.form_component) || metadatum.edit_form == '') {
|
||||
|
||||
this.fillExtraFormData(this.editForm);
|
||||
this.isUpdating = true;
|
||||
this.updateMetadatum({
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
:addons="false"
|
||||
:label="$i18n.get('label_name')"
|
||||
:type="editFormErrors['name'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['name'] != undefined ? editFormErrors['name'] : ''">
|
||||
:message="isUpdatingSlug ? $i18n.get('info_validating_slug') : (editFormErrors['name'] != undefined ? editFormErrors['name'] : '')">
|
||||
<span class="required-metadatum-asterisk">*</span>
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('taxonomies', 'name')"
|
||||
|
@ -30,7 +30,9 @@
|
|||
id="tainacan-text-name"
|
||||
v-model="form.name"
|
||||
@focus="clearErrors('name')"
|
||||
@blur="updateSlug()"/>
|
||||
@blur="updateSlug()"
|
||||
:disabled="isUpdatingSlug"
|
||||
:loading="isUpdatingSlug"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
|
|
|
@ -575,6 +575,7 @@
|
|||
z-index: 99;
|
||||
text-align: center;
|
||||
color: var(--tainacan-info-color);
|
||||
background-color: transparent;
|
||||
}
|
||||
#button-delete-header,
|
||||
#button-edit-header {
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
if (this.getOptionsValuesCancel != undefined)
|
||||
this.getOptionsValuesCancel.cancel('Facet search Canceled.');
|
||||
|
||||
if ( this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' )
|
||||
if ( this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' || this.metadatumType === 'Tainacan\\Metadata_Types\\Control' )
|
||||
promise = this.getValuesRelationship( null, this.isRepositoryLevel, [], 0, this.filter.max_options, false, '1');
|
||||
else
|
||||
promise = this.getValuesPlainText( this.metadatumId, null, this.isRepositoryLevel, [], 0, this.filter.max_options, false, '1' );
|
||||
|
@ -133,6 +133,7 @@
|
|||
});
|
||||
},
|
||||
updateSelectedValues() {
|
||||
|
||||
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
|
||||
return false;
|
||||
|
||||
|
@ -144,7 +145,7 @@
|
|||
} else {
|
||||
this.selected = [];
|
||||
}
|
||||
|
||||
|
||||
let onlyLabels = [];
|
||||
if (!isNaN(this.selected[0])){
|
||||
for (let aSelected of this.selected) {
|
||||
|
|
|
@ -10,7 +10,7 @@ class Checkbox extends Filter_Type {
|
|||
|
||||
function __construct(){
|
||||
$this->set_name( __('Checkbox List', 'tainacan') );
|
||||
$this->set_supported_types(['string','long_string','item']);
|
||||
$this->set_supported_types(['string','long_string','item', 'control']);
|
||||
$this->set_component('tainacan-filter-checkbox');
|
||||
$this->set_preview_template('
|
||||
<div>
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
cursor: pointer;
|
||||
outline: none;
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -157,10 +157,10 @@
|
|||
if (this.isRepositoryLevel)
|
||||
route = `/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
|
||||
else {
|
||||
if ((this.collectionId == 'default' || this.filter.inherited) && this.currentCollectionId)
|
||||
if (this.filter.collection_id == 'default' && this.currentCollectionId)
|
||||
route = `/collection/${this.currentCollectionId}/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
|
||||
else
|
||||
route = `/collection/${this.collectionId}/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
|
||||
route = `/collection/${this.filter.collection_id}/facets/${this.metadatumId}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
|
||||
}
|
||||
|
||||
this.options = [];
|
||||
|
|
|
@ -117,10 +117,10 @@
|
|||
if (this.isRepositoryLevel)
|
||||
endpoint += '/facets/' + this.metadatumId;
|
||||
else {
|
||||
if (this.collectionId == 'default' && this.currentCollection)
|
||||
if (this.filter.collection_id == 'default' && this.currentCollectionId)
|
||||
endpoint += '/collection/' + this.currentCollectionId +'/facets/' + this.metadatumId;
|
||||
else
|
||||
endpoint += '/collection/' + this.collectionId +'/facets/' + this.metadatumId;
|
||||
endpoint += '/collection/' + this.filter.collection_id + '/facets/' + this.metadatumId;
|
||||
}
|
||||
|
||||
endpoint += '?order=asc&' + qs.stringify(query_items);
|
||||
|
|
|
@ -165,7 +165,8 @@
|
|||
page: this.attachmentsPage,
|
||||
attachmentsPerPage: this.attachmentsPerPage,
|
||||
itemId: this.item.id,
|
||||
documentId: this.item.document
|
||||
documentId: this.item.document,
|
||||
thumbnailId: this.item.thumbnail_id
|
||||
})
|
||||
.then((response) => {
|
||||
this.isLoading = false;
|
||||
|
@ -189,7 +190,6 @@
|
|||
|
||||
.uploaded-files {
|
||||
display: block;
|
||||
text-align: center;
|
||||
|
||||
.file-item-container {
|
||||
display: inline-block;
|
||||
|
|
|
@ -177,19 +177,19 @@
|
|||
@click.left="onClickCollection($event, collection.id, index)"
|
||||
@click.right="onRightClickCollection($event, collection.id, index)"
|
||||
:label="$i18n.get('label_description')"
|
||||
:aria-label="$i18n.get('label_description') + ': ' + (collection.description != undefined && collection.description != '') ? collection.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`">
|
||||
:aria-label="$i18n.get('label_description') + ': ' + (collection.description != undefined && collection.description != '') ? collection.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`">
|
||||
<p
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
},
|
||||
content: (collection.description != undefined && collection.description != '') ? collection.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`,
|
||||
content: (collection.description != undefined && collection.description != '') ? collection.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`,
|
||||
autoHide: false,
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-html="(collection.description != undefined && collection.description != '') ? collection.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`"/>
|
||||
v-html="(collection.description != undefined && collection.description != '') ? collection.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`"/>
|
||||
</td>
|
||||
<!-- Creation Date -->
|
||||
<td
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
</b-checkbox>
|
||||
</span>
|
||||
</div>
|
||||
<pre>{{ firstSelectedIndex }}</pre>
|
||||
<div class="field">
|
||||
<b-dropdown
|
||||
:mobile-modal="true"
|
||||
|
@ -63,7 +62,7 @@
|
|||
</b-dropdown-item>
|
||||
<b-dropdown-item
|
||||
v-if="collectionId && isOnTrash"
|
||||
@click="untrashSelectedItems()"
|
||||
@click="untrashSelectedItems();"
|
||||
aria-role="listitem">
|
||||
{{ $i18n.get('label_untrash_selected_items') }}
|
||||
</b-dropdown-item>
|
||||
|
@ -135,6 +134,7 @@
|
|||
<div
|
||||
role="listitem"
|
||||
:key="index"
|
||||
:data-tainacan-item-id="item.id"
|
||||
v-for="(item, index) of items"
|
||||
:class="{ 'selected-grid-item': getSelectedItemChecked(item.id) == true }"
|
||||
class="tainacan-grid-item">
|
||||
|
@ -179,7 +179,7 @@
|
|||
class="grid-item-thumbnail"
|
||||
:style="{ backgroundImage: 'url(' + (item['thumbnail']['tainacan-medium'] ? item['thumbnail']['tainacan-medium'][0] : (item['thumbnail'].medium ? item['thumbnail'].medium[0] : thumbPlaceholderPath)) + ')' }">
|
||||
<img
|
||||
:alt="$i18n.get('label_thumbnail')"
|
||||
:alt="item.thumbnail_alt ? item.thumbnail_alt : $i18n.get('label_thumbnail')"
|
||||
:src="item['thumbnail']['tainacan-medium'] ? item['thumbnail']['tainacan-medium'][0] : (item['thumbnail'].medium ? item['thumbnail'].medium[0] : thumbPlaceholderPath)">
|
||||
</a>
|
||||
|
||||
|
@ -249,6 +249,7 @@
|
|||
<div
|
||||
role="listitem"
|
||||
:key="index"
|
||||
:data-tainacan-item-id="item.id"
|
||||
v-for="(item, index) of items"
|
||||
:class="{
|
||||
'selected-masonry-item': getSelectedItemChecked(item.id) == true,
|
||||
|
@ -292,7 +293,7 @@
|
|||
class="tainacan-masonry-item-thumbnail"
|
||||
:style="{ backgroundImage: 'url(' + (item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][0] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[0] : thumbPlaceholderPath)) + ')' }">
|
||||
<img
|
||||
:alt="$i18n.get('label_thumbnail')"
|
||||
:alt="item.thumbnail_alt ? item.thumbnail_alt : $i18n.get('label_thumbnail')"
|
||||
:src="item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][0] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[0] : thumbPlaceholderPath)">
|
||||
</div>
|
||||
|
||||
|
@ -359,6 +360,7 @@
|
|||
<div
|
||||
role="listitem"
|
||||
:key="index"
|
||||
:data-tainacan-item-id="item.id"
|
||||
v-for="(item, index) of items"
|
||||
:class="{ 'selected-card': getSelectedItemChecked(item.id) == true }"
|
||||
class="tainacan-card">
|
||||
|
@ -460,7 +462,7 @@
|
|||
:style="{ backgroundImage: 'url(' + (item['thumbnail']['tainacan-medium'] ? item['thumbnail']['tainacan-medium'][0] : (item['thumbnail'].medium ? item['thumbnail'].medium[0] : thumbPlaceholderPath)) + ')' }"
|
||||
class="card-thumbnail">
|
||||
<img
|
||||
:alt="$i18n.get('label_thumbnail')"
|
||||
:alt="item.thumbnail_alt ? item.thumbnail_alt : $i18n.get('label_thumbnail')"
|
||||
v-if="item.thumbnail != undefined"
|
||||
:src="item['thumbnail']['tainacan-medium'] ? item['thumbnail']['tainacan-medium'][0] : (item['thumbnail'].medium ? item['thumbnail'].medium[0] : thumbPlaceholderPath)">
|
||||
</div>
|
||||
|
@ -473,13 +475,13 @@
|
|||
show: 500,
|
||||
hide: 300,
|
||||
},
|
||||
content: item.description != undefined && item.description != '' ? item.description : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`,
|
||||
content: item.description != undefined && item.description != '' ? item.description : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`,
|
||||
html: true,
|
||||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
class="metadata-description"
|
||||
v-html="item.description != undefined && item.description != '' ? getLimitedDescription(item.description) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`" />
|
||||
v-html="item.description != undefined && item.description != '' ? getLimitedDescription(item.description) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`" />
|
||||
<!-- Author-->
|
||||
<p
|
||||
v-tooltip="{
|
||||
|
@ -526,6 +528,7 @@
|
|||
<div
|
||||
role="listitem"
|
||||
:key="index"
|
||||
:data-tainacan-item-id="item.id"
|
||||
v-for="(item, index) of items"
|
||||
:class="{ 'selected-record': getSelectedItemChecked(item.id) == true }"
|
||||
class="tainacan-record">
|
||||
|
@ -651,7 +654,7 @@
|
|||
<div class="list-metadata media-body">
|
||||
<div class="tainacan-record-thumbnail">
|
||||
<img
|
||||
:alt="$i18n.get('label_thumbnail')"
|
||||
:alt="item.thumbnail_alt ? item.thumbnail_alt : $i18n.get('label_thumbnail')"
|
||||
v-if="item.thumbnail != undefined"
|
||||
:src="item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][0] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[0] : thumbPlaceholderPath)">
|
||||
</div>
|
||||
|
@ -736,6 +739,7 @@
|
|||
'highlighted-item': highlightedItem == item.id
|
||||
}"
|
||||
:key="index"
|
||||
:data-tainacan-item-id="item.id"
|
||||
v-for="(item, index) of items">
|
||||
<!-- Checking list -->
|
||||
<!-- TODO: Remove v-if="collectionId" from this element when the bulk edit in repository is done -->
|
||||
|
@ -777,7 +781,7 @@
|
|||
show: 500,
|
||||
hide: 300,
|
||||
},
|
||||
content: item.title != undefined && item.title != '' ? item.title : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`,
|
||||
content: item.title != undefined && item.title != '' ? item.title : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`,
|
||||
html: true,
|
||||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
|
@ -785,14 +789,14 @@
|
|||
v-if="collectionId == undefined &&
|
||||
column.metadata_type_object != undefined &&
|
||||
column.metadata_type_object.related_mapped_prop == 'title'"
|
||||
v-html="`<span class='sr-only'>` + column.name + ': </span>' + ((item.title != undefined && item.title != '') ? item.title : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`)"/>
|
||||
v-html="`<span class='sr-only'>` + column.name + ': </span>' + ((item.title != undefined && item.title != '') ? item.title : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)"/>
|
||||
<p
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
},
|
||||
content: item.description != undefined && item.description != '' ? item.description : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`,
|
||||
content: item.description != undefined && item.description != '' ? item.description : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`,
|
||||
html: true,
|
||||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
|
@ -800,7 +804,7 @@
|
|||
v-if="collectionId == undefined &&
|
||||
column.metadata_type_object != undefined &&
|
||||
column.metadata_type_object.related_mapped_prop == 'description'"
|
||||
v-html="`<span class='sr-only'>` + column.name + ': </span>' + ((item.description != undefined && item.description) != '' ? item.description : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`)"/>
|
||||
v-html="`<span class='sr-only'>` + column.name + ': </span>' + ((item.description != undefined && item.description) != '' ? item.description : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)"/>
|
||||
<p
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
|
@ -808,7 +812,7 @@
|
|||
hide: 300,
|
||||
},
|
||||
classes: [ column.metadata_type_object != undefined && column.metadata_type_object.component == 'tainacan-textarea' ? 'metadata-type-textarea' : '' ],
|
||||
content: renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`,
|
||||
content: renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`,
|
||||
html: true,
|
||||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
|
@ -820,11 +824,11 @@
|
|||
column.metadatum !== 'row_author' &&
|
||||
column.metadatum !== 'row_title' &&
|
||||
column.metadatum !== 'row_description'"
|
||||
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
|
||||
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`"/>
|
||||
|
||||
<span v-if="column.metadatum == 'row_thumbnail'">
|
||||
<img
|
||||
:alt="$i18n.get('label_thumbnail')"
|
||||
:alt="item.thumbnail_alt ? item.thumbnail_alt : $i18n.get('label_thumbnail')"
|
||||
class="table-thumb"
|
||||
:src="item['thumbnail']['tainacan-small'] ? item['thumbnail']['tainacan-small'][0] : (item['thumbnail'].thumbnail ? item['thumbnail'].thumbnail[0] : thumbPlaceholderPath)">
|
||||
</span>
|
||||
|
@ -926,6 +930,7 @@
|
|||
role="listitem"
|
||||
:href="item.url"
|
||||
:key="index"
|
||||
:data-tainacan-item-id="item.id"
|
||||
v-for="(item, index) of items"
|
||||
class="tainacan-list"
|
||||
:class="{ 'selected-list-item': getSelectedItemChecked(item.id) == true }">
|
||||
|
@ -964,7 +969,7 @@
|
|||
v-for="(column, metadatumIndex) in displayedMetadata"
|
||||
:key="metadatumIndex"
|
||||
v-if="column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
|
||||
v-html="item.metadata != undefined && collectionId ? renderMetadata(item.metadata, column) : (item.title ? item.title :`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`)" />
|
||||
v-html="item.metadata != undefined && collectionId ? renderMetadata(item.metadata, column) : (item.title ? item.title :`<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_provided') + `</span>`)" />
|
||||
</div>
|
||||
|
||||
<!-- Actions -->
|
||||
|
@ -1029,7 +1034,7 @@
|
|||
class="tainacan-list-thumbnail"
|
||||
v-if="item.thumbnail != undefined">
|
||||
<img
|
||||
:alt="$i18n.get('label_thumbnail')"
|
||||
:alt="item.thumbnail_alt ? item.thumbnail_alt : $i18n.get('label_thumbnail')"
|
||||
:src="item['thumbnail']['tainacan-medium-full'] ? item['thumbnail']['tainacan-medium-full'][0] : (item['thumbnail'].medium_large ? item['thumbnail'].medium_large[0] : thumbPlaceholderPath)">
|
||||
</div>
|
||||
<div class="list-metadata media-body">
|
||||
|
@ -1309,6 +1314,7 @@ export default {
|
|||
groupId: groupId
|
||||
}).then(() => {
|
||||
this.$eventBusSearch.loadItems();
|
||||
this.$root.$emit('openProcessesPopup');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -1340,6 +1346,7 @@ export default {
|
|||
groupId: groupId
|
||||
}).then(() => {
|
||||
this.$eventBusSearch.loadItems();
|
||||
this.$root.$emit('openProcessesPopup');
|
||||
});
|
||||
} else {
|
||||
this.trashItemsInBulk({
|
||||
|
@ -1347,6 +1354,7 @@ export default {
|
|||
groupId: groupId
|
||||
}).then(() => {
|
||||
this.$eventBusSearch.loadItems();
|
||||
this.$root.$emit('openProcessesPopup');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,76 +1,81 @@
|
|||
<template>
|
||||
<div
|
||||
v-if="processes.length > 0 && !isLoading"
|
||||
class="table-container">
|
||||
<!--
|
||||
<div class="selection-control">
|
||||
<div class="field select-all is-pulled-left">
|
||||
<span>
|
||||
<b-checkbox
|
||||
@click.native="selectAllOnPage()"
|
||||
:value="allOnPageSelected">{{ $i18n.get('label_select_all_processes_page') }}</b-checkbox>
|
||||
</span>
|
||||
</div>
|
||||
<div class="field is-pulled-right">
|
||||
<b-dropdown
|
||||
position="is-bottom-left"
|
||||
:disabled="!isSelecting"
|
||||
id="bulk-actions-dropdown"
|
||||
trap-focus>
|
||||
<button
|
||||
class="button is-white"
|
||||
slot="trigger">
|
||||
<span>{{ $i18n.get('label_bulk_actions') }}</span>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-arrowdown"/>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<b-dropdown-item
|
||||
id="item-delete-selected-items"
|
||||
@click="deleteSelected()">
|
||||
{{ $i18n.get('label_delete_selected_processes') }}
|
||||
</b-dropdown-item>
|
||||
<b-dropdown-item disabled>{{ $i18n.get('label_edit_selected_processes') + ' (Not ready)' }}
|
||||
</b-dropdown-item>
|
||||
</b-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div>
|
||||
|
||||
|
||||
<div class="processes-list">
|
||||
<div
|
||||
:class="{
|
||||
|
||||
<div
|
||||
v-if="processes.length > 0 && !isLoading"
|
||||
class="table-container">
|
||||
<!--
|
||||
<div class="selection-control">
|
||||
<div class="field select-all is-pulled-left">
|
||||
<span>
|
||||
<b-checkbox
|
||||
@click.native="selectAllOnPage()"
|
||||
:value="allOnPageSelected">{{ $i18n.get('label_select_all_processes_page') }}</b-checkbox>
|
||||
</span>
|
||||
</div>
|
||||
<div class="field is-pulled-right">
|
||||
<b-dropdown
|
||||
position="is-bottom-left"
|
||||
:disabled="!isSelecting"
|
||||
id="bulk-actions-dropdown"
|
||||
trap-focus>
|
||||
<button
|
||||
class="button is-white"
|
||||
slot="trigger">
|
||||
<span>{{ $i18n.get('label_bulk_actions') }}</span>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-arrowdown"/>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<b-dropdown-item
|
||||
id="item-delete-selected-items"
|
||||
@click="deleteSelected()">
|
||||
{{ $i18n.get('label_delete_selected_processes') }}
|
||||
</b-dropdown-item>
|
||||
<b-dropdown-item disabled>{{ $i18n.get('label_edit_selected_processes') + ' (Not ready)' }}
|
||||
</b-dropdown-item>
|
||||
</b-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="processes-list">
|
||||
<div
|
||||
:class="{
|
||||
'opened-process': collapses[index],
|
||||
'selected-row': selected[index],
|
||||
'highlighted-process': highlightedProcess == bgProcess.ID
|
||||
'selected-row': selected[index],
|
||||
'highlighted-process': highlightedProcess == bgProcess.ID
|
||||
}"
|
||||
class="processes-list-item"
|
||||
:key="index"
|
||||
v-for="(bgProcess, index) of processes">
|
||||
<div
|
||||
@click="$set(collapses, index, !collapses[index])"
|
||||
class="process-handler">
|
||||
<!-- Collapse -->
|
||||
<span class="icon">
|
||||
<i
|
||||
:class="{ 'tainacan-icon-arrowdown' : collapses[index], 'tainacan-icon-arrowright' : !collapses[index] }"
|
||||
class="tainacan-icon tainacan-icon-1-25em has-text-blue4"/>
|
||||
class="processes-list-item"
|
||||
:key="index"
|
||||
v-for="(bgProcess, index) of processes">
|
||||
<div
|
||||
@click="$set(collapses, index, !collapses[index])"
|
||||
class="process-handler">
|
||||
<!-- Collapse -->
|
||||
<span class="icon">
|
||||
<i
|
||||
:class="{ 'tainacan-icon-arrowdown' : collapses[index], 'tainacan-icon-arrowright' : !collapses[index] }"
|
||||
class="tainacan-icon tainacan-icon-1-25em has-text-blue4" />
|
||||
</span>
|
||||
<!-- Checking list -->
|
||||
<!-- <span
|
||||
:class="{ 'is-selecting': isSelecting }"
|
||||
class="checkbox-cell">
|
||||
<b-checkbox
|
||||
v-model="selected[index]"/>
|
||||
</span> -->
|
||||
<!-- Name -->
|
||||
<span
|
||||
class="process-title"
|
||||
:label="$i18n.get('label_name')"
|
||||
:aria-label="$i18n.get('label_name') + ': ' + bgProcess.name">
|
||||
<!-- Checking list -->
|
||||
<!-- <span
|
||||
:class="{ 'is-selecting': isSelecting }"
|
||||
class="checkbox-cell">
|
||||
<b-checkbox
|
||||
v-model="selected[index]"/>
|
||||
</span> -->
|
||||
<!-- Name -->
|
||||
<span
|
||||
class="process-title"
|
||||
:label="$i18n.get('label_name')"
|
||||
:aria-label="$i18n.get('label_name') + ': ' + bgProcess.name">
|
||||
<p
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -81,13 +86,13 @@
|
|||
}">
|
||||
{{ bgProcess.name ? bgProcess.name : $i18n.get('label_unamed_process') }}</p>
|
||||
</span>
|
||||
<!-- Progress -->
|
||||
<span
|
||||
class="process-progress"
|
||||
:label="$i18n.get('label_progress')"
|
||||
:aria-label="$i18n.get('label_progress') + ': ' + bgProcess.progress_label ? bgProcess.progress_label + (bgProcess.progress_value ? ' (' + bgProcess.progress_value + '%)' : '') : $i18n.get('label_no_details_of_process')">
|
||||
<!-- Progress -->
|
||||
<span
|
||||
class="process-progress"
|
||||
:label="$i18n.get('label_progress')"
|
||||
:aria-label="$i18n.get('label_progress') + ': ' + bgProcess.progress_label ? bgProcess.progress_label + (bgProcess.progress_value ? ' (' + bgProcess.progress_value + '%)' : '') : $i18n.get('label_no_details_of_process')">
|
||||
<p
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -97,16 +102,16 @@
|
|||
placement: 'auto-start'
|
||||
}">
|
||||
<span :class="{'occluding-content': bgProcess.progress_value }"><span class="has-text-weight-bold">{{ $i18n.get('label_progress') + " " }}</span>{{ bgProcess.progress_label ? bgProcess.progress_label : $i18n.get('label_no_details_of_process') }}</span>
|
||||
<span>{{ bgProcess.progress_value <= 0 ? `(0%)` : ' ('+ bgProcess.progress_value +'%)' }}</span>
|
||||
<span>{{ bgProcess.progress_value == 0 ? `(0%)` : ' ('+ bgProcess.progress_value +'%)' }}</span>
|
||||
</p>
|
||||
</span>
|
||||
<!-- Queued on -->
|
||||
<span
|
||||
class="process-queued-on"
|
||||
:label="$i18n.get('label_queued_on')"
|
||||
:aria-label="$i18n.get('label_queued_on') + ' ' + getDate(bgProcess.queued_on)">
|
||||
<!-- Queued on -->
|
||||
<span
|
||||
class="process-queued-on"
|
||||
:label="$i18n.get('label_queued_on')"
|
||||
:aria-label="$i18n.get('label_queued_on') + ' ' + getDate(bgProcess.queued_on)">
|
||||
<p
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -117,19 +122,19 @@
|
|||
}">
|
||||
<span class="has-text-weight-bold">{{ $i18n.get('label_queued_on') + " " }}</span>{{ getDate(bgProcess.queued_on) }}</p>
|
||||
</span>
|
||||
|
||||
<!-- Status-->
|
||||
<span
|
||||
class="actions-cell"
|
||||
:label="$i18n.get('label_status')">
|
||||
|
||||
<!-- Status-->
|
||||
<span
|
||||
class="actions-cell"
|
||||
:label="$i18n.get('label_status')">
|
||||
<div class="actions-container">
|
||||
<span
|
||||
v-if="bgProcess.status == 'running'"
|
||||
class="icon has-text-success loading-icon">
|
||||
<span
|
||||
v-if="bgProcess.status == 'running'"
|
||||
class="icon has-text-success loading-icon">
|
||||
<div class="control has-icons-right is-loading is-clearfix" />
|
||||
</span>
|
||||
<span
|
||||
v-tooltip="{
|
||||
<span
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -138,13 +143,13 @@
|
|||
autoHide: false, classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-if=" bgProcess.status === 'running' "
|
||||
class="icon has-text-gray action-icon"
|
||||
@click.prevent.stop="pauseProcess(index)">
|
||||
v-if=" bgProcess.status === 'running' "
|
||||
class="icon has-text-gray action-icon"
|
||||
@click.prevent.stop="pauseProcess(index)">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-stop"/>
|
||||
</span>
|
||||
<span
|
||||
v-tooltip="{
|
||||
<span
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -153,12 +158,12 @@
|
|||
autoHide: false, classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-if=" ( bgProcess.status === 'finished' && !bgProcess.error_log ) || bgProcess.status === null"
|
||||
class="icon has-text-success">
|
||||
v-if=" ( bgProcess.status === 'finished' && !bgProcess.error_log ) || bgProcess.status === null"
|
||||
class="icon has-text-success">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-approvedcircle"/>
|
||||
</span>
|
||||
<span
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -167,15 +172,15 @@
|
|||
autoHide: false, classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-if=" bgProcess.status === 'finished-errors' || ( bgProcess.done > 0 && bgProcess.error_log && bgProcess.status === 'finished' ) "
|
||||
class="icon has-text-success">
|
||||
v-if=" bgProcess.status === 'finished-errors' || ( bgProcess.done > 0 && bgProcess.error_log && bgProcess.status === 'finished' ) "
|
||||
class="icon has-text-success">
|
||||
<i
|
||||
style="margin-right: -5px;"
|
||||
class="tainacan-icon tainacan-icon-1-25em tainacan-icon-alert has-text-yellow2"/>
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-approvedcircle"/>
|
||||
</span>
|
||||
<span
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -184,12 +189,12 @@
|
|||
autoHide: false, classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-if=" bgProcess.status === 'cancelled' "
|
||||
class="icon has-text-success">
|
||||
v-if=" bgProcess.status === 'cancelled' "
|
||||
class="icon has-text-success">
|
||||
<i class="tainacan-icon has-text-danger tainacan-icon-1-25em tainacan-icon-repprovedcircle"/>
|
||||
</span>
|
||||
<span
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -198,12 +203,12 @@
|
|||
autoHide: false, classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-if=" bgProcess.status === 'paused' "
|
||||
class="icon has-text-gray">
|
||||
v-if=" bgProcess.status === 'paused' "
|
||||
class="icon has-text-gray">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-pause"/>
|
||||
</span>
|
||||
<span
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -212,12 +217,12 @@
|
|||
autoHide: false, classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-if=" bgProcess.status === 'waiting' "
|
||||
class="icon has-text-gray">
|
||||
v-if=" bgProcess.status === 'waiting' "
|
||||
class="icon has-text-gray">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-waiting"/>
|
||||
</span>
|
||||
<span
|
||||
v-tooltip="{
|
||||
<span
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -226,46 +231,46 @@
|
|||
autoHide: false, classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-if="bgProcess.status === 'errored'"
|
||||
class="icon has-text-danger">
|
||||
v-if="bgProcess.status === 'errored'"
|
||||
class="icon has-text-danger">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-processerror" />
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Collapse inner content -->
|
||||
<transition name="filter-item">
|
||||
<div
|
||||
v-if="collapses[index]"
|
||||
class="process-collapse">
|
||||
<!-- Output -->
|
||||
<span
|
||||
class="process-output"
|
||||
:label="$i18n.get('label_output')"
|
||||
:aria-label="$i18n.get('label_output') + ': ' + (bgProcess.output ? bgProcess.output : $i18n.get('label_no_output_info'))">
|
||||
<!-- Collapse inner content -->
|
||||
<transition name="filter-item">
|
||||
<div
|
||||
v-if="collapses[index]"
|
||||
class="process-collapse">
|
||||
<!-- Output -->
|
||||
<span
|
||||
class="process-output"
|
||||
:label="$i18n.get('label_output')"
|
||||
:aria-label="$i18n.get('label_output') + ': ' + (bgProcess.output ? bgProcess.output : $i18n.get('label_no_output_info'))">
|
||||
<p v-html="bgProcess.output ? bgProcess.output : $i18n.get('label_no_output_info')"/>
|
||||
</span>
|
||||
|
||||
<!-- Logs -->
|
||||
<span
|
||||
class="process-logs"
|
||||
:label="$i18n.get('label_log_file')"
|
||||
:aria-label="$i18n.get('label_log_gile')">
|
||||
<!-- Logs -->
|
||||
<span
|
||||
class="process-logs"
|
||||
:label="$i18n.get('label_log_file')"
|
||||
:aria-label="$i18n.get('label_log_gile')">
|
||||
<p>
|
||||
<a
|
||||
v-if="bgProcess.log"
|
||||
:href="bgProcess.log">
|
||||
<a
|
||||
v-if="bgProcess.log"
|
||||
:href="bgProcess.log">
|
||||
<span class="icon is-small">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-openurl"/>
|
||||
</span>
|
||||
{{ $i18n.get('label_log_file') }}
|
||||
</a>
|
||||
<br>
|
||||
<a
|
||||
v-if="bgProcess.error_log"
|
||||
class="has-text-danger"
|
||||
:href="bgProcess.error_log">
|
||||
<a
|
||||
v-if="bgProcess.error_log"
|
||||
class="has-text-danger"
|
||||
:href="bgProcess.error_log">
|
||||
<span class="icon is-small">
|
||||
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-openurl"/>
|
||||
</span>
|
||||
|
@ -274,13 +279,13 @@
|
|||
</p>
|
||||
</span>
|
||||
|
||||
<!-- Last processed on -->
|
||||
<span
|
||||
class="process-last-processed-on"
|
||||
:label="$i18n.get('label_last_processed_on')"
|
||||
:aria-label="$i18n.get('label_last_processed_on') + ' ' + getDate(bgProcess.processed_last)">
|
||||
<!-- Last processed on -->
|
||||
<span
|
||||
class="process-last-processed-on"
|
||||
:label="$i18n.get('label_last_processed_on')"
|
||||
:aria-label="$i18n.get('label_last_processed_on') + ' ' + getDate(bgProcess.processed_last)">
|
||||
<p
|
||||
v-tooltip="{
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
|
@ -291,11 +296,21 @@
|
|||
}">
|
||||
<span class="has-text-weight-bold">{{ $i18n.get('label_last_processed_on') + " " }}</span>{{ getDate(bgProcess.processed_last) }}</p>
|
||||
</span>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="isLoading">
|
||||
<center>
|
||||
<span>
|
||||
{{ $i18n.get('loading_processes') }}
|
||||
</span>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -319,7 +334,7 @@
|
|||
allOnPageSelected: false,
|
||||
isSelecting: false,
|
||||
highlightedProcess: '',
|
||||
dateFormat: ''
|
||||
dateFormat: '',
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -364,14 +379,15 @@
|
|||
},
|
||||
beforeDestroy() {
|
||||
if (jQuery && jQuery( document )) {
|
||||
jQuery( document ).unbind( 'heartbeat-tick', this.onHeartBitTickList)
|
||||
jQuery( document ).off( 'heartbeat-tick', this.onHeartBitTickList)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions('bgprocess', [
|
||||
'deleteProcess',
|
||||
'updateProcess',
|
||||
'heartBitUpdateProcess'
|
||||
'heartBitUpdateProcess',
|
||||
'fetchProcesses'
|
||||
]),
|
||||
selectAllOnPage() {
|
||||
for (let i = 0; i < this.selected.length; i++)
|
||||
|
@ -493,6 +509,11 @@
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../../scss/_variables.scss';
|
||||
|
||||
.sub-header {
|
||||
@include logs-container();
|
||||
}
|
||||
|
||||
.selection-control {
|
||||
|
||||
|
|
|
@ -109,18 +109,18 @@
|
|||
class="column-large-width"
|
||||
@click="onClickTaxonomy($event, taxonomy.id, index)"
|
||||
:label="$i18n.get('label_description')"
|
||||
:aria-label="$i18n.get('label_description') + ': ' + taxonomy.description != undefined && taxonomy.description != '' ? taxonomy.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`">
|
||||
:aria-label="$i18n.get('label_description') + ': ' + taxonomy.description != undefined && taxonomy.description != '' ? taxonomy.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`">
|
||||
<p
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
},
|
||||
content: taxonomy.description != undefined && taxonomy.description != '' ? taxonomy.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`,
|
||||
content: taxonomy.description != undefined && taxonomy.description != '' ? taxonomy.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`,
|
||||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-html="(taxonomy.description != undefined && taxonomy.description != '') ? taxonomy.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_informed') + `</span>`" />
|
||||
v-html="(taxonomy.description != undefined && taxonomy.description != '') ? taxonomy.description : `<span class='has-text-gray is-italic'>` + $i18n.get('label_description_not_provided') + `</span>`" />
|
||||
</td>
|
||||
<!-- Collections using -->
|
||||
<td
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<div
|
||||
class="skeleton"
|
||||
:style="{
|
||||
minHeight: (childItemMetadatum.metadatum.metadata_type_object.component == 'tainacan-checkbox' || childItemMetadatum.metadatum.metadata_type_object.component == 'tainacan-taxonomycheckbox') ? '150px' : '30px'
|
||||
minHeight: (childItemMetadatum.metadatum.metadata_type_object.component == 'tainacan-checkbox' || childItemMetadatum.metadatum.metadata_type_object.component == 'tainacan-taxonomy-checkbox') ? '150px' : '30px'
|
||||
}" />
|
||||
</div>
|
||||
<tainacan-form-item
|
||||
|
@ -86,7 +86,7 @@
|
|||
</p>
|
||||
<a
|
||||
v-if="isMultiple"
|
||||
:disabled="childItemMetadataGroups.length > 0 && !someValueOnLastInput"
|
||||
:disabled="itemMetadatum.item.id && (childItemMetadataGroups.length > 0 && !someValueOnLastInput)"
|
||||
@click="addGroup"
|
||||
class="is-block add-link">
|
||||
<span class="icon is-small">
|
||||
|
@ -137,10 +137,10 @@
|
|||
}
|
||||
},
|
||||
created() {
|
||||
eventBusItemMetadata.$on('hasRemovedItemMetadataGroup', () => this.isRemovingGroup = false);
|
||||
eventBusItemMetadata.$on('hasRemovedItemMetadataGroup', () => this.$nextTick(() => this.isRemovingGroup = false));
|
||||
},
|
||||
beforeDestroy() {
|
||||
eventBusItemMetadata.$off('hasRemovedItemMetadataGroup', () => this.isRemovingGroup = false);
|
||||
eventBusItemMetadata.$off('hasRemovedItemMetadataGroup', () => this.$nextTick(() => this.isRemovingGroup = false));
|
||||
},
|
||||
methods: {
|
||||
createChildMetadataGroups() {
|
||||
|
@ -153,7 +153,6 @@
|
|||
this.itemMetadatum.metadatum.metadata_type_options &&
|
||||
this.itemMetadatum.metadatum.metadata_type_options.children_objects.length > 0
|
||||
) {
|
||||
|
||||
// Here we load the values from the object, but must also create some
|
||||
if (parentValues && parentValues.length) {
|
||||
|
||||
|
@ -162,9 +161,9 @@
|
|||
let existingChildItemMetadata = [];
|
||||
|
||||
if (childItemMetadata && childItemMetadata.length) {
|
||||
|
||||
|
||||
for (let childMetadatum of this.itemMetadatum.metadatum.metadata_type_options.children_objects) {
|
||||
|
||||
|
||||
const childItemMetadatumIndex = childItemMetadata.findIndex((aChildItemMetadatum) => childMetadatum.id == aChildItemMetadatum.metadatum_id);
|
||||
// Loads the existing values
|
||||
if (childItemMetadatumIndex >= 0) {
|
||||
|
@ -172,7 +171,7 @@
|
|||
existingChildItemMetadata.push({
|
||||
item: this.itemMetadatum.item,
|
||||
metadatum: childMetadatum,
|
||||
parent_meta_id: childItemMetadatum.parent_meta_id,
|
||||
parent_meta_id: (this.itemMetadatum.item && this.itemMetadatum.item.id) ?childItemMetadatum.parent_meta_id : groupIndex,
|
||||
value: childItemMetadatum.value,
|
||||
value_as_html: childItemMetadatum.value_as_html,
|
||||
value_as_string: childItemMetadatum.value_as_string,
|
||||
|
@ -184,7 +183,7 @@
|
|||
existingChildItemMetadata.push({
|
||||
item: this.itemMetadatum.item,
|
||||
metadatum: childMetadatum,
|
||||
parent_meta_id: existingParentMetaIdIndex >= 0 ? childItemMetadata[existingParentMetaIdIndex].parent_meta_id : 0,
|
||||
parent_meta_id: (this.itemMetadatum.item && this.itemMetadatum.item.id) ? (existingParentMetaIdIndex >= 0 ? childItemMetadata[existingParentMetaIdIndex].parent_meta_id : 0) : groupIndex,
|
||||
value: '',
|
||||
value_as_html: '',
|
||||
value_as_string: '',
|
||||
|
@ -200,7 +199,7 @@
|
|||
let childObject = {
|
||||
item: this.itemMetadatum.item,
|
||||
metadatum: childMetadatum,
|
||||
parent_meta_id: '0',
|
||||
parent_meta_id: (this.itemMetadatum.item && this.itemMetadatum.item.id) ? '0' : currentChildItemMetadataGroups.length,
|
||||
value: '',
|
||||
value_as_html: '',
|
||||
value_as_string: '',
|
||||
|
@ -209,7 +208,7 @@
|
|||
existingChildItemMetadata.push(childObject)
|
||||
}
|
||||
}
|
||||
currentChildItemMetadataGroups.push(existingChildItemMetadata)
|
||||
currentChildItemMetadataGroups.push(existingChildItemMetadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -229,12 +228,44 @@
|
|||
addGroup() {
|
||||
|
||||
this.isCreatingGroup = true;
|
||||
|
||||
if (this.itemMetadatum.item && this.itemMetadatum.item.id) {
|
||||
|
||||
// Sends value to api so we can obtain the parent_meta_id
|
||||
eventBusItemMetadata.fetchCompoundFirstParentMetaId({
|
||||
itemId: this.itemMetadatum.item.id,
|
||||
metadatumId: this.itemMetadatum.metadatum.id
|
||||
}).then((parentMetaId) => {
|
||||
// Sends value to api so we can obtain the parent_meta_id
|
||||
eventBusItemMetadata.fetchCompoundFirstParentMetaId({
|
||||
itemId: this.itemMetadatum.item.id,
|
||||
metadatumId: this.itemMetadatum.metadatum.id
|
||||
}).then((parentMetaId) => {
|
||||
|
||||
// Create a new placeholder parent_meta_id group here.
|
||||
let newEmptyGroup = [];
|
||||
|
||||
if (this.itemMetadatum &&
|
||||
this.itemMetadatum.metadatum &&
|
||||
this.itemMetadatum.metadatum.metadata_type_options &&
|
||||
this.itemMetadatum.metadatum.metadata_type_options.children_objects.length > 0
|
||||
) {
|
||||
for (let childMetadatum of this.itemMetadatum.metadatum.metadata_type_options.children_objects) {
|
||||
let childObject = {
|
||||
item: this.itemMetadatum.item,
|
||||
metadatum: childMetadatum,
|
||||
parent_meta_id: parentMetaId,
|
||||
value: '',
|
||||
value_as_html: '',
|
||||
value_as_string: '',
|
||||
collapse: true
|
||||
};
|
||||
newEmptyGroup.push(childObject)
|
||||
}
|
||||
}
|
||||
|
||||
this.childItemMetadataGroups.push(newEmptyGroup);
|
||||
|
||||
this.isCreatingGroup = false;
|
||||
});
|
||||
|
||||
// If no itemId is provided, we are probably on an item Submission flow
|
||||
} else {
|
||||
|
||||
// Create a new placeholder parent_meta_id group here.
|
||||
let newEmptyGroup = [];
|
||||
|
@ -248,7 +279,7 @@
|
|||
let childObject = {
|
||||
item: this.itemMetadatum.item,
|
||||
metadatum: childMetadatum,
|
||||
parent_meta_id: parentMetaId,
|
||||
parent_meta_id: this.childItemMetadataGroups.length,
|
||||
value: '',
|
||||
value_as_html: '',
|
||||
value_as_string: '',
|
||||
|
@ -257,21 +288,21 @@
|
|||
newEmptyGroup.push(childObject)
|
||||
}
|
||||
}
|
||||
|
||||
this.childItemMetadataGroups.push(newEmptyGroup);
|
||||
|
||||
this.isCreatingGroup = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
removeGroup(groupIndex) {
|
||||
removeGroup(groupIndex) {
|
||||
|
||||
if (this.itemMetadatum.value && this.itemMetadatum.value[groupIndex] && this.itemMetadatum.value[groupIndex][0]) {
|
||||
this.isRemovingGroup = true;
|
||||
this.isRemovingGroup = true;
|
||||
eventBusItemMetadata.$emit('remove_group', {
|
||||
itemId: this.itemMetadatum.item.id,
|
||||
metadatumId: this.itemMetadatum.metadatum.id,
|
||||
parentMetaId: this.itemMetadatum.value[groupIndex][0].parent_meta_id
|
||||
parentMetaId: this.itemMetadatum.item.id ? this.itemMetadatum.value[groupIndex][0].parent_meta_id : groupIndex
|
||||
});
|
||||
if (!this.itemMetadatum.item.id)
|
||||
this.childItemMetadataGroups.splice(groupIndex, 1);
|
||||
} else {
|
||||
this.childItemMetadataGroups.splice(groupIndex, 1);
|
||||
}
|
||||
|
@ -316,7 +347,8 @@
|
|||
height: 1px;
|
||||
}
|
||||
.empty-label {
|
||||
color: var(--tainacan-gray3);
|
||||
color: var(--tainacan-gray4);
|
||||
font-size: 0.875em;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<div
|
||||
class="active-metadatum-item"
|
||||
:class="{
|
||||
'not-sortable-item': metadatum.id == undefined || openedMetadatumId != '' || isUpdatingMetadataOrder,
|
||||
'not-sortable-item': metadatum.id == undefined || openedMetadatumId != '' || isUpdatingMetadataOrder || metadatum.parent == 0 || metadatum.collection_id != collectionId,
|
||||
'not-focusable-item': openedMetadatumId == metadatum.id,
|
||||
'disabled-metadatum': parent.enabled == false,
|
||||
'inherited-metadatum': (metadatum.collection_id != collectionId && metadatum.parent == 0) || isRepositoryLevel
|
||||
|
@ -42,7 +42,7 @@
|
|||
:ref="'metadatum-handler-' + metadatum.id"
|
||||
class="handle">
|
||||
<span
|
||||
:style="{ opacity: !( metadatum.id == undefined || openedMetadatumId != '' || isUpdatingMetadataOrder) ? '1.0' : '0.0' }"
|
||||
:style="{ opacity: !( metadatum.id == undefined || openedMetadatumId != '' || isUpdatingMetadataOrder || metadatum.parent == 0 || metadatum.collection_id != collectionId) ? '1.0' : '0.0' }"
|
||||
v-tooltip="{
|
||||
content: metadatum.id == undefined || openedMetadatumId != '' || isUpdatingMetadataOrder ? $i18n.get('info_not_allowed_change_order_metadata') : $i18n.get('instruction_drag_and_drop_metadatum_sort'),
|
||||
autoHide: true,
|
||||
|
|
|
@ -169,6 +169,8 @@ class Compound extends Metadata_Type {
|
|||
public function get_value_as_html(Item_Metadata_Entity $item_metadata) {
|
||||
$value = $item_metadata->get_value();
|
||||
$separator = $item_metadata->get_multivalue_separator();
|
||||
$options = $item_metadata->get_metadatum()->get_metadata_type_options();
|
||||
$order = $options['children_order'];
|
||||
$return = '';
|
||||
|
||||
if ( empty($value) )
|
||||
|
@ -178,29 +180,36 @@ class Compound extends Metadata_Type {
|
|||
$elements = [];
|
||||
foreach ( $value as $compound_element ) {
|
||||
if ( !empty($compound_element) ) {
|
||||
$metadata_value = '';
|
||||
foreach ( $compound_element as $meta ) {
|
||||
$metadata_value = array_fill(0, count($compound_element), null);
|
||||
$metadata_value_not_ordinate = [];
|
||||
foreach ( $compound_element as $meta_id => $meta ) {
|
||||
$index = array_search( $meta_id, array_column( $order, 'id' ) );
|
||||
if ( $meta instanceof Item_Metadata_Entity && $meta->get_value_as_html() != '' ) {
|
||||
$metadata_value .= '<label class="label">' . $meta->get_metadatum()->get_name() . '</label> <p>' . $meta->get_value_as_html() . "</p> \n";
|
||||
if ( $index !== false ) {
|
||||
$metadata_value[$index] = '<div class="tainacan-metadatum"><label class="label">' . $meta->get_metadatum()->get_name() . '</label> <p>' . $meta->get_value_as_html() . "</p></div>";
|
||||
} else {
|
||||
$metadata_value_not_ordinate[] = '<div class="tainacan-metadatum"><label class="label">' . $meta->get_metadatum()->get_name() . '</label> <p>' . $meta->get_value_as_html() . "</p></div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
$elements[] = '<div class="tainacan-compound-metadatum">' . $metadata_value . "</div> \n" ;
|
||||
$elements[] = '<div class="tainacan-compound-metadatum">' . implode("\n", array_merge($metadata_value, $metadata_value_not_ordinate)) . "</div> \n" ;
|
||||
}
|
||||
}
|
||||
$return .= '<div class="tainacan-compound-group">' . implode($separator, $elements) . '</div>';
|
||||
$return = '<div class="tainacan-compound-group">' . implode($separator, $elements) . '</div>';
|
||||
} else {
|
||||
$return .= '<div class="tainacan-compound-group">';
|
||||
foreach ( $value as $meta ) {
|
||||
if ( $meta->get_value_as_html() != '' ) {
|
||||
$return .= '<div class="tainacan-metadatum">';
|
||||
if ( $meta instanceof Item_Metadata_Entity ) {
|
||||
$return .= '<label class="label">' . $meta->get_metadatum()->get_name() . "</label>\n";
|
||||
$return .= '<p>' . $meta->get_value_as_html() . '</p>';
|
||||
}
|
||||
$return .= '</div>' . "\n\n";
|
||||
}
|
||||
}
|
||||
$return .= '</div>' . "\n\n";
|
||||
$metadata_value = array_fill(0, count($value), null);
|
||||
$metadata_value_not_ordinate = [];
|
||||
foreach ( $value as $meta_id => $meta ) {
|
||||
$index = array_search( $meta_id, array_column( $order, 'id' ) );
|
||||
if ( $meta instanceof Item_Metadata_Entity && $meta->get_value_as_html() != '' ) {
|
||||
if ( $index !== false ) {
|
||||
$metadata_value[intval($index)] = '<div class="tainacan-metadatum"><label class="label">' . $meta->get_metadatum()->get_name() . '</label> <p>' . $meta->get_value_as_html() . "</p></div>";
|
||||
} else {
|
||||
$metadata_value_not_ordinate[] = '<div class="tainacan-metadatum"><label class="label">' . $meta->get_metadatum()->get_name() . '</label> <p>' . $meta->get_value_as_html() . "</p></div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
$return = '<div class="tainacan-compound-group">' . implode("\n", array_merge($metadata_value, $metadata_value_not_ordinate)) . "</div> \n";
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
|
|
@ -0,0 +1,233 @@
|
|||
<?php
|
||||
|
||||
namespace Tainacan\Metadata_Types;
|
||||
|
||||
use Tainacan\Entities\Metadatum;
|
||||
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
|
||||
/**
|
||||
* Class TainacanMetadatumType
|
||||
*/
|
||||
class MetadataTypeControlHelper {
|
||||
private static $instance = null;
|
||||
private function __construct() { }
|
||||
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
add_action( 'tainacan-insert-tainacan-item', array(self::$instance, 'update_control_metadatum'), 10, 1 );
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
static function update_control_metadatum( $item ) {
|
||||
if ( $item instanceof \Tainacan\Entities\Item ) {
|
||||
$item_metadata_repositories = \Tainacan\Repositories\Item_Metadata::get_instance();
|
||||
$item_metadata_repositories->disable_logs();
|
||||
$collection = $item->get_collection();
|
||||
$args = [
|
||||
'include_control_metadata_types' => true,
|
||||
'add_only_repository' => true,
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => 'metadata_type',
|
||||
'value' => 'Tainacan\Metadata_Types\Control',
|
||||
'compare' => 'IN'
|
||||
]
|
||||
]
|
||||
];
|
||||
$metadatum_repository = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$metadata = $metadatum_repository->fetch_by_collection( $collection, $args );
|
||||
foreach ($metadata as $item_metadatum) {
|
||||
if ( $item_metadatum->get_metadata_type_object() instanceof \Tainacan\Metadata_Types\Control) {
|
||||
$update_item_metadatum = new \Tainacan\Entities\Item_Metadata_Entity( $item, $item_metadatum );
|
||||
switch ( $item_metadatum->get_metadata_type_object()->get_option('control_metadatum') ) {
|
||||
case 'document_type':
|
||||
$document_type = $item->get_document_type() == 'attachment' ? get_post_mime_type($item->get_document()) : $item->get_document_type();
|
||||
$update_item_metadatum->set_value( $document_type !== false ? $document_type : 'attachment' );
|
||||
break;
|
||||
|
||||
case 'collection_id':
|
||||
$update_item_metadatum->set_value( $item->get_collection_id() );
|
||||
break;
|
||||
|
||||
case 'has_thumbnail':
|
||||
$update_item_metadatum->set_value( !empty($item->get__thumbnail_id()) ? 'yes':'no' );
|
||||
break;
|
||||
|
||||
default:
|
||||
// What the hell am I doing here?
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $update_item_metadatum->validate() )
|
||||
$item_metadata_repositories->insert( $update_item_metadatum );
|
||||
else
|
||||
$errors[] = $update_item_metadatum->get_errors();
|
||||
}
|
||||
}
|
||||
$item_metadata_repositories->enable_logs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class TainacanMetadatumType
|
||||
*/
|
||||
class Control extends Metadata_Type {
|
||||
|
||||
private $metadataTypeControlHelper;
|
||||
|
||||
function __construct() {
|
||||
// call metadatum type constructor
|
||||
parent::__construct();
|
||||
$this->set_primitive_type('control');
|
||||
$this->set_component('tainacan-text');
|
||||
$this->set_name( __('Control Type', 'tainacan') );
|
||||
$this->set_description( __('A special metadata type, used to map certain item properties such as collection id and document type to metadata in order to easily create filters.', 'tainacan') );
|
||||
$this->set_default_options([
|
||||
'control_metadatum_options' => ['document_type', 'collection_id', 'has_thumbnail'],
|
||||
'control_metadatum' => 'document_type',
|
||||
'only_repository' => 'no'
|
||||
]);
|
||||
$metadataTypeControlHelper = MetadataTypeControlHelper::get_instance();
|
||||
}
|
||||
|
||||
public static function get_helper() {
|
||||
return MetadataTypeControlHelper::get_instance();
|
||||
}
|
||||
|
||||
public function validate_options( Metadatum $metadatum ) {
|
||||
if ( !in_array($metadatum->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
|
||||
return true;
|
||||
|
||||
if ( empty($this->get_option('control_metadatum')) ) {
|
||||
return [
|
||||
'control_metadatum' => __('Required control metadatum.','tainacan')
|
||||
];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_control_metadatum_value($value, $control_metadatum, $format) {
|
||||
$return = '';
|
||||
|
||||
switch ( $control_metadatum ) {
|
||||
case 'document_type':
|
||||
$return = ($format == 'html' ? $this->get_document_as_html( $value ) : $this->get_document_as_string( $value ));
|
||||
break;
|
||||
|
||||
case 'collection_id':
|
||||
$return = ($format == 'html' ? $this->get_collection_as_html( $value ) : $this->get_collection_as_string( $value ));
|
||||
break;
|
||||
|
||||
case 'has_thumbnail':
|
||||
$return = ( $value == 'yes' ? __( 'yes', 'tainacan' ) : __( 'no', 'tainacan' ) );
|
||||
break;
|
||||
|
||||
default:
|
||||
$return = $value;// What the hell am I doing here?
|
||||
break;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of an Item_Metadata_Entity using a metadatum of this metadatum type as an html string
|
||||
* @param Item_Metadata_Entity $item_metadata
|
||||
* @return string The HTML representation of the value, containing one or multiple items names, linked to the item page
|
||||
*/
|
||||
public function get_value_as_html(\Tainacan\Entities\Item_Metadata_Entity $item_metadata) {
|
||||
$value = $item_metadata->get_value();
|
||||
$control_metadatum = $this->get_option('control_metadatum');
|
||||
return $this->get_control_metadatum_value($value, $control_metadatum, 'html');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of an Item_Metadata_Entity using a metadatum of this metadatum type as a string
|
||||
* @param Item_Metadata_Entity $item_metadata
|
||||
* @return string The String representation of the value, containing one or multiple items names, linked to the item page
|
||||
*/
|
||||
public function get_value_as_string(\Tainacan\Entities\Item_Metadata_Entity $item_metadata) {
|
||||
|
||||
$value = $item_metadata->get_value();
|
||||
$control_metadatum = $this->get_option('control_metadatum');
|
||||
|
||||
return $this->get_control_metadatum_value($value, $control_metadatum, 'string');
|
||||
}
|
||||
|
||||
private function get_document_as_html( $value ) {
|
||||
return $this->get_document_as_string( $value );
|
||||
}
|
||||
|
||||
public function get_document_as_string( $value ) {
|
||||
switch ($value) {
|
||||
case 'attachment':
|
||||
return __( 'File', 'tainacan' );
|
||||
break;
|
||||
|
||||
case 'text':
|
||||
return __( 'Text', 'tainacan' );
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
return __( 'URL', 'tainacan' );
|
||||
break;
|
||||
|
||||
case 'empty':
|
||||
return __( 'Empty', 'tainacan' );
|
||||
break;
|
||||
|
||||
case 'application/pdf':
|
||||
return "PDF";
|
||||
break;
|
||||
}
|
||||
$type = explode( '/', $value );
|
||||
if (count($type) == 2 ) {
|
||||
switch ($type[0]) {
|
||||
case 'image':
|
||||
$value = __( 'Image', 'tainacan' ) . '/' . $type[1];
|
||||
break;
|
||||
case 'video':
|
||||
$value = __( 'Video', 'tainacan' ) . '/' . $type[1];
|
||||
break;
|
||||
case 'audio':
|
||||
$value = __( 'Audio', 'tainacan' ) . '/' . $type[1];
|
||||
break;
|
||||
case 'text':
|
||||
$value = __( 'Text', 'tainacan' ) . '/' . $type[1];
|
||||
break;
|
||||
case 'application':
|
||||
$value = __( 'Others', 'tainacan' ) . '/' . $type[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
private function get_collection_as_html( $value ) {
|
||||
$collection = \Tainacan\Repositories\Collections::get_instance()->fetch( (int) $value );
|
||||
if ( $collection instanceof \Tainacan\Entities\Collection ) {
|
||||
$label = $collection->get_name();
|
||||
$link = $collection->get_url();
|
||||
$return = "<a data-linkto='collection' data-id='$value' href='$link'>";
|
||||
$return.= $label;
|
||||
$return .= "</a>";
|
||||
|
||||
return $return;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function get_collection_as_string( $value ) {
|
||||
$collection = \Tainacan\Repositories\Collections::get_instance()->fetch( (int) $value );
|
||||
if ( $collection instanceof \Tainacan\Entities\Collection ) {
|
||||
$label = $collection->get_name();
|
||||
return $label;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -41,6 +41,7 @@ class Metadata_Type_Helper {
|
|||
$this->Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Taxonomy');
|
||||
$this->Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Compound');
|
||||
$this->Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\User');
|
||||
$this->Tainacan_Metadata->register_metadata_type('Tainacan\Metadata_Types\Control');
|
||||
|
||||
// the priority should see less than on function
|
||||
// `load_admin_page()` of class `Admin` in file /src/views/class-tainacan-admin.php
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div :class="{ 'is-flex': itemMetadatum.metadatum.multiple != 'yes' || maxtags != undefined }">
|
||||
<div :class="{ 'is-flex is-flex-wrap-wrap': itemMetadatum.metadatum.multiple != 'yes' || maxtags != undefined }">
|
||||
<b-taginput
|
||||
expanded
|
||||
:disabled="disabled"
|
||||
|
@ -10,8 +10,10 @@
|
|||
@input="onInput"
|
||||
@blur="onBlur"
|
||||
:data="options"
|
||||
:maxtags="maxtags != undefined ? maxtags : (itemMetadatum.metadatum.multiple == 'yes' || allowNew === true ? 100 : 1)"
|
||||
:maxtags="maxtags != undefined ? maxtags : (itemMetadatum.metadatum.multiple == 'yes' || allowNew === true ? null : 1)"
|
||||
autocomplete
|
||||
:remove-on-keys="[]"
|
||||
:dropdown-position="isLastMetadatum ? 'top' :'auto'"
|
||||
attached
|
||||
:placeholder="$i18n.get('instruction_type_existing_item')"
|
||||
:loading="isLoading"
|
||||
|
@ -42,7 +44,7 @@
|
|||
{{ $i18n.get('info_no_item_found') }}
|
||||
</template>
|
||||
<template
|
||||
v-if="currentUserCanEditItems && !$route.query.iframemode"
|
||||
v-if="currentUserCanEditItems && !($route && $route.query.iframemode)"
|
||||
slot="footer">
|
||||
<a @click="createNewItemModal = true">
|
||||
{{ $i18n.get('label_crate_new_item') + ' "' + searchQuery + '"' }}
|
||||
|
@ -50,8 +52,8 @@
|
|||
</template>
|
||||
</b-taginput>
|
||||
<a
|
||||
v-if="currentUserCanEditItems"
|
||||
:disabled="$route.query.iframemode"
|
||||
v-if="currentUserCanEditItems && itemMetadatum.item && itemMetadatum.item.id"
|
||||
:disabled="!$route || $route.query.iframemode"
|
||||
@click="createNewItemModal = !createNewItemModal"
|
||||
class="add-link">
|
||||
<span class="icon is-small">
|
||||
|
@ -82,7 +84,8 @@
|
|||
itemMetadatum: Object,
|
||||
maxtags: undefined,
|
||||
disabled: false,
|
||||
allowNew: true
|
||||
allowNew: true,
|
||||
isLastMetadatum: false
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -90,9 +93,6 @@
|
|||
options: [],
|
||||
isLoading: false,
|
||||
collectionId: '',
|
||||
inputValue: null,
|
||||
queryObject: {},
|
||||
itemsFound: [],
|
||||
searchQuery: '',
|
||||
totalItems: 0,
|
||||
page: 1,
|
||||
|
@ -120,7 +120,7 @@
|
|||
if (this.itemMetadatum.value && (Array.isArray( this.itemMetadatum.value ) ? this.itemMetadatum.value.length > 0 : true )) {
|
||||
let query = qs.stringify({ postin: ( Array.isArray( this.itemMetadatum.value ) ) ? this.itemMetadatum.value : [ this.itemMetadatum.value ] });
|
||||
query += this.itemMetadatum.metadatum.metadata_type_options.search ? '&fetch_only_meta=' + this.itemMetadatum.metadatum.metadata_type_options.search : '';
|
||||
axios.get('/collection/' + this.collectionId + '/items?' + query + '&nopaging=1&fetch_only=title,thumbnail')
|
||||
axios.get('/collection/' + this.collectionId + '/items?' + query + '&nopaging=1&fetch_only=title,thumbnail&order=asc')
|
||||
.then( res => {
|
||||
if (res.data.items) {
|
||||
for (let item of res.data.items)
|
||||
|
@ -137,7 +137,7 @@
|
|||
}
|
||||
|
||||
// Checks if current user can edit itens on the related collection to offer modal
|
||||
if (this.collection.id == this.collectionId)
|
||||
if (this.collection && this.collection.id == this.collectionId)
|
||||
this.currentUserCanEditItems = this.collection.current_user_can_edit_items;
|
||||
else {
|
||||
axios.get('/collections/' + this.collectionId + '?fetch_only=name,url,allow_comments&context=edit')
|
||||
|
@ -150,6 +150,9 @@
|
|||
'getCollection'
|
||||
]),
|
||||
onInput(newSelected) {
|
||||
// First we reset the input
|
||||
this.search('');
|
||||
|
||||
this.selected = newSelected;
|
||||
this.$emit('input', newSelected.map((item) => item.value));
|
||||
},
|
||||
|
@ -226,7 +229,6 @@
|
|||
},
|
||||
getQueryString( search ) {
|
||||
let query = [];
|
||||
|
||||
if (this.itemMetadatum.metadatum.metadata_type_options &&
|
||||
this.itemMetadatum.metadatum.metadata_type_options.search)
|
||||
{
|
||||
|
@ -247,6 +249,23 @@
|
|||
value: search,
|
||||
compare: 'LIKE'
|
||||
}
|
||||
|
||||
// Sorting options depend on metadata type. Notice that this won't work with taxonomies
|
||||
switch(this.itemMetadatum.metadatum.metadata_type_options.related_primitive_type) {
|
||||
case 'float':
|
||||
case 'int':
|
||||
query['orderby'] = 'meta_value_num';
|
||||
query['metakey'] = this.itemMetadatum.metadatum.metadata_type_options.search;
|
||||
break;
|
||||
case 'date':
|
||||
query['orderby'] = 'meta_value';
|
||||
query['metakey'] = this.itemMetadatum.metadatum.metadata_type_options.search;
|
||||
query['metatype'] = 'DATETIME';
|
||||
break;
|
||||
default:
|
||||
query['orderby'] = 'meta_value';
|
||||
query['metakey'] = this.itemMetadatum.metadatum.metadata_type_options.search;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -256,6 +275,7 @@
|
|||
query['fetch_only_meta'] = this.itemMetadatum.metadatum.metadata_type_options.search;
|
||||
query['perpage'] = 12;
|
||||
query['paged'] = this.page;
|
||||
query['order'] = 'asc';
|
||||
|
||||
if (this.selected.length > 0)
|
||||
query['exclude'] = this.selected.map((item) => item.value);
|
||||
|
|
|
@ -229,9 +229,13 @@ class Relationship extends Metadata_Type {
|
|||
if ( isset($opt['search']) && !empty($opt['search']) ) {
|
||||
$search_id = $opt['search'];
|
||||
$metadata = \Tainacan\Repositories\Metadata::get_instance()->fetch($search_id, 'OBJECT');
|
||||
if ($metadata->get_metadata_type() == 'Tainacan\Metadata_Types\Taxonomy') {
|
||||
$taxonomy_id = $metadata->get_metadata_type_options()['taxonomy_id'];
|
||||
return array_merge(['search_by_tax' => $taxonomy_id], $opt);
|
||||
if( $metadata instanceof \Tainacan\Entities\Metadatum ) {
|
||||
$opt = array_merge(['related_primitive_type' => $metadata->get_metadata_type_object()->get_primitive_type()], $opt);
|
||||
|
||||
if ($metadata->get_metadata_type() == 'Tainacan\Metadata_Types\Taxonomy') {
|
||||
$taxonomy_id = $metadata->get_metadata_type_options()['taxonomy_id'];
|
||||
return array_merge(['search_by_tax' => $taxonomy_id], $opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $opt;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
@input="emitValues()"
|
||||
@focus="clear()"
|
||||
attached
|
||||
:remove-on-keys="[]"
|
||||
:aria-close-label="$i18n.get('remove_value')"
|
||||
:class="{'has-selected': options != undefined && options != []}"
|
||||
:placeholder="$i18n.get('new') + ', ...'"/>
|
||||
|
@ -34,7 +35,7 @@
|
|||
return {
|
||||
optionType: '',
|
||||
optionMessage: '',
|
||||
options: []
|
||||
options: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
<template>
|
||||
<b-field
|
||||
:class="hideCollapses ? 'has-collapses-hidden' : ''"
|
||||
:addons="false"
|
||||
:message="errorMessage"
|
||||
:type="errorMessage ? 'is-danger' : ''">
|
||||
<span
|
||||
class="collapse-handle"
|
||||
@click="$emit('changeCollapse', errorMessage ? true : !isCollapsed )">
|
||||
<span class="icon">
|
||||
@click="!hideCollapses ? $emit('changeCollapse', errorMessage ? true : !isCollapsed ) : ''">
|
||||
<span
|
||||
v-if="!hideCollapses"
|
||||
class="icon">
|
||||
<i
|
||||
:class="{
|
||||
'tainacan-icon-arrowdown' : isCollapsed || errorMessage,
|
||||
|
@ -33,16 +36,19 @@
|
|||
:class="errorMessage ? 'is-danger' : ''">
|
||||
*
|
||||
</span>
|
||||
<span class="metadata-type">
|
||||
<span
|
||||
v-if="!$parent.hideMetadataTypes"
|
||||
class="metadata-type">
|
||||
({{ itemMetadatum.metadatum.metadata_type_object.name }})
|
||||
</span>
|
||||
<help-button
|
||||
<help-button
|
||||
v-if="!$parent.hideHelpButtons"
|
||||
:title="itemMetadatum.metadatum.name"
|
||||
:message="itemMetadatum.metadatum.description"/>
|
||||
</span>
|
||||
<transition name="filter-item">
|
||||
<div
|
||||
v-show="isCollapsed || errorMessage"
|
||||
v-show="hideCollapses || (isCollapsed || errorMessage)"
|
||||
v-if="isTextInputComponent">
|
||||
<component
|
||||
:is="metadatumComponent"
|
||||
|
@ -91,14 +97,15 @@
|
|||
<!-- Non-textual metadata such as taxonomy, relationship and compound manage multiple state in different ways -->
|
||||
<transition name="filter-item">
|
||||
<div
|
||||
v-show="isCollapsed"
|
||||
v-show="hideCollapses || isCollapsed"
|
||||
v-if="!isTextInputComponent">
|
||||
<component
|
||||
:is="metadatumComponent"
|
||||
v-model="values"
|
||||
:item-metadatum="itemMetadatum"
|
||||
@input="changeValue"
|
||||
@blur="performValueChange"/>
|
||||
@blur="performValueChange"
|
||||
:is-last-metadatum="isLastMetadatum" />
|
||||
</div>
|
||||
</transition>
|
||||
</b-field>
|
||||
|
@ -111,7 +118,9 @@
|
|||
name: 'TainacanFormItem',
|
||||
props: {
|
||||
itemMetadatum: Object,
|
||||
isCollapsed: true
|
||||
isCollapsed: true,
|
||||
hideCollapses: false,
|
||||
isLastMetadatum: false
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
@ -162,48 +171,56 @@
|
|||
this.performValueChange();
|
||||
}, 800),
|
||||
performValueChange() {
|
||||
|
||||
|
||||
// Compound metadata do not emit values, only their children.
|
||||
if (this.metadatumComponent == 'tainacan-compound')
|
||||
return;
|
||||
|
||||
// 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': {
|
||||
|
||||
let equal = [];
|
||||
let currentValues = [];
|
||||
|
||||
// An array of terms
|
||||
if (this.values.length && this.values[0].constructor.name == 'Object')
|
||||
currentValues = this.values.map(term => term.value)
|
||||
else
|
||||
currentValues = this.values;
|
||||
|
||||
for (let value of currentValues) {
|
||||
let foundIndex = this.itemMetadatum.value.findIndex(element => value == element.id);
|
||||
if (foundIndex >= 0)
|
||||
equal.push(this.itemMetadatum.value[foundIndex]);
|
||||
}
|
||||
|
||||
if (equal.length == currentValues.length && this.itemMetadatum.value.length <= equal.length)
|
||||
return;
|
||||
|
||||
break;
|
||||
}
|
||||
if (this.itemMetadatum.value !== null) {
|
||||
|
||||
// A single term value
|
||||
case 'Object':
|
||||
if (this.values.length && this.values[0] == this.itemMetadatum.value.id)
|
||||
return;
|
||||
break;
|
||||
// This routine avoids calling the API if the value did not changed
|
||||
switch(this.itemMetadatum.value.constructor.name) {
|
||||
|
||||
// Any single metadatum value that is not a term
|
||||
default:
|
||||
if (this.values.length && this.values[0] == this.itemMetadatum.value)
|
||||
return;
|
||||
// Multivalored Metadata requires checking the whole array
|
||||
case 'Array': {
|
||||
|
||||
let equal = [];
|
||||
let currentValues = [];
|
||||
|
||||
// An array of terms
|
||||
if (this.values.length && this.values[0].constructor.name == 'Object')
|
||||
currentValues = this.values.map(term => term.value)
|
||||
else
|
||||
currentValues = this.values;
|
||||
|
||||
if (Array.isArray(currentValues)) {
|
||||
for (let value of currentValues) {
|
||||
let foundIndex = this.itemMetadatum.value.findIndex(element => value == element.id);
|
||||
if (foundIndex >= 0)
|
||||
equal.push(this.itemMetadatum.value[foundIndex]);
|
||||
}
|
||||
|
||||
if (equal.length == currentValues.length && this.itemMetadatum.value.length <= equal.length)
|
||||
return;
|
||||
} else { // This will happen in taxonomy single valued on item submission, as there all term values appear as array.
|
||||
if (this.itemMetadatum.value == currentValues)
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// A single term value
|
||||
case 'Object':
|
||||
if (this.values.length && this.values[0] == this.itemMetadatum.value.id)
|
||||
return;
|
||||
break;
|
||||
|
||||
// Any single metadatum value that is not a term
|
||||
default:
|
||||
if (this.values.length && this.values[0] == this.itemMetadatum.value)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If none is the case, the value is update request is sent to the API
|
||||
|
@ -211,7 +228,8 @@
|
|||
itemId: this.itemMetadatum.item.id,
|
||||
metadatumId: this.itemMetadatum.metadatum.id,
|
||||
values: this.values ? this.values : '',
|
||||
parentMetaId: this.itemMetadatum.parent_meta_id
|
||||
parentMetaId: this.itemMetadatum.parent_meta_id,
|
||||
parentId: this.itemMetadatum.metadatum.parent != undefined ? this.itemMetadatum.metadatum.parent : 0
|
||||
});
|
||||
},
|
||||
addValue(){
|
||||
|
@ -236,9 +254,22 @@
|
|||
}
|
||||
|
||||
.field {
|
||||
border-bottom: 1px solid var(--tainacan-gray2);
|
||||
border-bottom: 1px solid var(--tainacan-input-border-color);
|
||||
padding: 10px var(--tainacan-container-padding);
|
||||
|
||||
&.has-collapses-hidden {
|
||||
border-bottom: none;
|
||||
padding: 10px !important;
|
||||
|
||||
.collapse-handle {
|
||||
margin-left: -15px;
|
||||
}
|
||||
|
||||
.child-metadata-inputs {
|
||||
margin-left: 0.25em;
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 0.875em;
|
||||
font-weight: 500;
|
||||
|
@ -250,7 +281,8 @@
|
|||
.metadata-type {
|
||||
font-size: 0.8125em;
|
||||
font-weight: 400;
|
||||
color: var(--tainacan-gray3);
|
||||
color: var(--tainacan-info-color);
|
||||
opacity: 0.75;
|
||||
top: -0.1em;
|
||||
position: relative;
|
||||
}
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
@input="updateSelectedCollections"
|
||||
@focus="clear()"
|
||||
attached
|
||||
:remove-on-keys="[]"
|
||||
:aria-close-label="$i18n.get('remove_value')"
|
||||
:class="{'has-selected': link_filtered_by_collections != undefined && link_filtered_by_collections != []}"
|
||||
:placeholder="$i18n.get('instruction_select_one_or_more_collections')"
|
||||
|
|
|
@ -14,8 +14,11 @@
|
|||
:has-counter="false" />
|
||||
<checkbox-radio-metadata-input
|
||||
v-else
|
||||
:id="'tainacan-item-metadatum_id-' + itemMetadatum.metadatum.id + (itemMetadatum.parent_meta_id ? ('_parent_meta_id-' + itemMetadatum.parent_meta_id) : '')"
|
||||
:is-modal="false"
|
||||
:parent="0"
|
||||
:allow-new="allowNew"
|
||||
@showAddNewTerm="openTermCreationModal"
|
||||
:taxonomy_id="taxonomyId"
|
||||
:selected="!valueComponent ? [] : valueComponent"
|
||||
:metadatum-id="itemMetadatum.metadatum.id"
|
||||
|
@ -23,9 +26,11 @@
|
|||
:collection-id="itemMetadatum.metadatum.collection_id"
|
||||
:is-taxonomy="true"
|
||||
:metadatum="itemMetadatum.metadatum"
|
||||
:amount-selected="Array.isArray(valueComponent) ? valueComponent.length : (valueComponent ? '1' : '0')"
|
||||
:is-checkbox="getComponent == 'tainacan-taxonomy-checkbox'"
|
||||
@input="(selected) => valueComponent = selected"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="allowNew"
|
||||
class="add-new-term">
|
||||
|
@ -39,12 +44,26 @@
|
|||
{{ $i18n.get('label_new_term') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<b-modal
|
||||
v-model="isTermCreationModalOpen"
|
||||
trap-focus
|
||||
aria-role="dialog"
|
||||
aria-modal
|
||||
:can-cancel="['outside', 'escape']">
|
||||
<term-edition-form
|
||||
:taxonomy-id="taxonomyId"
|
||||
:edit-form="{ id: 'new', name: newTermName ? newTermName : '' }"
|
||||
:is-modal="true"
|
||||
@onEditionFinished="($event) => addRecentlyCreatedTerm($event.term)"
|
||||
@onEditionCanceled="() => $console.log('Edition canceled')"
|
||||
@onErrorFound="($event) => $console.log('Form with errors: ' + $event)" />
|
||||
</b-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TainacanTaxonomyTagInput from './TaxonomyTaginput.vue';
|
||||
import TermEditionForm from '../../edition/term-edition-form.vue';
|
||||
import CheckboxRadioMetadataInput from '../../other/checkbox-radio-metadata-input.vue';
|
||||
import { tainacan as axios } from '../../../js/axios.js';
|
||||
|
||||
|
@ -60,6 +79,8 @@
|
|||
forcedComponentType: '',
|
||||
maxtags: '',
|
||||
allowSelectToCreate: false,
|
||||
isTermCreationModalOpen: false,
|
||||
newTermName: ''
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
@ -85,7 +106,7 @@
|
|||
}
|
||||
},
|
||||
watch: {
|
||||
valueComponent( val ){
|
||||
valueComponent( val ) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
},
|
||||
|
@ -95,7 +116,7 @@
|
|||
this.taxonomyId = metadata_type_options.taxonomy_id;
|
||||
this.taxonomy = metadata_type_options.taxonomy;
|
||||
|
||||
if (metadata_type_options && metadata_type_options.allow_new_terms && this.itemMetadatum.item)
|
||||
if (this.itemMetadatum.item && this.itemMetadatum.item.id && metadata_type_options && metadata_type_options.allow_new_terms && this.itemMetadatum.item)
|
||||
this.allowNew = metadata_type_options.allow_new_terms == 'yes';
|
||||
|
||||
this.getTermsId();
|
||||
|
@ -140,23 +161,8 @@
|
|||
}
|
||||
},
|
||||
openTermCreationModal(newTerm) {
|
||||
this.$buefy.modal.open({
|
||||
parent: this,
|
||||
component: TermEditionForm,
|
||||
canCancel: ['outside', 'escape'],
|
||||
props: {
|
||||
taxonomyId: this.taxonomyId,
|
||||
editForm: { id: 'new', name: newTerm.name ? newTerm.name : '' },
|
||||
isModal: true
|
||||
},
|
||||
events: {
|
||||
onEditionFinished: ($event) => this.addRecentlyCreatedTerm($event.term),
|
||||
onEditionCanceled: () => this.$console.log('Edition canceled'),
|
||||
onErrorFound: ($event) => this.$console.log('Form with errors: ' + $event)
|
||||
},
|
||||
trapFocus: true
|
||||
});
|
||||
|
||||
this.newTermName = newTerm.name;
|
||||
this.isTermCreationModalOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
v-model="selected"
|
||||
:data="labels"
|
||||
field="label"
|
||||
:remove-on-keys="[]"
|
||||
:dropdown-position="isLastMetadatum ? 'top' :'auto'"
|
||||
attached
|
||||
ellipsis
|
||||
:aria-close-label="$i18n.get('remove_value')"
|
||||
|
@ -59,6 +61,7 @@
|
|||
disabled: false,
|
||||
allowSelectToCreate: false,
|
||||
maxtags: '',
|
||||
isLastMetadatum: false
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -21,7 +21,8 @@ class Taxonomy extends Metadata_Type {
|
|||
|
||||
$this->set_default_options([
|
||||
'allow_new_terms' => 'no',
|
||||
'link_filtered_by_collections' => []
|
||||
'link_filtered_by_collections' => [],
|
||||
'input_type' => 'tainacan-taxonomy-radio',
|
||||
]);
|
||||
|
||||
$this->set_form_component('tainacan-form-taxonomy');
|
||||
|
@ -73,7 +74,6 @@ class Taxonomy extends Metadata_Type {
|
|||
</div>
|
||||
');
|
||||
|
||||
add_filter( 'tainacan-term-to-html', [$this, 'term_to_html'], 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,6 +112,11 @@ class Taxonomy extends Metadata_Type {
|
|||
if (empty($this->get_option('taxonomy_id')))
|
||||
return ['taxonomy_id' => __('Please select a taxonomy', 'tainacan')];
|
||||
|
||||
$options = $metadatum->get_metadata_type_options();
|
||||
if ( !$metadatum->is_multiple() && $this->get_option('input_type') !== 'tainacan-taxonomy-radio' ) {
|
||||
return ['input_type' => __('A taxonomy metadata that does not accept multiple values should use a radio type input', 'tainacan')];
|
||||
}
|
||||
|
||||
$Tainacan_Metadata = Metadata::get_instance();
|
||||
|
||||
// Check taxonomy visibility
|
||||
|
@ -225,37 +230,6 @@ class Taxonomy extends Metadata_Type {
|
|||
|
||||
}
|
||||
|
||||
public function term_to_html($return, $term) {
|
||||
|
||||
$collections = $this->get_option( 'link_filtered_by_collections' );
|
||||
|
||||
if ( !empty( $collections ) ) {
|
||||
$return = '';
|
||||
$id = $term->get_id();
|
||||
|
||||
if ( $id ) {
|
||||
$link = get_term_link( (int) $id );
|
||||
if (is_string($link)) {
|
||||
$meta_query = [
|
||||
'metaquery' => [
|
||||
[
|
||||
'key' => 'collection_id',
|
||||
'compare' => 'IN',
|
||||
'value' => $collections
|
||||
]
|
||||
]
|
||||
];
|
||||
$link = $link . '?' . http_build_query( $meta_query );
|
||||
$return = "<a data-linkto='term' data-id='$id' href='$link'>";
|
||||
$return.= $term->get_name();
|
||||
$return .= "</a>";
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of an Item_Metadata_Entity using a metadatum of this metadatum type as an html string
|
||||
* @param Item_Metadata_Entity $item_metadata
|
||||
|
@ -314,11 +288,11 @@ class Taxonomy extends Metadata_Type {
|
|||
|
||||
$terms = [];
|
||||
|
||||
$terms[] = $term->_toHtml();
|
||||
$terms[] = $this->term_to_html($term);
|
||||
|
||||
while ($term->get_parent() > 0) {
|
||||
$term = \Tainacan\Repositories\Terms::get_instance()->fetch( (int) $term->get_parent(), $term->get_taxonomy() );
|
||||
$terms[] = $term->_toHtml();
|
||||
$terms[] = $this->term_to_html($term);
|
||||
}
|
||||
|
||||
$terms = \array_reverse($terms);
|
||||
|
@ -329,6 +303,35 @@ class Taxonomy extends Metadata_Type {
|
|||
|
||||
}
|
||||
|
||||
private function term_to_html($term) {
|
||||
$collections = $this->get_option( 'link_filtered_by_collections' );
|
||||
if ( !empty( $collections ) ) {
|
||||
$return = '';
|
||||
$id = $term->get_id();
|
||||
|
||||
if ( $id ) {
|
||||
$link = get_term_link( (int) $id );
|
||||
if (is_string($link)) {
|
||||
$meta_query = [
|
||||
'metaquery' => [
|
||||
[
|
||||
'key' => 'collection_id',
|
||||
'compare' => 'IN',
|
||||
'value' => $collections
|
||||
]
|
||||
]
|
||||
];
|
||||
$link = $link . '?' . http_build_query( $meta_query );
|
||||
$return = "<a data-linkto='term' data-id='$id' href='$link'>";
|
||||
$return.= $term->get_name();
|
||||
$return .= "</a>";
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
return $term->_toHtml();
|
||||
}
|
||||
|
||||
public function _toArray() {
|
||||
|
||||
$array = parent::_toArray();
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
:placeholder="$i18n.get('instruction_type_search_users')"
|
||||
keep-first
|
||||
open-on-focus
|
||||
:remove-on-keys="[]"
|
||||
:dropdown-position="isLastMetadatum ? 'top' :'auto'"
|
||||
:loading="isLoading || isLoading"
|
||||
:aria-close-label="$i18n.get('remove_value')"
|
||||
:class="{'has-selected': selected != undefined && selected != []}"
|
||||
|
@ -58,6 +60,7 @@ export default {
|
|||
maxtags: undefined,
|
||||
disabled: false,
|
||||
allowNew: true,
|
||||
isLastMetadatum: false
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -440,7 +440,7 @@
|
|||
}).then(() => {
|
||||
this.finalizeProcedure(criterion);
|
||||
});
|
||||
} if(procedure.metadatum.id === 'comments'){
|
||||
} else if (procedure.metadatum.id === 'comments') {
|
||||
this.setCommentStatusInBulk({
|
||||
collectionId: this.collectionId,
|
||||
groupId: this.groupId,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
class="level-item">
|
||||
<router-link
|
||||
tag="a"
|
||||
:to="{ path: collection && collection.id ? $routerHelper.getCollectionItemsPath(collection.id, '') : '' }"
|
||||
:to="{ path: collection && collection.id ? $routerHelper.getCollectionItemsPath(collection.id, '') : '', query: activeRoute == 'CollectionItemsPage' ? $route.query : '' }"
|
||||
:aria-label="$i18n.get('label_collection_items')">
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-items"/>
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
class="tainacan-finder-column"
|
||||
:key="finderColumn.label + '-' + key">
|
||||
<p class="column-label">
|
||||
{{ finderColumn.label ? finderColumn.label : $i18n.get('label_terms_without_parent') }}
|
||||
{{ finderColumn.label ? finderColumn.label : $i18n.get('label_root_terms') }}
|
||||
</p>
|
||||
<ul v-if="finderColumn.children.length">
|
||||
<b-field
|
||||
|
@ -560,7 +560,7 @@
|
|||
let query = `?order=asc&number=${this.maxNumSearchResultsShow}&search=${this.optionName}&${qs.stringify(query_items)}`;
|
||||
|
||||
let route = `/collection/${this.collectionId}/facets/${this.metadatumId}${query}`;
|
||||
|
||||
|
||||
if (this.collectionId == 'default')
|
||||
route = `/facets/${this.metadatumId}${query}`;
|
||||
|
||||
|
@ -676,7 +676,6 @@
|
|||
let query = `?order=asc&parent=${parent}&number=${this.maxNumOptionsCheckboxFinderColumns}&offset=0&${qs.stringify(query_items)}`
|
||||
|
||||
this.isColumnLoading = true;
|
||||
|
||||
let route = `/collection/${this.collectionId}/facets/${this.metadatumId}${query}`;
|
||||
|
||||
if (this.collectionId == 'default')
|
||||
|
@ -1027,6 +1026,7 @@
|
|||
border-radius: 0 !important;
|
||||
min-height: 100%;
|
||||
border: 1px solid var(--tainacan-input-border-color);
|
||||
background-color: var(--tainacan-input-background-color);
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
.button.is-active {
|
||||
|
@ -1096,6 +1096,10 @@
|
|||
.tags.is-small {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
section p {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
}
|
||||
|
||||
.tainacan-modal-checkbox-search-results-body {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -104,7 +104,7 @@
|
|||
class="tainacan-finder-column"
|
||||
:key="finderColumn.label + '-' + key">
|
||||
<p class="column-label">
|
||||
{{ finderColumn.label ? finderColumn.label : $i18n.get('label_terms_without_parent') }}
|
||||
{{ finderColumn.label ? finderColumn.label : $i18n.get('label_root_terms') }}
|
||||
</p>
|
||||
<ul v-if="finderColumn.children.length">
|
||||
<b-field
|
||||
|
@ -188,37 +188,51 @@
|
|||
:style="{ height: expandResultsSection ? 'auto' : '0px' }"
|
||||
class="modal-card-body tainacan-search-results-container">
|
||||
<ul class="tainacan-modal-checkbox-search-results-body">
|
||||
<li
|
||||
class="tainacan-li-search-results"
|
||||
v-for="(option, key) in searchResults"
|
||||
:key="key">
|
||||
<label
|
||||
v-if="isCheckbox"
|
||||
class="b-checkbox checkbox">
|
||||
<input
|
||||
<template v-if="searchResults.length">
|
||||
<li
|
||||
class="tainacan-li-search-results"
|
||||
v-for="(option, key) in searchResults"
|
||||
:key="key">
|
||||
<label
|
||||
v-if="isCheckbox"
|
||||
class="b-checkbox checkbox">
|
||||
<input
|
||||
v-model="selected"
|
||||
:value="option.id ? (isNaN(Number(option.id)) ? option.id : Number(option.id)) : (isNaN(Number(option.value)) ? option.value : Number(option.value))"
|
||||
type="checkbox">
|
||||
<span class="check" />
|
||||
<span class="control-label">
|
||||
<span
|
||||
class="checkbox-label-text"
|
||||
v-html="`${ option.name ? option.name : (option.label ? (option.hierarchy_path ? renderHierarchicalPath(option.hierarchy_path, option.label) : option.label) : '') }`" />
|
||||
</span>
|
||||
</label>
|
||||
<b-radio
|
||||
v-tooltip="{
|
||||
content: option.name ? option.name : option.label,
|
||||
autoHide: false,
|
||||
}"
|
||||
v-else
|
||||
v-model="selected"
|
||||
:value="option.id ? (isNaN(Number(option.id)) ? option.id : Number(option.id)) : (isNaN(Number(option.value)) ? option.value : Number(option.value))"
|
||||
type="checkbox">
|
||||
<span class="check" />
|
||||
<span class="control-label">
|
||||
:native-value="option.id ? (isNaN(Number(option.id)) ? option.id : Number(option.value)) : (isNaN(Number(option.value)) ? option.value : Number(option.value))">
|
||||
<span
|
||||
class="checkbox-label-text"
|
||||
v-html="`${ option.name ? option.name : (option.label ? (option.hierarchy_path ? renderHierarchicalPath(option.hierarchy_path, option.label) : option.label) : '') }`" />
|
||||
</span>
|
||||
</label>
|
||||
<b-radio
|
||||
v-tooltip="{
|
||||
content: option.name ? option.name : option.label,
|
||||
autoHide: false,
|
||||
}"
|
||||
v-else
|
||||
v-model="selected"
|
||||
:native-value="option.id ? (isNaN(Number(option.id)) ? option.id : Number(option.value)) : (isNaN(Number(option.value)) ? option.value : Number(option.value))">
|
||||
<span
|
||||
class="checkbox-label-text"
|
||||
v-html="`${ option.name ? option.name : (option.label ? (option.hierarchy_path ? renderHierarchicalPath(option.hierarchy_path, option.label) : option.label) : '') }`" />
|
||||
</b-radio>
|
||||
</li>
|
||||
class="checkbox-label-text"
|
||||
v-html="`${ option.name ? option.name : (option.label ? (option.hierarchy_path ? renderHierarchicalPath(option.hierarchy_path, option.label) : option.label) : '') }`" />
|
||||
</b-radio>
|
||||
</li>
|
||||
</template>
|
||||
<template v-if="!isLoadingSearch && !searchResults.length">
|
||||
<li class="tainacan-li-search-results result-info">
|
||||
{{ $i18n.get('info_no_terms_found') }}
|
||||
</li>
|
||||
</template>
|
||||
<template v-if="!isLoadingSearch && allowNew && !searchResults.length">
|
||||
<li class="tainacan-li-search-results result-info">
|
||||
<a @click="$emit('showAddNewTerm', { name: optionName })">
|
||||
{{ $i18n.get('label_new_term') + ' "' + optionName + '"' }}
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
<b-loading
|
||||
:is-full-page="false"
|
||||
:active.sync="isLoadingSearch"/>
|
||||
|
@ -227,7 +241,7 @@
|
|||
|
||||
</b-tab-item>
|
||||
|
||||
<b-tab-item :label="isTaxonomy ? $i18n.get('label_selected_terms') : $i18n.get('label_selected_metadatum_values')">
|
||||
<b-tab-item :label="(isTaxonomy ? $i18n.get('label_selected_terms') : $i18n.get('label_selected_metadatum_values')) + (amountSelected !== null && amountSelected !== undefined ? (' (' + amountSelected + ')' ): '') ">
|
||||
|
||||
<div class="modal-card-body tainacan-tags-container">
|
||||
<b-field
|
||||
|
@ -294,6 +308,7 @@
|
|||
metadatumId: Number,
|
||||
metadatum: Object,
|
||||
selected: Array,
|
||||
allowNew: Boolean,
|
||||
isTaxonomy: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
@ -303,7 +318,8 @@
|
|||
isCheckbox: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
amountSelected: 0
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -358,6 +374,7 @@
|
|||
this.$parent.$on('update-taxonomy-inputs', ($event) => {
|
||||
if ($event.taxonomyId == this.taxonomy_id && $event.metadatumId == this.metadatumId) {
|
||||
this.finderColumns = [];
|
||||
this.optionName = '';
|
||||
this.hierarchicalPath = [];
|
||||
this.isSearching = false;
|
||||
this.searchResults = [];
|
||||
|
@ -733,7 +750,7 @@
|
|||
margin-bottom: 0 !important;
|
||||
|
||||
ul {
|
||||
padding: none;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.hidden-tabs-section /deep/ .tabs {
|
||||
|
@ -792,9 +809,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&:hover:not(.result-info) {
|
||||
background-color: var(--tainacan-gray1);
|
||||
}
|
||||
&.result-info {
|
||||
width: 100%;
|
||||
column-span: all;
|
||||
font-size: 0.75em;
|
||||
}
|
||||
}
|
||||
|
||||
.tainacan-li-checkbox-modal {
|
||||
|
@ -947,6 +969,7 @@
|
|||
.button {
|
||||
border-radius: 0 !important;
|
||||
min-height: 100%;
|
||||
background-color: var(--tainacan-input-background-color);
|
||||
border: 1px solid var(--tainacan-input-border-color);
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
@ -1017,6 +1040,10 @@
|
|||
.tags.is-small {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
section p {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
}
|
||||
|
||||
.tainacan-modal-checkbox-search-results-body {
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
<template>
|
||||
<b-field
|
||||
v-if="collections && collections.length"
|
||||
class="filter-item-forms">
|
||||
<b-collapse
|
||||
aria-id="collection-filters-collapse"
|
||||
class="show"
|
||||
:open="collections.length != 1 ? open : false"
|
||||
animation="filter-item">
|
||||
<label
|
||||
class="label"
|
||||
slot="trigger"
|
||||
slot-scope="props">
|
||||
<span class="icon is-right">
|
||||
<i
|
||||
:class="{ 'tainacan-icon-arrowdown': props.open, 'tainacan-icon-arrowright': !props.open }"
|
||||
class="tainacan-icon tainacan-icon-1-25em" />
|
||||
</span>
|
||||
{{ $i18n.get('collections') }}
|
||||
</label>
|
||||
|
||||
<div
|
||||
v-if="collections.length > 1"
|
||||
class="block">
|
||||
<div
|
||||
v-for="(collection, key) in collections"
|
||||
:key="key"
|
||||
class="control">
|
||||
<b-checkbox
|
||||
v-model="collectionsIdsToFilter"
|
||||
:native-value="collection.id"
|
||||
@input="applyFilter">
|
||||
{{ collection.name }}
|
||||
</b-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="block">
|
||||
<div
|
||||
v-for="(collection, key) in collections"
|
||||
:key="key"
|
||||
class="control">
|
||||
<b-checkbox
|
||||
v-model="fakeTrueValue"
|
||||
:disabled="true"
|
||||
:native-value="true">
|
||||
{{ collection.name }}
|
||||
</b-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</b-collapse>
|
||||
</b-field>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'CollectionFilter',
|
||||
props: {
|
||||
query: Object,
|
||||
open: false,
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
inputs: [],
|
||||
collectionsIdsToFilter: [],
|
||||
fakeTrueValue: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
collections(){
|
||||
return this.getCollections();
|
||||
},
|
||||
},
|
||||
created(){
|
||||
this.fetchCollections({
|
||||
page: 1,
|
||||
collectionsPerPage: -1,
|
||||
status: null,
|
||||
contextEdit: false
|
||||
});
|
||||
},
|
||||
mounted(){
|
||||
let routeQueries = this.$route.query;
|
||||
|
||||
if(routeQueries.metaquery &&
|
||||
routeQueries.metaquery[0] &&
|
||||
Array.isArray(routeQueries.metaquery[0].value)){
|
||||
this.collectionsIdsToFilter = routeQueries.metaquery[0].value;
|
||||
|
||||
this.applyFilter();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions('search', [
|
||||
'setPage'
|
||||
]),
|
||||
...mapActions('collection', [
|
||||
'fetchCollections'
|
||||
]),
|
||||
...mapGetters('collection', [
|
||||
'getCollections',
|
||||
]),
|
||||
applyFilter(){
|
||||
this.$eventBusSearch.$emit( 'input', {
|
||||
filter: 'checkbox',
|
||||
metadatum_id: 'collection_id',
|
||||
value: this.collectionsIdsToFilter,
|
||||
compare: 'IN',
|
||||
collection_id: this.collectionsIdsToFilter,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -9,7 +9,7 @@
|
|||
</a>
|
||||
<div class="help-tooltip">
|
||||
<div class="help-tooltip-header">
|
||||
<h5>{{ title }}</h5>
|
||||
<h5 class="has-text-color">{{ title }}</h5>
|
||||
</div>
|
||||
<div class="help-tooltip-body">
|
||||
<p v-html="(message != '' && message != undefined) ? message : $i18n.get('info_no_description_provided')"/>
|
||||
|
@ -49,8 +49,7 @@ export default {
|
|||
}
|
||||
.help-tooltip {
|
||||
z-index: 99999999999999999999;
|
||||
color: var(--tainacan-turquoise5);
|
||||
background-color: var(--tainacan-turquoise2);
|
||||
background-color: var(--tainacan-primary);
|
||||
border: none;
|
||||
display: block;
|
||||
border-radius: 5px;
|
||||
|
@ -70,6 +69,9 @@ export default {
|
|||
h5 {
|
||||
font-size: 0.875em;
|
||||
font-weight: bold;
|
||||
color: var(--tainacan-secondary);
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,11 +79,14 @@ export default {
|
|||
padding: 0.5em 1.0em 1.0em 1.0em;
|
||||
|
||||
p {
|
||||
margin: 0 0 0.125em 0;
|
||||
font-size: 0.875em !important;
|
||||
font-weight: normal !important;
|
||||
white-space: normal !important;
|
||||
overflow: visible !important;
|
||||
max-height: 100% !important;
|
||||
line-height: normal;
|
||||
color: var(--tainacan-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,7 +100,7 @@ export default {
|
|||
border-style: solid;
|
||||
}
|
||||
&:before {
|
||||
border-color: var(--tainacan-turquoise2) transparent transparent transparent;
|
||||
border-color: var(--tainacan-primary) transparent transparent transparent;
|
||||
border-right-width: 15px;
|
||||
border-top-width: 12px;
|
||||
border-left-width: 15px;
|
||||
|
|
|
@ -13,16 +13,23 @@
|
|||
</div>
|
||||
<div class="help-tooltip-body">
|
||||
<ol>
|
||||
<li
|
||||
v-for="(error, index) of formErrors"
|
||||
:key="index">
|
||||
<a
|
||||
v-if="metadataElements[error.metadatum_id + (error.parent_meta_id ? ('_parent_meta_id-' + error.parent_meta_id) : '')]"
|
||||
@click="metadataElements[error.metadatum_id + (error.parent_meta_id ? ('_parent_meta_id-' + error.parent_meta_id) : '')].scrollIntoView({ behavior: 'smooth', block: 'center' })">
|
||||
{{ getErrorMessage(error.errors) }}
|
||||
</a>
|
||||
<p v-else>{{ getErrorMessage(error.errors) }}</p>
|
||||
</li>
|
||||
<template v-for="(error, index) of formErrors">
|
||||
<li
|
||||
v-if="error.errors.length"
|
||||
:key="index">
|
||||
<a
|
||||
v-if="['thumbnail', 'attachments', 'document'].includes(error.metadatum_id)"
|
||||
@click="metadataElements[error.metadatum_id].scrollIntoView({ behavior: 'smooth', block: 'center' })">
|
||||
{{ getErrorMessage(error.errors) }}
|
||||
</a>
|
||||
<a
|
||||
v-else-if="metadataElements[error.metadatum_id + (error.parent_meta_id ? ('_parent_meta_id-' + error.parent_meta_id) : '')]"
|
||||
@click="metadataElements[error.metadatum_id + (error.parent_meta_id ? ('_parent_meta_id-' + error.parent_meta_id) : '')].scrollIntoView({ behavior: 'smooth', block: 'center' })">
|
||||
{{ getErrorMessage(error.errors) }}
|
||||
</a>
|
||||
<p v-else>{{ getErrorMessage(error.errors) }}</p>
|
||||
</li>
|
||||
</template>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -43,9 +50,13 @@ export default {
|
|||
methods: {
|
||||
getErrorMessage(errors) {
|
||||
let metadatumErrorMessage = '';
|
||||
for (let singleError of errors) {
|
||||
for (let index of Object.keys(singleError))
|
||||
metadatumErrorMessage += singleError[index] + '\n';
|
||||
for (let singleError of errors) {
|
||||
if (typeof singleError != 'string') {
|
||||
for (let index of Object.keys(singleError))
|
||||
metadatumErrorMessage += singleError[index] + '\n';
|
||||
} else {
|
||||
metadatumErrorMessage += singleError;
|
||||
}
|
||||
}
|
||||
return metadatumErrorMessage;
|
||||
},
|
||||
|
@ -99,6 +110,9 @@ export default {
|
|||
h5 {
|
||||
font-size: 0.875em;
|
||||
font-weight: bold;
|
||||
color: var(--tainacan-red2);
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,15 +125,22 @@ export default {
|
|||
font-weight: normal !important;
|
||||
white-space: normal !important;
|
||||
overflow: visible !important;
|
||||
line-height: normal;
|
||||
color: var(--tainacan-red2) !important;
|
||||
}
|
||||
a {
|
||||
color: var(--tainacan-red2);
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
color: var(--tainacan-red2) !important;
|
||||
}
|
||||
ol, ul {
|
||||
margin: 4px 4px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
li {
|
||||
line-height: 0.875em;
|
||||
}
|
||||
}
|
||||
&:before {
|
||||
content: "";
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue