Merge branch 'release/0.17'
|
@ -31,6 +31,7 @@ module.exports = {
|
|||
'_': true,
|
||||
'jQuery': true,
|
||||
'tainacan_extra_components': true,
|
||||
'tainacan_extra_plugins': true
|
||||
'tainacan_extra_plugins': true,
|
||||
'grecaptcha': true
|
||||
}
|
||||
}
|
|
@ -59,6 +59,7 @@ notifications:
|
|||
email:
|
||||
on_success: never
|
||||
on_failure: always
|
||||
webhooks: https://outlook.office.com/webhook/97d79f61-0a43-4507-b3a4-a3e49ee326af@ec359ba1-630b-4d2b-b833-c8e6d48f8059/TravisCI/34eedbb413764c7c8419770568fde8b0/fc57ac3f-1d1d-4b56-998e-a856914f54f0
|
||||
env:
|
||||
global:
|
||||
- secure: LnUpxgHL/Qgpbg20mRErlnwb8tvNs6f7uPRe9c82UuMP69uDZeD3K5GNzL6u0Y+C/zNHk7tCnUszDC7FtQAij6qi72HHW2zz4zVJ+DFI3b+hx7+rSKsjtbnJChTbknSu3rW+yHYRTIUZJQ/Tg6thDLKzU0a4VRb+ickDpRYLyP+Cf4+xs7rwAhjiboMNIGXahrCpnbhctmOhRgZaHvfnPB9prRs5lOCCBQqSwMmjEo7OJeCCUjfpU5xq3EjUEzwjzzBlSf3240PS/LOBFr2iGF30VT9LDTb1iUZU1gTcaxaK+/EjKLG/wtcH8TOaLJpsksbnMkSTrG3ICblXl1G4Itu8IHzLgOmWoiWIVXZ4y17aYyj/y7YZtX+fjB6qs9RG5ZnSpHkSDEni8CCC8Ltf9jVSkLEust/bNLgkd02hJ4xtVxOaoBYEh3hcylJ/co8BTDdbNyT3BwrFc4f2jfRh5DYzyrKaTG5IJAT2BfyjD/BsxBE3EgIuJFja1zVJKMcuCmogDiHi6sb0zhF+LbLy0nXqvysTrMEYbDppVYQloz3BKb2v2m/jc89G7v8AjnvwTUgj64PUj+p10ngfIA+FHPILLtd/fNm0zRIRDqSfE7rpGZo9EoZ9jq0wVSmy0DK8kFTX+9RFW8xYmFnTgB3beKWqdK9CAqXEeeD3ABejXTc=
|
||||
|
|
6
build.sh
|
@ -78,6 +78,10 @@ rsync -axz --exclude='vendor/bin/phpc*' --exclude='vendor/squizlabs' --exclude='
|
|||
src/* $wp_plugin_dir/
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
|
|
@ -2362,11 +2362,11 @@
|
|||
}
|
||||
},
|
||||
"buefy": {
|
||||
"version": "0.8.18",
|
||||
"resolved": "https://registry.npmjs.org/buefy/-/buefy-0.8.18.tgz",
|
||||
"integrity": "sha512-7Fem39I1beQm8Xi+1OFtyy6JksnmANc4h+pQ420JhY04tyefGyuQc7EiZ6GUcbCezu1WxTsdvSv0Kz/JB8aZNw==",
|
||||
"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.7.5"
|
||||
"bulma": "0.9.1"
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
|
@ -2405,9 +2405,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"bulma": {
|
||||
"version": "0.7.5",
|
||||
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.7.5.tgz",
|
||||
"integrity": "sha512-cX98TIn0I6sKba/DhW0FBjtaDpxTelU166pf7ICXpCCuplHWyu6C9LYZmL5PEsnePIeJaiorsTEzzNk3Tsm1hw=="
|
||||
"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",
|
||||
|
@ -3435,11 +3435,11 @@
|
|||
}
|
||||
},
|
||||
"dom7": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/dom7/-/dom7-2.1.2.tgz",
|
||||
"integrity": "sha512-cGwWtpu7KY3JnbREGqG4EGC/u+1hyLfWVMqrqRjmwiO8d5i4B+0imLZAQ/cJbiXnjbs0pdIUzcUyeI9BbnyKNg==",
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/dom7/-/dom7-2.1.5.tgz",
|
||||
"integrity": "sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==",
|
||||
"requires": {
|
||||
"ssr-window": "^1.0.1"
|
||||
"ssr-window": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"domain-browser": {
|
||||
|
@ -3494,9 +3494,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"elliptic": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz",
|
||||
"integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
||||
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bn.js": "^4.4.0",
|
||||
|
@ -3673,9 +3673,9 @@
|
|||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"version": "4.17.19",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
|
||||
"dev": true
|
||||
},
|
||||
"ms": {
|
||||
|
@ -4433,13 +4433,10 @@
|
|||
}
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.11.0.tgz",
|
||||
"integrity": "sha512-KZm0V+ll8PfBrKwMzdo5D13b1bur9Iq9Zd/RMmAoQQcl2PxxFml8cxXPaaPYVbV0RjNjq1CU7zIzAOqtUPudmA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^3.0.0"
|
||||
}
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.12.1.tgz",
|
||||
"integrity": "sha512-tmRv0AVuR7ZyouUHLeNSiO6pqulF7dYa3s19c6t+wz9LD69/uSzdMxJ2S91nTI9U3rt/IldxpzMOFejp6f0hjg==",
|
||||
"dev": true
|
||||
},
|
||||
"for-in": {
|
||||
"version": "1.0.2",
|
||||
|
@ -5471,9 +5468,9 @@
|
|||
}
|
||||
},
|
||||
"http-proxy": {
|
||||
"version": "1.18.0",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz",
|
||||
"integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==",
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
|
||||
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"eventemitter3": "^4.0.0",
|
||||
|
@ -5810,9 +5807,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"version": "4.17.19",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
|
||||
"dev": true
|
||||
},
|
||||
"string-width": {
|
||||
|
@ -6418,9 +6415,9 @@
|
|||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
|
||||
"version": "4.17.19",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
|
||||
},
|
||||
"loglevel": {
|
||||
"version": "1.6.8",
|
||||
|
@ -6743,24 +6740,6 @@
|
|||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"mississippi": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
|
||||
"integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"concat-stream": "^1.5.0",
|
||||
"duplexify": "^3.4.2",
|
||||
"end-of-stream": "^1.1.0",
|
||||
"flush-write-stream": "^1.0.0",
|
||||
"from2": "^2.1.0",
|
||||
"parallel-transform": "^1.1.0",
|
||||
"pump": "^3.0.0",
|
||||
"pumpify": "^1.3.3",
|
||||
"stream-each": "^1.1.0",
|
||||
"through2": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"mixin-deep": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
|
||||
|
@ -8940,12 +8919,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz",
|
||||
"integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==",
|
||||
"dev": true
|
||||
},
|
||||
"serve-index": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
|
||||
|
@ -9452,18 +9425,9 @@
|
|||
}
|
||||
},
|
||||
"ssr-window": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-1.0.1.tgz",
|
||||
"integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg=="
|
||||
},
|
||||
"ssri": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
|
||||
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"figgy-pudding": "^3.5.1"
|
||||
}
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-2.0.0.tgz",
|
||||
"integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
|
||||
},
|
||||
"static-extend": {
|
||||
"version": "0.1.2",
|
||||
|
@ -9971,12 +9935,12 @@
|
|||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
||||
},
|
||||
"swiper": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/swiper/-/swiper-4.4.1.tgz",
|
||||
"integrity": "sha512-SONgpB1mFh++eFiUDOCggwW2ZzsWMEf3+SEROcQ+qXPYUnyD423l3uDsk+0jdo/a4pXeOJmH0oN3XK5maMqQyQ==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/swiper/-/swiper-5.4.5.tgz",
|
||||
"integrity": "sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA==",
|
||||
"requires": {
|
||||
"dom7": "^2.1.2",
|
||||
"ssr-window": "^1.0.1"
|
||||
"dom7": "^2.1.5",
|
||||
"ssr-window": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"t": {
|
||||
|
@ -10009,9 +9973,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"version": "4.17.19",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
|
||||
"dev": true
|
||||
},
|
||||
"string-width": {
|
||||
|
@ -10052,25 +10016,6 @@
|
|||
"inherits": "2"
|
||||
}
|
||||
},
|
||||
"terser": {
|
||||
"version": "4.6.3",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz",
|
||||
"integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"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": "2.3.6",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.6.tgz",
|
||||
|
@ -10207,10 +10152,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz",
|
||||
"integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==",
|
||||
"dev": true
|
||||
"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",
|
||||
|
@ -10703,13 +10651,9 @@
|
|||
"integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ=="
|
||||
},
|
||||
"vue-awesome-swiper": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-3.1.3.tgz",
|
||||
"integrity": "sha512-E7suzkyApO8vNZbgdEnjSmnpsmQZyRvSVXJ7sey3XYwKPOkLhH3+GnHroBw+5PZIQXvWBwdCeQsPG1xQ1r1Rhg==",
|
||||
"requires": {
|
||||
"object-assign": "^4.1.1",
|
||||
"swiper": "^4.0.7"
|
||||
}
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-4.1.1.tgz",
|
||||
"integrity": "sha512-50um10t6N+lJaORkpwSi1wWuMmBI1sgFc9Znsi5oUykw2cO5DzLaBHcO2JNX21R+Ue4TGoIJDhhxjBHtkFrTEQ=="
|
||||
},
|
||||
"vue-eslint-parser": {
|
||||
"version": "5.0.0",
|
||||
|
@ -10906,12 +10850,6 @@
|
|||
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
|
||||
"dev": true
|
||||
},
|
||||
"cacache": {
|
||||
"version": "12.0.4",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz",
|
||||
|
@ -10933,6 +10871,35 @@
|
|||
"ssri": "^6.0.1",
|
||||
"unique-filename": "^1.1.1",
|
||||
"y18n": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"mississippi": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
|
||||
"integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"concat-stream": "^1.5.0",
|
||||
"duplexify": "^3.4.2",
|
||||
"end-of-stream": "^1.1.0",
|
||||
"flush-write-stream": "^1.0.0",
|
||||
"from2": "^2.1.0",
|
||||
"parallel-transform": "^1.1.0",
|
||||
"pump": "^3.0.0",
|
||||
"pumpify": "^1.3.3",
|
||||
"stream-each": "^1.1.0",
|
||||
"through2": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"ssri": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
|
||||
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"figgy-pudding": "^3.5.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"emojis-list": {
|
||||
|
@ -10947,26 +10914,6 @@
|
|||
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
|
||||
"dev": true
|
||||
},
|
||||
"find-cache-dir": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
|
||||
"integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commondir": "^1.0.1",
|
||||
"make-dir": "^2.0.0",
|
||||
"pkg-dir": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"find-up": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
|
||||
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"locate-path": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
|
@ -11007,16 +10954,6 @@
|
|||
"json5": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-locate": "^3.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
|
||||
|
@ -11026,67 +10963,12 @@
|
|||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
|
||||
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pify": "^4.0.1",
|
||||
"semver": "^5.6.0"
|
||||
}
|
||||
},
|
||||
"neo-async": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
|
||||
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
|
||||
"dev": true
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"p-locate": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
|
||||
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-limit": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"p-try": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||
"dev": true
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
|
||||
"dev": true
|
||||
},
|
||||
"pify": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
||||
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
|
||||
"dev": true
|
||||
},
|
||||
"pkg-dir": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
|
||||
"integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
|
@ -11096,12 +10978,6 @@
|
|||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
|
@ -11115,28 +10991,53 @@
|
|||
"dev": true
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz",
|
||||
"integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==",
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz",
|
||||
"integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cacache": "^12.0.2",
|
||||
"find-cache-dir": "^2.1.0",
|
||||
"is-wsl": "^1.1.0",
|
||||
"schema-utils": "^1.0.0",
|
||||
"serialize-javascript": "^2.1.2",
|
||||
"serialize-javascript": "^4.0.0",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^4.1.2",
|
||||
"webpack-sources": "^1.4.0",
|
||||
"worker-farm": "^1.7.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"serialize-javascript": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz",
|
||||
"integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"terser": {
|
||||
"version": "4.8.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz",
|
||||
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^2.20.0",
|
||||
"source-map": "~0.6.1",
|
||||
"source-map-support": "~0.5.12"
|
||||
}
|
||||
},
|
||||
"worker-farm": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz",
|
||||
"integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"errno": "~0.1.7"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"y18n": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
|
||||
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
|
@ -11844,9 +11745,9 @@
|
|||
}
|
||||
},
|
||||
"websocket-extensions": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",
|
||||
"integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
|
||||
"integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
|
@ -11876,15 +11777,6 @@
|
|||
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
|
||||
"dev": true
|
||||
},
|
||||
"worker-farm": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz",
|
||||
"integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"errno": "~0.1.7"
|
||||
}
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"buefy": "^0.8.18",
|
||||
"bulma": "^0.7.5",
|
||||
"buefy": "^0.9.4",
|
||||
"bulma": "^0.9.1",
|
||||
"css-vars-ponyfill": "^2.3.1",
|
||||
"mdi": "^2.2.43",
|
||||
"moment": "^2.25.3",
|
||||
|
@ -17,10 +17,11 @@
|
|||
"qs": "^6.9.4",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"swiper": "^5.2.0",
|
||||
"t": "^0.5.1",
|
||||
"v-tooltip": "^2.0.3",
|
||||
"vue": "^2.6.11",
|
||||
"vue-awesome-swiper": "^3.1.3",
|
||||
"vue-awesome-swiper": "^4.1.1",
|
||||
"vue-masonry-css": "^1.0.3",
|
||||
"vue-router": "^3.1.6",
|
||||
"vue-the-mask": "^0.11.1",
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -66,7 +66,9 @@
|
|||
background: var(--tainacan-block-gray1, #f2f2f2); }
|
||||
|
||||
.wp-block-tainacan-carousel-collections-list {
|
||||
margin: 2em auto; }
|
||||
margin: 2em auto;
|
||||
--swiper-navigation-color: var(--tainacan-block-primary, $primary);
|
||||
--swiper-theme-color: var(--tainacan-block-primary, $primary); }
|
||||
.wp-block-tainacan-carousel-collections-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1em;
|
||||
|
@ -117,7 +119,7 @@
|
|||
margin: 0 50px; }
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container a > span,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .swiper-container a:hover > span {
|
||||
color: var(--tainacan-block-gray5);
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
padding: 8px 16px;
|
||||
|
@ -160,7 +162,8 @@
|
|||
font-style: italic;
|
||||
color: var(--tainacan-block-gray4, #555758);
|
||||
text-align: center;
|
||||
margin: 4px auto; }
|
||||
margin: 0 auto;
|
||||
padding: 8px 2px 2px 2px; }
|
||||
.wp-block-tainacan-carousel-collections-list .swiper-button-prev, .wp-block-tainacan-carousel-collections-list .swiper-button-next {
|
||||
top: calc(50% - 42px);
|
||||
bottom: initial;
|
||||
|
@ -172,6 +175,8 @@
|
|||
margin: 0 -4px; }
|
||||
.wp-block-tainacan-carousel-collections-list .swiper-button-prev svg, .wp-block-tainacan-carousel-collections-list .swiper-button-next svg {
|
||||
fill: var(--tainacan-block-primary, #298596); }
|
||||
.wp-block-tainacan-carousel-collections-list .swiper-button-prev::after, .wp-block-tainacan-carousel-collections-list .swiper-button-prev::before, .wp-block-tainacan-carousel-collections-list .swiper-button-next::after, .wp-block-tainacan-carousel-collections-list .swiper-button-next::before {
|
||||
content: none !important; }
|
||||
.wp-block-tainacan-carousel-collections-list.alignfull .swiper-button-prev, .wp-block-tainacan-carousel-collections-list .swiper-button-next {
|
||||
margin: 0 6px; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container,
|
||||
|
@ -179,36 +184,58 @@
|
|||
position: relative; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container .skeleton,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel .skeleton {
|
||||
min-height: 150px;
|
||||
max-height: 150px; }
|
||||
min-height: 150px; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-arrows-none .swiper-button-prev, .wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-arrows-none .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-arrows-none .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-arrows-none .swiper-button-next {
|
||||
display: none; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-arrows-left .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-arrows-left .swiper-button-next {
|
||||
left: 10px;
|
||||
left: 0px;
|
||||
right: auto;
|
||||
top: calc(50% + 12px) !important; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-arrows-right .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-arrows-right .swiper-button-prev {
|
||||
right: 10px;
|
||||
right: 20px;
|
||||
left: auto; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-arrows-right .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-arrows-right .swiper-button-next {
|
||||
top: calc(50% + 12px) !important; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-large-arrows .swiper-button-prev, .wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-large-arrows .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-large-arrows .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-large-arrows .swiper-button-next {
|
||||
top: calc(50% - 60px);
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin: 0 -24px; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-large-arrows.has-arrows-left .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-large-arrows.has-arrows-left .swiper-button-next {
|
||||
left: 10px;
|
||||
right: auto;
|
||||
top: calc(50% + 30px) !important; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-large-arrows.has-arrows-right .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-large-arrows.has-arrows-right .swiper-button-prev {
|
||||
right: 10px;
|
||||
left: auto; }
|
||||
.wp-block-tainacan-carousel-collections-list .collections-list-edit-container.has-large-arrows.has-arrows-right .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-collections-list .tainacan-carousel.has-large-arrows.has-arrows-right .swiper-button-next {
|
||||
top: calc(50% + 30px) !important; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
overflow-x: scroll;
|
||||
list-style: none;
|
||||
margin: 0 36px; }
|
||||
margin: 0 36px;
|
||||
scroll-snap-type: x mandatory;
|
||||
scroll-padding-left: 10px; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin: 16px 32px 16px 0px;
|
||||
width: calc(16.666% - 32px);
|
||||
min-width: calc(16.666% - 32px); }
|
||||
min-width: calc(16.666% - 32px);
|
||||
scroll-snap-align: start;
|
||||
scroll-margin: 0 16px; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.collection-list-item-grid {
|
||||
margin: 16px;
|
||||
width: calc(25% - 16px);
|
||||
|
@ -220,7 +247,9 @@
|
|||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item img {
|
||||
height: auto;
|
||||
padding: 0px;
|
||||
margin-bottom: 0.5em; }
|
||||
margin-bottom: 0.5em;
|
||||
display: block;
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item:hover a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
text-decoration: none; }
|
||||
|
@ -251,6 +280,33 @@
|
|||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item:hover button:hover {
|
||||
background-color: white !important;
|
||||
border: 1px solid var(--tainacan-block-gray3, #cbcbcb) !important; }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-9 {
|
||||
width: calc((100% / 9) - 32px);
|
||||
min-width: calc((100% / 9) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-8 {
|
||||
width: calc((100% / 8) - 32px);
|
||||
min-width: calc((100% / 8) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-7 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-6 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-5 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-4 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-3 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-2 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item .collection-items-grid {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
|
@ -273,22 +329,112 @@
|
|||
@media only screen and (max-width: 1686px) {
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item {
|
||||
width: calc(20% - 32px);
|
||||
min-width: calc(20% - 32px); } }
|
||||
min-width: calc(20% - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-9 {
|
||||
width: calc((100% / 8) - 32px);
|
||||
min-width: calc((100% / 8) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-8 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-7 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-6 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-5 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-4 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-3 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-2, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 1452px) {
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item {
|
||||
width: calc(25% - 32px);
|
||||
min-width: calc(25% - 32px); } }
|
||||
min-width: calc(25% - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-9 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-8 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-7 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-6 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-5 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-4 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-3, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-2, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 1118px) {
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-edit li.collection-list-item {
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item {
|
||||
width: calc(33.333% - 32px);
|
||||
min-width: calc(33.333% - 32px); } }
|
||||
min-width: calc(33.333% - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-9 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-8 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-7 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-6 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-5 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-4, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-3, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-2, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 854px) {
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item {
|
||||
width: calc(50% - 32px);
|
||||
min-width: calc(50% - 32px); } }
|
||||
min-width: calc(50% - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-9 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-8 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-7 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-6 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-5, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-4, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-3, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-2, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 584px) {
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
min-width: calc(100% - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-9 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-8 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-7 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-6, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-5, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-4, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-3, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-2, .wp-block-tainacan-carousel-collections-list ul.collections-list-edit li.collection-list-item.max-collections-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-carousel-collections-list.css.map */
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
.wp-block-tainacan-carousel-items-list {
|
||||
margin: 2em auto; }
|
||||
margin: 2em auto;
|
||||
--swiper-navigation-color: var(--tainacan-block-primary, $primary);
|
||||
--swiper-theme-color: var(--tainacan-block-primary, $primary); }
|
||||
.wp-block-tainacan-carousel-items-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1em;
|
||||
|
@ -141,7 +143,8 @@
|
|||
font-style: italic;
|
||||
color: var(--tainacan-block-gray4, #555758);
|
||||
text-align: center;
|
||||
margin: 4px auto; }
|
||||
margin: 0 auto;
|
||||
padding: 8px 2px 2px 2px; }
|
||||
.wp-block-tainacan-carousel-items-list .swiper-button-prev, .wp-block-tainacan-carousel-items-list .swiper-button-next {
|
||||
top: calc(50% - 42px);
|
||||
bottom: initial;
|
||||
|
@ -153,13 +156,14 @@
|
|||
margin: 0 -4px; }
|
||||
.wp-block-tainacan-carousel-items-list .swiper-button-prev svg, .wp-block-tainacan-carousel-items-list .swiper-button-next svg {
|
||||
fill: var(--tainacan-block-primary, #298596); }
|
||||
.wp-block-tainacan-carousel-items-list .swiper-button-prev::after, .wp-block-tainacan-carousel-items-list .swiper-button-prev::before, .wp-block-tainacan-carousel-items-list .swiper-button-next::after, .wp-block-tainacan-carousel-items-list .swiper-button-next::before {
|
||||
content: none !important; }
|
||||
.wp-block-tainacan-carousel-items-list .items-list-edit-container,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel {
|
||||
position: relative; }
|
||||
.wp-block-tainacan-carousel-items-list .items-list-edit-container .skeleton,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel .skeleton {
|
||||
min-height: 150px;
|
||||
max-height: 150px; }
|
||||
min-height: 150px; }
|
||||
.wp-block-tainacan-carousel-items-list .items-list-edit-container.has-arrows-none .swiper-button-prev, .wp-block-tainacan-carousel-items-list .items-list-edit-container.has-arrows-none .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-arrows-none .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-arrows-none .swiper-button-next {
|
||||
|
@ -176,18 +180,41 @@
|
|||
.wp-block-tainacan-carousel-items-list .items-list-edit-container.has-arrows-right .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-arrows-right .swiper-button-next {
|
||||
top: calc(50% + 12px) !important; }
|
||||
.wp-block-tainacan-carousel-items-list .items-list-edit-container.has-large-arrows .swiper-button-prev, .wp-block-tainacan-carousel-items-list .items-list-edit-container.has-large-arrows .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-large-arrows .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-large-arrows .swiper-button-next {
|
||||
top: calc(50% - 60px);
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin: 0 -24px; }
|
||||
.wp-block-tainacan-carousel-items-list .items-list-edit-container.has-large-arrows.has-arrows-left .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-large-arrows.has-arrows-left .swiper-button-next {
|
||||
left: 30px;
|
||||
right: auto;
|
||||
top: calc(50% + 30px) !important; }
|
||||
.wp-block-tainacan-carousel-items-list .items-list-edit-container.has-large-arrows.has-arrows-right .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-large-arrows.has-arrows-right .swiper-button-prev {
|
||||
right: 30px;
|
||||
left: auto; }
|
||||
.wp-block-tainacan-carousel-items-list .items-list-edit-container.has-large-arrows.has-arrows-right .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-items-list .tainacan-carousel.has-large-arrows.has-arrows-right .swiper-button-next {
|
||||
top: calc(50% + 30px) !important; }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
overflow-x: scroll;
|
||||
list-style: none;
|
||||
margin: 0 36px; }
|
||||
margin: 0 36px;
|
||||
scroll-snap-type: x mandatory;
|
||||
scroll-padding-left: 10px; }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin: 16px;
|
||||
width: calc(14.285% - 32px);
|
||||
min-width: calc(14.285% - 32px); }
|
||||
min-width: calc(14.285% - 32px);
|
||||
scroll-snap-align: start;
|
||||
scroll-margin: 0 16px; }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
font-weight: bold;
|
||||
|
@ -226,25 +253,142 @@
|
|||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item:hover button:hover {
|
||||
background-color: white !important;
|
||||
border: 1px solid var(--tainacan-block-gray3, #cbcbcb) !important; }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-9 {
|
||||
width: calc((100% / 9) - 32px);
|
||||
min-width: calc((100% / 9) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-8 {
|
||||
width: calc((100% / 8) - 32px);
|
||||
min-width: calc((100% / 8) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-7 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-6 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-5 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-4 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-3 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-2 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); }
|
||||
@media only screen and (max-width: 1686px) {
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item {
|
||||
width: calc(16.666% - 32px);
|
||||
min-width: calc(16.666% - 32px); } }
|
||||
min-width: calc(16.666% - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-9 {
|
||||
width: calc((100% / 8) - 32px);
|
||||
min-width: calc((100% / 8) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-8 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-7 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-6 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-5 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-4 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-3 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-2, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 1452px) {
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item {
|
||||
width: calc(20% - 32px);
|
||||
min-width: calc(20% - 32px); } }
|
||||
min-width: calc(20% - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-9 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-8 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-7 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-6 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-5 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-4 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-3, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-2, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 1118px) {
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item {
|
||||
width: calc(25% - 32px);
|
||||
min-width: calc(25% - 32px); } }
|
||||
min-width: calc(25% - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-9 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-8 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-7 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-6 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-5 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-4, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-3, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-2, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 854px) {
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item {
|
||||
width: calc(33.333% - 32px);
|
||||
min-width: calc(33.333% - 32px); } }
|
||||
min-width: calc(33.333% - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-9 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-8 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-7 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-6 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-5, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-4, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-3, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-2, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 584px) {
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item {
|
||||
width: calc(50% - 32px);
|
||||
min-width: calc(50% - 32px); } }
|
||||
min-width: calc(50% - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-9 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-8 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-7 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-6, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-5, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-4, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-3, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-2, .wp-block-tainacan-carousel-items-list ul.items-list-edit li.item-list-item.max-itens-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-carousel-items-list.css.map */
|
||||
|
|
|
@ -66,7 +66,9 @@
|
|||
background: var(--tainacan-block-gray1, #f2f2f2); }
|
||||
|
||||
.wp-block-tainacan-carousel-terms-list {
|
||||
margin: 2em auto; }
|
||||
margin: 2em auto;
|
||||
--swiper-navigation-color: var(--tainacan-block-primary, $primary);
|
||||
--swiper-theme-color: var(--tainacan-block-primary, $primary); }
|
||||
.wp-block-tainacan-carousel-terms-list .spinner-container {
|
||||
min-height: 56px;
|
||||
padding: 1em;
|
||||
|
@ -159,7 +161,8 @@
|
|||
font-style: italic;
|
||||
color: var(--tainacan-block-gray4, #555758);
|
||||
text-align: center;
|
||||
margin: 4px auto; }
|
||||
margin: 0 auto;
|
||||
padding: 8px 2px 2px 2px; }
|
||||
.wp-block-tainacan-carousel-terms-list .swiper-button-prev, .wp-block-tainacan-carousel-terms-list .swiper-button-next {
|
||||
top: calc(50% - 42px);
|
||||
bottom: initial;
|
||||
|
@ -171,6 +174,8 @@
|
|||
margin: 0 -4px; }
|
||||
.wp-block-tainacan-carousel-terms-list .swiper-button-prev svg, .wp-block-tainacan-carousel-terms-list .swiper-button-next svg {
|
||||
fill: var(--tainacan-block-primary, #298596); }
|
||||
.wp-block-tainacan-carousel-terms-list .swiper-button-prev::after, .wp-block-tainacan-carousel-terms-list .swiper-button-prev::before, .wp-block-tainacan-carousel-terms-list .swiper-button-next::after, .wp-block-tainacan-carousel-terms-list .swiper-button-next::before {
|
||||
content: none !important; }
|
||||
.wp-block-tainacan-carousel-terms-list.alignfull .swiper-button-prev, .wp-block-tainacan-carousel-terms-list .swiper-button-next {
|
||||
margin: 0 6px; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container,
|
||||
|
@ -186,28 +191,51 @@
|
|||
display: none; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-arrows-left .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-arrows-left .swiper-button-next {
|
||||
left: 10px;
|
||||
left: 0px;
|
||||
right: auto;
|
||||
top: calc(50% + 12px) !important; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-arrows-right .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-arrows-right .swiper-button-prev {
|
||||
right: 10px;
|
||||
right: 20px;
|
||||
left: auto; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-arrows-right .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-arrows-right .swiper-button-next {
|
||||
top: calc(50% + 12px) !important; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-large-arrows .swiper-button-prev, .wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-large-arrows .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-large-arrows .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-large-arrows .swiper-button-next {
|
||||
top: calc(50% - 60px);
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin: 0 -24px; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-large-arrows.has-arrows-left .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-large-arrows.has-arrows-left .swiper-button-next {
|
||||
left: 10px;
|
||||
right: auto;
|
||||
top: calc(50% + 30px) !important; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-large-arrows.has-arrows-right .swiper-button-prev,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-large-arrows.has-arrows-right .swiper-button-prev {
|
||||
right: 10px;
|
||||
left: auto; }
|
||||
.wp-block-tainacan-carousel-terms-list .terms-list-edit-container.has-large-arrows.has-arrows-right .swiper-button-next,
|
||||
.wp-block-tainacan-carousel-terms-list .tainacan-carousel.has-large-arrows.has-arrows-right .swiper-button-next {
|
||||
top: calc(50% + 30px) !important; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
overflow-x: scroll;
|
||||
list-style: none;
|
||||
margin: 0 36px; }
|
||||
margin: 0 36px;
|
||||
scroll-snap-type: x mandatory;
|
||||
scroll-padding-left: 10px; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin: 16px 32px 16px 0px;
|
||||
width: calc(16.666% - 32px);
|
||||
min-width: calc(16.666% - 32px); }
|
||||
min-width: calc(16.666% - 32px);
|
||||
scroll-snap-align: start;
|
||||
scroll-margin: 0 16px; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.term-list-item-grid {
|
||||
margin: 16px;
|
||||
width: calc(25% - 16px);
|
||||
|
@ -219,7 +247,9 @@
|
|||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item img {
|
||||
height: auto;
|
||||
padding: 0px;
|
||||
margin-bottom: 0.5em; }
|
||||
margin-bottom: 0.5em;
|
||||
display: block;
|
||||
width: 100%; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item:hover a {
|
||||
color: var(--tainacan-block-gray5, #454647);
|
||||
text-decoration: none; }
|
||||
|
@ -250,6 +280,33 @@
|
|||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item:hover button:hover {
|
||||
background-color: white !important;
|
||||
border: 1px solid var(--tainacan-block-gray3, #cbcbcb) !important; }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-9 {
|
||||
width: calc((100% / 9) - 32px);
|
||||
min-width: calc((100% / 9) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-8 {
|
||||
width: calc((100% / 8) - 32px);
|
||||
min-width: calc((100% / 8) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-7 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-6 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-5 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-4 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-3 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-2 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item.max-terms-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item .term-items-grid {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
|
@ -269,25 +326,114 @@
|
|||
flex-basis: 50%;
|
||||
padding: 2px;
|
||||
margin-bottom: 0px; }
|
||||
@media only screen and (max-width: 1686px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item {
|
||||
width: calc(20% - 32px);
|
||||
min-width: calc(20% - 32px); } }
|
||||
@media only screen and (max-width: 1452px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item {
|
||||
width: calc(25% - 32px);
|
||||
min-width: calc(25% - 32px); } }
|
||||
@media only screen and (max-width: 1118px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-edit li.term-list-item {
|
||||
width: calc(33.333% - 32px);
|
||||
min-width: calc(33.333% - 32px); } }
|
||||
@media only screen and (max-width: 854px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item {
|
||||
width: calc(50% - 32px);
|
||||
min-width: calc(50% - 32px); } }
|
||||
@media only screen and (max-width: 584px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.term-list-item {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item {
|
||||
width: calc(20% - 32px);
|
||||
min-width: calc(20% - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-9 {
|
||||
width: calc((100% / 8) - 32px);
|
||||
min-width: calc((100% / 8) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-8 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-7 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-6 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-5 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-4 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-3 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-2, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
min-width: calc(100% - 32px); }
|
||||
@media only screen and (max-width: 1452px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item {
|
||||
width: calc(25% - 32px);
|
||||
min-width: calc(25% - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-9 {
|
||||
width: calc((100% / 7) - 32px);
|
||||
min-width: calc((100% / 7) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-8 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-7 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-6 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-5 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-4 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-3, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-2, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 1118px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item {
|
||||
width: calc(33.333% - 32px);
|
||||
min-width: calc(33.333% - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-9 {
|
||||
width: calc((100% / 6) - 32px);
|
||||
min-width: calc((100% / 6) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-8 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-7 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-6 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-5 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-4, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-3, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-2, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 854px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item {
|
||||
width: calc(50% - 32px);
|
||||
min-width: calc(50% - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-9 {
|
||||
width: calc((100% / 5) - 32px);
|
||||
min-width: calc((100% / 5) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-8 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-7 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-6 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-5, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-4, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-3, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-2, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
@media only screen and (max-width: 584px) {
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-9 {
|
||||
width: calc((100% / 4) - 32px);
|
||||
min-width: calc((100% / 4) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-8 {
|
||||
width: calc((100% / 3) - 32px);
|
||||
min-width: calc((100% / 3) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-7 {
|
||||
width: calc((100% / 2) - 32px);
|
||||
min-width: calc((100% / 2) - 32px); }
|
||||
.wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-6, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-5, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-4, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-3, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-2, .wp-block-tainacan-carousel-terms-list ul.terms-list-edit li.terms-list-item.max-terms-per-screen-1 {
|
||||
width: calc(100% - 32px);
|
||||
min-width: calc(100% - 32px); } }
|
||||
|
||||
/*# sourceMappingURL=tainacan-gutenberg-block-carousel-terms-list.css.map */
|
||||
|
|
|
@ -7,33 +7,6 @@
|
|||
--tainacan-block-gray5: #454647;
|
||||
--tainacan-block-primary: #298596; }
|
||||
|
||||
[data-align='full'] .tainacan-block-control {
|
||||
width: calc(100% + 14px); }
|
||||
|
||||
.tainacan-block-control {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 5px;
|
||||
position: relative;
|
||||
top: -14px;
|
||||
left: -14px;
|
||||
width: calc(100% + 28px);
|
||||
background: var(--tainacan-block-gray1, #f2f2f2); }
|
||||
.tainacan-block-control p {
|
||||
font-size: 0.875em !important;
|
||||
margin: 12px 1.5em !important;
|
||||
fill: var(--tainacan-block-gray4, #555758); }
|
||||
.tainacan-block-control p svg {
|
||||
top: 6px;
|
||||
margin-right: 0.75em;
|
||||
position: relative;
|
||||
fill: var(--tainacan-block-gray4, #555758); }
|
||||
.tainacan-block-control .components-base-control .components-base-control__field {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.tainacan-block-placeholder.components-placeholder {
|
||||
align-items: center !important;
|
||||
margin-bottom: 0 !important;
|
||||
|
@ -46,7 +19,7 @@
|
|||
justify-content: center;
|
||||
align-items: baseline;
|
||||
width: 100%;
|
||||
max-width: 70%;
|
||||
max-width: 85%;
|
||||
flex-wrap: wrap;
|
||||
z-index: 1; }
|
||||
.tainacan-block-placeholder.components-placeholder .components-placeholder__fieldset p {
|
||||
|
@ -59,6 +32,8 @@
|
|||
top: 4px;
|
||||
position: relative;
|
||||
fill: var(--tainacan-block-gray4, #555758); }
|
||||
.tainacan-block-placeholder.components-placeholder .components-placeholder__fieldset .components-button {
|
||||
margin: 0; }
|
||||
|
||||
.wp-block-tainacan-modal {
|
||||
width: 50%; }
|
||||
|
@ -75,7 +50,7 @@
|
|||
height: 80vh; }
|
||||
.wp-block-tainacan-modal.dynamic-modal iframe {
|
||||
width: calc(100% + 32px);
|
||||
height: calc(100% - 128px);
|
||||
height: calc(100% - 132px);
|
||||
margin-left: -16px; }
|
||||
.wp-block-tainacan-modal.dynamic-modal .modal-footer-area {
|
||||
height: 68px;
|
||||
|
@ -182,6 +157,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;
|
||||
|
@ -195,7 +173,7 @@
|
|||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
padding: 16px 16px 0 16px;
|
||||
padding: 15px 16px 0 16px;
|
||||
margin: 0 -16px; }
|
||||
.wp-block-tainacan-modal .modal-footer-area p {
|
||||
padding: 0 12px;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAIA,KAAM;EACF,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,sBAAsB,CAAC,QAAU;EACjC,wBAAwB,CAAC,QAAY;;AAIzC,2CAA4C;EACxC,KAAK,EAAE,iBAAiB;;AAE5B,uBAAwB;EACpB,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI;EACf,cAAc,EAAE,GAAG;EACnB,eAAe,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AAwB;IAC/C,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,GAAG;IACZ,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,MAAM;IAElB;uGAAyB;MACrB,QAAQ,EAAE,MAAM;MAChB,YAAY,EAAE,GAAG;IAGrB;uHAAyC;MACrC,IAAI,EAAE,KAAK;IAGf;;;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;
|
||||
|
@ -13,7 +13,8 @@
|
|||
font-style: italic;
|
||||
color: var(--tainacan-block-gray4, #555758);
|
||||
text-align: center;
|
||||
margin: 4px auto; }
|
||||
margin: 0 auto;
|
||||
padding: 8px 2px 2px 2px; }
|
||||
.wp-block-tainacan-faceted-search .items-list-placeholder {
|
||||
font-size: 1.125em;
|
||||
min-height: 500px;
|
||||
|
@ -102,6 +103,10 @@
|
|||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
align-content: flex-start; }
|
||||
.wp-block-tainacan-faceted-search .items-list-placeholder .below-search-control .aside-filters .items.items-without-thumbnail .fake-item-thumb {
|
||||
display: none; }
|
||||
.wp-block-tainacan-faceted-search .items-list-placeholder .below-search-control .aside-filters .items.items-without-thumbnail .fake-item-description {
|
||||
left: 0; }
|
||||
.wp-block-tainacan-faceted-search .items-list-placeholder .below-search-control .aside-filters .pagination {
|
||||
flex: 0 1 5%;
|
||||
display: flex;
|
||||
|
|
|
@ -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,QAAQ;EAEpB,yDAAwB;IACpB,SAAS,EAAE,OAAO;IAClB,UAAU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AC9D,IAAI,EAAE,SAAS;MACf,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,IAAI;MAEZ,kKACQ;QACJ,gBAAgB,EAAE,qEAAmE;QACrF,sMAAkB;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",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-facets/faceted-search/faceted-search.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-faceted-search.css"
|
||||
|
|
|
@ -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-item-submission-form.css.map */
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,uBAAwB;EACpB,MAAM,EAAE,kBAAkB;EAE1B,sDAA+B;IAC3B,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,oCAAmC;;AAGlD,uCAAwC;EACpC,MAAM,EAAE,QAAQ;EAGhB,0DAAmB;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,wDAAiB;IACb,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,MAAM;IAClB,KAAK,EAAE,oCAAmC;IAC1C,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,QAAQ;EAEpB,yEAAkC;IAC9B,gBAAgB,EAAE,uCAAuC;IACzD,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE,OAAO;IAClB,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,oFAAW;MACP,gBAAgB,EAAE,qDAAmD;MACrE,MAAM,EAAE,MAAM;MACd,KAAK,EAAE,GAAG;MACV,SAAS,EAAE,MAAM;MACjB,aAAa,EAAE,GAAG;MAClB,OAAO,EAAE,YAAY;MAErB,kGAAgB;QACZ,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,GAAG;QACf,MAAM,EAAE,MAAM;MAElB,mGAAiB;QACb,gBAAgB,EAAE,oDAAkD;QACp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O,EAAE,KAAK;MACd,OAAO,EAAE,IAAI;MACb,SAAS,EAAE,IAAI;MACf,eAAe,EAAE,UAAU;IAE/B,2FAAkB;MACd,KAAK,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"
|
||||
}
|
|
@ -152,7 +152,7 @@
|
|||
padding-left: 24px;
|
||||
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;
|
||||
z-index: 2;
|
||||
|
|
|
@ -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,I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oC;QAChC,aAAa,EAAE,GAAG",
|
||||
"sources": ["../../views/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss"],
|
||||
"names": [],
|
||||
"file": "tainacan-gutenberg-block-search-bar.css"
|
||||
|
|
|
@ -66,6 +66,9 @@ font-weight: normal;
|
|||
.tainacan-icon-attachments:before {
|
||||
content: "attachments";
|
||||
}
|
||||
.tainacan-icon-form:before {
|
||||
content: "form";
|
||||
}
|
||||
.tainacan-icon-wordpress:before {
|
||||
content: "wordpress";
|
||||
}
|
||||
|
@ -282,6 +285,9 @@ font-weight: normal;
|
|||
.tainacan-icon-viewtable:before {
|
||||
content: "viewtable";
|
||||
}
|
||||
.tainacan-icon-viewlist:before {
|
||||
content: "viewlist";
|
||||
}
|
||||
.tainacan-icon-facebook:before {
|
||||
content: "facebook";
|
||||
}
|
||||
|
@ -560,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 {
|
||||
|
|
After Width: | Height: | Size: 313 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 275 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 676 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 614 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 523 KiB |
|
@ -69,6 +69,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'authorid' => 'author',
|
||||
'authorname' => 'author_name',
|
||||
'search' => 's',
|
||||
's' => 's',
|
||||
'searchterm' => 'search',
|
||||
'status' => 'post_status',
|
||||
'offset' => 'offset',
|
||||
|
@ -117,6 +118,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'inclusive' => 'inclusive',
|
||||
'before' => 'before',
|
||||
'after' => 'after',
|
||||
'column' => 'column',
|
||||
];
|
||||
|
||||
$tax_query = [
|
||||
|
@ -145,7 +147,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
}
|
||||
|
||||
$args['perm'] = 'readable';
|
||||
|
||||
|
||||
return apply_filters('tainacan-api-prepare-items-args', $args, $request);
|
||||
}
|
||||
|
||||
|
@ -273,7 +275,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
public function get_fetch_only_param(){
|
||||
return [
|
||||
'fetch_only' => array(
|
||||
'type' => 'string/array',
|
||||
'type' => ['string','array'],
|
||||
'description' => __( 'Fetch only specific attribute. The specifics attributes are the same in schema.', 'tainacan' ),
|
||||
//TODO: explicar o fetch only meta.. cabe aqui?
|
||||
)
|
||||
|
@ -337,15 +339,18 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
|
||||
$query_params['order'] = array(
|
||||
'description' => __( 'Order sort attribute ascending or descending.', 'tainacan' ),
|
||||
'type' => 'string/array',
|
||||
'type' => ['string','array'],
|
||||
'default' => 'desc',
|
||||
'enum' => array( 'asc', 'desc', 'ASC', 'DESC' ),
|
||||
);
|
||||
|
||||
$query_params['orderby'] = array(
|
||||
'description' => __( "Sort objects by object attribute.", 'tainacan' ),
|
||||
'type' => 'string/array',
|
||||
'type' => ['string', 'array'],
|
||||
'default' => 'date',
|
||||
// 'items' => [
|
||||
// 'type' => 'string'
|
||||
// ],
|
||||
'enum' => array(
|
||||
'author',
|
||||
'date',
|
||||
|
@ -358,13 +363,14 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'include_slugs',
|
||||
'title',
|
||||
'meta_value',
|
||||
'meta_value_num'
|
||||
'meta_value_num',
|
||||
'menu_order'
|
||||
),
|
||||
);
|
||||
|
||||
$query_params['perpage'] = array(
|
||||
'description' => __( "Maximum number of objects to be returned in result set.", 'tainacan' ),
|
||||
'type' => 'numeric',
|
||||
'type' => 'number',
|
||||
'default' => 10,
|
||||
);
|
||||
|
||||
|
@ -392,11 +398,11 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
protected function get_meta_queries_params(){
|
||||
return array(
|
||||
'metakey' => array(
|
||||
'type' => 'integer/string',
|
||||
'type' => ['integer', 'string'],
|
||||
'description' => __('Custom metadata key.'),
|
||||
),
|
||||
'metavalue' => array(
|
||||
'type' => 'string/array',
|
||||
'type' => ['string', 'array'],
|
||||
'description' => __('Custom metadata value'),
|
||||
),
|
||||
'metavaluenum' => array(
|
||||
|
@ -428,7 +434,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
),
|
||||
'metaquery' => array(
|
||||
'description' => __('Limits result set to items that have specific custom metadata'),
|
||||
'type' => 'array/object',
|
||||
'type' => ['array', 'object'],
|
||||
'items' => array(
|
||||
'keys' => array(
|
||||
'key' => array(
|
||||
|
@ -436,7 +442,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'description' => __('Custom metadata key.'),
|
||||
),
|
||||
'value' => array(
|
||||
'type' => 'string/array',
|
||||
'type' => ['string', 'array'],
|
||||
'description' => __('Custom metadata value. It can be an array only when compare is IN, NOT IN, BETWEEN, or NOT BETWEEN. You dont have to specify a value when using the EXISTS or NOT EXISTS comparisons in WordPress 3.9 and up.
|
||||
(Note: Due to bug #23268, value is required for NOT EXISTS comparisons to work correctly prior to 3.9. You must supply some string for the value parameter. An empty string or NULL will NOT work. However, any other string will do the trick and will NOT show up in your SQL when using NOT EXISTS. Need inspiration? How about \'bug #23268\'.'),
|
||||
),
|
||||
|
@ -471,12 +477,12 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'description' => __('Custom metadata type. Possible values are NUMERIC, BINARY, CHAR, DATE, DATETIME, DECIMAL, SIGNED, TIME, UNSIGNED. Default value is CHAR. You can also specify precision and scale for the DECIMAL and NUMERIC types (for example, DECIMAL(10,5) or NUMERIC(10) are valid). The type DATE works with the compare value BETWEEN only if the date is stored at the format YYYY-MM-DD and tested with this format.'),
|
||||
),
|
||||
),
|
||||
'type' => 'array'
|
||||
'type' => ['array', 'object']
|
||||
),
|
||||
),
|
||||
'datequery' => array(
|
||||
'description' => __('Limits the result set to items that were created in some specific date'),
|
||||
'type' => 'array/object',
|
||||
'description' => __('Limits the result set to items that were created or modified in some specific date'),
|
||||
'type' => ['array', 'object'],
|
||||
'items' => array(
|
||||
'keys' => array(
|
||||
'year' => array(
|
||||
|
@ -534,20 +540,24 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
'description' => __('For after/before, whether exact value should be matched or not.'),
|
||||
),
|
||||
'before' => array(
|
||||
'type' => 'string/array',
|
||||
'type' => ['string', 'array'],
|
||||
'description' => __('Date to retrieve posts before. Accepts strtotime()-compatible string, or array of year, month, day '),
|
||||
),
|
||||
'after' => array(
|
||||
'type' => 'string/array',
|
||||
'type' => ['string', 'array'],
|
||||
'description' => __('Date to retrieve posts after. Accepts strtotime()-compatible string, or array of year, month, day '),
|
||||
),
|
||||
'column' => array(
|
||||
'type' => 'string',
|
||||
'description' => __('Posts column to query against, possible values: post_date, post_date_gmt, post_modified, post_modified_gmt. Default: ‘post_date’.'),
|
||||
),
|
||||
),
|
||||
'type' => 'array'
|
||||
'type' => ['array', 'object']
|
||||
),
|
||||
),
|
||||
'taxquery' => array(
|
||||
'description' => __('Show items associated with certain taxonomy.'),
|
||||
'type' => 'array/object',
|
||||
'type' => ['array', 'object'],
|
||||
'items' => array(
|
||||
'keys' => array(
|
||||
'taxonomy' => array(
|
||||
|
@ -566,7 +576,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
)
|
||||
),
|
||||
'terms' => array(
|
||||
'type' => 'int/string/array',
|
||||
'type' => ['integer', 'string', 'array'],
|
||||
'description' => __('Taxonomy term(s).'),
|
||||
),
|
||||
'operator' => array(
|
||||
|
@ -591,7 +601,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
)
|
||||
),
|
||||
),
|
||||
'type' => 'array'
|
||||
'type' => ['array', 'object']
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -41,7 +41,7 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
'description' => __( 'The ID of the owner of the background processes. Defaults to current user', 'tainacan' ),
|
||||
],
|
||||
'all_users' => [
|
||||
'type' => 'bool',
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Whether to return processes from all users (if current user is admin).', 'tainacan' ),
|
||||
'default' => false,
|
||||
],
|
||||
|
@ -66,7 +66,7 @@ class REST_Background_Processes_Controller extends REST_Controller {
|
|||
'default' => 1
|
||||
],
|
||||
'recent' => [
|
||||
'type' => 'bool',
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Returns only processes created or updated recently', 'tainacan' ),
|
||||
'default' => false
|
||||
],
|
||||
|
@ -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 {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -57,7 +57,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
'description' => __( 'The metadatum ID', 'tainacan' ),
|
||||
],
|
||||
'value' => [
|
||||
'type' => 'string/integer',
|
||||
'type' => ['string', 'integer'],
|
||||
'description' => __( 'The value to be added', 'tainacan' ),
|
||||
],
|
||||
],
|
||||
|
@ -118,7 +118,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
'description' => __( 'The metadatum ID', 'tainacan' ),
|
||||
],
|
||||
'value' => [
|
||||
'type' => 'string/integer/array',
|
||||
'type' => ['string', 'integer', 'array'],
|
||||
'description' => __( 'The value to be set', 'tainacan' ),
|
||||
],
|
||||
],
|
||||
|
@ -137,7 +137,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
'description' => __( 'The metadatum ID', 'tainacan' ),
|
||||
],
|
||||
'metadatum_id_from' => [
|
||||
'type' => 'string/integer',
|
||||
'type' => ['string', 'integer'],
|
||||
'description' => __( 'The metadatum ID to be copied', 'tainacan' ),
|
||||
],
|
||||
],
|
||||
|
@ -156,7 +156,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
'description' => __( 'The metadatum ID', 'tainacan' ),
|
||||
],
|
||||
'value' => [
|
||||
'type' => 'string/integer',
|
||||
'type' => ['string', 'integer'],
|
||||
'description' => __( 'The value to be added', 'tainacan' ),
|
||||
],
|
||||
],
|
||||
|
@ -175,11 +175,11 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
'description' => __( 'The metadatum ID', 'tainacan' ),
|
||||
],
|
||||
'old_value' => [
|
||||
'type' => 'string/integer',
|
||||
'type' => ['string', 'integer'],
|
||||
'description' => __( 'The value to search for', 'tainacan' ),
|
||||
],
|
||||
'new_value' => [
|
||||
'type' => 'string/integer',
|
||||
'type' => ['string', 'integer'],
|
||||
'description' => __( 'The value to be set', 'tainacan' ),
|
||||
],
|
||||
],
|
||||
|
@ -433,7 +433,7 @@ class REST_Bulkedit_Controller extends REST_Controller {
|
|||
];
|
||||
|
||||
$query_params['use_query'] = [
|
||||
'type' => 'bool',
|
||||
'type' => ['boolean', 'object'],
|
||||
'description' => __( 'Whether to use the current query to select posts', 'tainacan' ),
|
||||
];
|
||||
|
||||
|
|
|
@ -70,11 +70,11 @@ class REST_Exporters_Controller extends REST_Controller {
|
|||
'description' => __( 'The e-mail to be used by the export to send a message when the process ends', 'tainacan' ),
|
||||
],
|
||||
'collection' => [
|
||||
'type' => 'array/object',
|
||||
'type' => ['array', 'object'],
|
||||
'description' => __( 'The array describing the collection as expected by the exporter', 'tainacan' ),
|
||||
],
|
||||
'options' => [
|
||||
'type' => 'array/object',
|
||||
'type' => ['array', 'object'],
|
||||
'description' => __( 'The exporter options', 'tainacan' ),
|
||||
]
|
||||
],
|
||||
|
@ -159,7 +159,7 @@ class REST_Exporters_Controller extends REST_Controller {
|
|||
if (is_array($value) && isset($value['id'])) {
|
||||
$collection = $this->collections_repository->fetch($value['id']);
|
||||
$total_items = wp_count_posts( $collection->get_db_identifier(), 'readable' );
|
||||
$value['total_items'] = ($total_items->publish + $total_items->private);
|
||||
$value['total_items'] = ($total_items->publish + $total_items->private + $total_items->draft);
|
||||
$exporter->add_collection($value);
|
||||
continue;
|
||||
} else {
|
||||
|
|
|
@ -350,6 +350,7 @@ class REST_Filters_Controller extends REST_Controller {
|
|||
foreach ($extra_metadata as $extra_meta) {
|
||||
$item_arr[$extra_meta] = get_post_meta($item_arr['id'], $extra_meta, true);
|
||||
}
|
||||
$item_arr['inherited'] = $item_arr['collection_id'] != $request['collection_id'];
|
||||
|
||||
return $item_arr;
|
||||
}
|
||||
|
@ -381,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 = [];
|
||||
|
|
|
@ -56,11 +56,11 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
'description' => __( 'The URL to be used by the importer', 'tainacan' ),
|
||||
],
|
||||
'collection' => [
|
||||
'type' => 'array/object',
|
||||
'type' => ['array','object'],
|
||||
'description' => __( 'The array describing the destination collectino as expected by the importer', 'tainacan' ),
|
||||
],
|
||||
'options' => [
|
||||
'type' => 'array/object',
|
||||
'type' => ['array', 'object'],
|
||||
'description' => __( 'The importer options', 'tainacan' ),
|
||||
]
|
||||
],
|
||||
|
@ -205,7 +205,7 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -282,15 +282,15 @@ class REST_Item_Metadata_Controller extends REST_Controller {
|
|||
);
|
||||
} elseif ($method === \WP_REST_Server::EDITABLE) {
|
||||
$endpoint_args['values'] = [
|
||||
'type' => 'array/string/object/integer',
|
||||
'type' => ['array', 'string', 'object', 'integer'],
|
||||
'items' => [
|
||||
'type' => 'array/string/object/integer'
|
||||
'type' => ['array', 'string', 'object', 'integer']
|
||||
],
|
||||
'description' => __('The value(s) of item metadata')
|
||||
];
|
||||
$endpoint_args['parent_meta_id'] = [
|
||||
'type' => 'array/string/object/integer',
|
||||
'items' => ['type' => 'array/string/object/integer'],
|
||||
'type' => ['array', 'string', 'object', 'integer'],
|
||||
'items' => ['type' => ['array', 'string', 'object', 'integer'] ],
|
||||
'description' => __('The parent meta ID for the item metadata children group')
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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'] );
|
||||
|
@ -308,6 +343,7 @@ class REST_Items_Controller extends REST_Controller {
|
|||
$args['post_parent'] = $item_id;
|
||||
$args['post_type'] = 'attachment';
|
||||
$args['post_status'] = 'any';
|
||||
|
||||
unset($args['perm']);
|
||||
|
||||
$posts_query = new \WP_Query();
|
||||
|
@ -363,7 +399,6 @@ class REST_Items_Controller extends REST_Controller {
|
|||
|
||||
// Free php session early so simultaneous requests dont get queued
|
||||
session_write_close();
|
||||
|
||||
$args = $this->prepare_filters($request);
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -948,6 +1257,10 @@ class REST_Items_Controller extends REST_Controller {
|
|||
return $schema;
|
||||
|
||||
}
|
||||
|
||||
function process_request_filters($args) {
|
||||
return $this->prepare_filters($args);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -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']) {
|
||||
|
|
|
@ -306,7 +306,6 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
public function prepare_item_for_response( $item, $request ) {
|
||||
if(!empty($item)){
|
||||
$item_arr = $item->_toArray();
|
||||
|
||||
$item_arr['metadata_type_object'] = $item->get_metadata_type_object()->_toArray();
|
||||
|
||||
if(isset($item_arr['metadata_type_options']) && isset($item_arr['metadata_type_options']['taxonomy_id'])){
|
||||
|
@ -345,6 +344,7 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
foreach ($extra_metadata as $extra_meta) {
|
||||
$item_arr[$extra_meta] = get_post_meta($item_arr['id'], $extra_meta, true);
|
||||
}
|
||||
$item_arr['inherited'] = $item_arr['collection_id'] != $request['collection_id'];
|
||||
|
||||
return $item_arr;
|
||||
}
|
||||
|
@ -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' );
|
||||
}
|
||||
|
||||
|
@ -391,7 +399,7 @@ class REST_Metadata_Controller extends REST_Controller {
|
|||
}
|
||||
|
||||
return new \WP_REST_Response($prepared_item, 200);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \WP_REST_Request $request
|
||||
|
|
|
@ -32,7 +32,7 @@ class REST_Metadata_Types_Controller extends REST_Controller {
|
|||
'type' => 'string'
|
||||
],
|
||||
'primitive_type' => [
|
||||
'type' => 'array/string',
|
||||
'type' => ['array','string'],
|
||||
'items' => [
|
||||
'type' => 'string'
|
||||
]
|
||||
|
|
|
@ -294,6 +294,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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -192,6 +192,7 @@ class REST_Sequence_Edit_Controller extends REST_Controller {
|
|||
];
|
||||
|
||||
$query_params['use_query'] = [
|
||||
'type' => ['boolean', 'object'],
|
||||
'description' => __( 'The query used to define the items in the group', 'tainacan' ),
|
||||
];
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class REST_Taxonomies_Controller extends REST_Controller {
|
|||
)
|
||||
),
|
||||
'fetch_only' => array(
|
||||
'type' => 'string/array',
|
||||
'type' => ['string', 'array'],
|
||||
'description' => __( 'Fetch only specific attribute. The specifics attributes are the same in schema.', 'tainacan' ),
|
||||
)
|
||||
)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -699,6 +722,7 @@ class Elastic_Press {
|
|||
if( empty($aggregations) )
|
||||
return $formated_aggs;
|
||||
|
||||
$separator = strip_tags(apply_filters('tainacan-terms-hierarchy-html-separator', '>'));
|
||||
foreach($aggregations as $key => $aggregation) {
|
||||
$description_types = \explode(".", $key);
|
||||
$filter_id = $description_types[0];
|
||||
|
@ -720,7 +744,8 @@ class Elastic_Press {
|
|||
"total_children" => $total_children,
|
||||
"total_items" => $term['doc_count'],
|
||||
"label" => $term_object->get('name'),
|
||||
"parent" => $term_object->get('parent')
|
||||
"parent" => $term_object->get('parent'),
|
||||
'hierarchy_path' => get_term_parents_list($term_id, $taxonomy_slug, ['format'=>'name', 'separator'=>$separator, 'link'=>false, 'inclusive'=>false])
|
||||
];
|
||||
if (isset($description_types[3])) {
|
||||
array_unshift($formated_aggs[$filter_id], $fct);
|
||||
|
@ -774,6 +799,7 @@ class Elastic_Press {
|
|||
if( empty($aggregations) )
|
||||
return $formated_aggs;
|
||||
|
||||
$separator = strip_tags(apply_filters('tainacan-terms-hierarchy-html-separator', '>'));
|
||||
foreach($aggregations as $key => $aggregation) {
|
||||
$description_types = \explode(".", $key);
|
||||
if($description_types[0] == 'taxonomy') {
|
||||
|
@ -807,7 +833,8 @@ class Elastic_Press {
|
|||
"total_children" => $total_children,
|
||||
"total_items" => $term['doc_count'],
|
||||
"label" => $term_object->get('name'),
|
||||
"parent" => $term_object->get('parent')
|
||||
"parent" => $term_object->get('parent'),
|
||||
'hierarchy_path' => get_term_parents_list($term_id, $taxonomy_slug, ['format'=>'name', 'separator'=>$separator, 'link'=>false, 'inclusive'=>false])
|
||||
];
|
||||
if ($has_include) {
|
||||
array_unshift($formated_aggs['values'], $fct);
|
||||
|
|
|
@ -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>' : '';
|
||||
}
|
||||
|
||||
}
|
|
@ -38,6 +38,13 @@ class Media {
|
|||
return $vars;
|
||||
}
|
||||
|
||||
private function flush_buffers(){
|
||||
if( ob_get_level() > 0 ) {
|
||||
ob_flush();
|
||||
}
|
||||
// flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert an attachment from an URL address.
|
||||
*
|
||||
|
@ -52,7 +59,7 @@ class Media {
|
|||
if( !file_exists($filename) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->flush_buffers();
|
||||
$file = file_get_contents($filename);
|
||||
|
||||
if (false === $file) {
|
||||
|
@ -78,7 +85,7 @@ class Media {
|
|||
if( !file_exists($filename) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->flush_buffers();
|
||||
return $this->insert_attachment_from_blob(file_get_contents($filename), basename($filename), $post_id);
|
||||
|
||||
}
|
||||
|
@ -188,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 );
|
||||
|
@ -246,10 +254,11 @@ class Media {
|
|||
$imagick = new \Imagick();
|
||||
$imagick->setResolution(72,72);
|
||||
$imagick->readImage($filepath . '[0]');
|
||||
//$imagick->setIteratorIndex(0);
|
||||
$imagick->setImageFormat('jpg');
|
||||
$imagick->getImageBlob();
|
||||
$imagick = $imagick->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
|
||||
$this->THROW_EXCPTION_ON_FATAL_ERROR = false;
|
||||
return $imagick->getImageBlob();
|
||||
return $imagick;
|
||||
} catch(\Exception $e) {
|
||||
return null;
|
||||
} catch (\Error $ex) {
|
||||
|
@ -346,8 +355,8 @@ class Media {
|
|||
|
||||
if ( wp_attachment_is_image($att_id) ) {
|
||||
|
||||
$img = wp_get_attachment_url($attachment->ID, 'large');
|
||||
$output .= "<img style='max-width: 100%;' src='" . $img . "' />";
|
||||
$img = wp_get_attachment_image($attachment->ID, 'large');
|
||||
$output .= $img;
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
@ -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,34 +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,
|
||||
$allow_comments;
|
||||
$metadata_order,
|
||||
$filters_order,
|
||||
$enable_cover_page,
|
||||
$cover_page_id,
|
||||
$header_image_id,
|
||||
$header_image,
|
||||
$comment_status,
|
||||
$allow_comments,
|
||||
$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
|
||||
|
@ -130,7 +135,7 @@ class Collection extends Entity {
|
|||
'revisions',
|
||||
'page-attributes',
|
||||
'post-formats',
|
||||
'comments'
|
||||
'comments'
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -226,7 +231,7 @@ class Collection extends Entity {
|
|||
return apply_filters("tainacan-collection-get-attachments", $attachments, $exclude, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function get_author_name() {
|
||||
|
@ -241,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);
|
||||
}
|
||||
|
@ -270,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() );
|
||||
}
|
||||
|
@ -429,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
|
||||
|
@ -532,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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -540,7 +545,52 @@ 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' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the state of $hide_items_thumbnail_on_lists to decide if it should always display item thumbnails, even being placeholders
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_hide_items_thumbnail_on_lists() {
|
||||
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' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -720,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -729,7 +779,62 @@ 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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the state of $hide_items_thumbnail_on_lists
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function set_hide_items_thumbnail_on_lists( $value ) {
|
||||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 ) {
|
||||
|
||||
|
@ -564,17 +566,16 @@ class Item extends Entity {
|
|||
}
|
||||
|
||||
$mto = $metadatum_object->get_metadata_type_object();
|
||||
$before = str_replace('$type', $mto->get_slug(), $args['before']);
|
||||
$return .= $before;
|
||||
|
||||
$item_meta = new \Tainacan\Entities\Item_Metadata_Entity($this, $metadatum_object);
|
||||
if ($item_meta->has_value() || !$args['hide_empty']) {
|
||||
$before = str_replace('$type', $mto->get_slug(), $args['before']);
|
||||
$return .= $before;
|
||||
$return .= $args['before_title'] . $metadatum_object->get_name() . $args['after_title'];
|
||||
$return .= $args['before_value'] . $item_meta->get_value_as_html() . $args['after_value'];
|
||||
$return .= $args['after'];
|
||||
}
|
||||
|
||||
$return .= $args['after'];
|
||||
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
@ -632,16 +633,14 @@ class Item extends Entity {
|
|||
}
|
||||
}
|
||||
|
||||
$before = str_replace('$type', $fto->get_slug(), $args['before']);
|
||||
$return .= $before;
|
||||
|
||||
if ($item_meta->has_value() || !$args['hide_empty']) {
|
||||
$before = str_replace('$type', $fto->get_slug(), $args['before']);
|
||||
$return .= $before;
|
||||
$return .= $args['before_title'] . $item_meta->get_metadatum()->get_name() . $args['after_title'];
|
||||
$return .= $args['before_value'] . $item_meta->get_value_as_html() . $args['after_value'];
|
||||
$return .= $args['after'];
|
||||
|
||||
}
|
||||
|
||||
$return .= $args['after'];
|
||||
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
@ -667,11 +666,8 @@ class Item extends Entity {
|
|||
|
||||
if ( wp_attachment_is_image($this->get_document()) ) {
|
||||
|
||||
$img = wp_get_attachment_image($this->get_document(), $img_size);
|
||||
$img_full = wp_get_attachment_url($this->get_document());
|
||||
|
||||
$image_attributes = wp_get_attachment_image_src( $this->get_document(), $img_size );
|
||||
$img = "<img style='max-width: 100%;' src='" . $image_attributes[0] . "' />";
|
||||
$img_full = wp_get_attachment_url($this->get_document());
|
||||
$img = wp_get_attachment_image( $this->get_document(), $img_size );
|
||||
|
||||
$output .= sprintf("<a href='%s' target='blank'>%s</a>", $img_full, $img);
|
||||
|
||||
|
@ -708,9 +704,6 @@ class Item extends Entity {
|
|||
$img = wp_get_attachment_image($attachment, $img_size);
|
||||
$img_full = wp_get_attachment_url($attachment);
|
||||
|
||||
$image_attributes = wp_get_attachment_image_src($attachment, $img_size );
|
||||
$img = "<img style='max-width: 100%;' src='" . $image_attributes[0] . "' />";
|
||||
|
||||
$output .= sprintf("<a href='%s' target='blank'>%s</a>", $img_full, $img);
|
||||
|
||||
} else {
|
||||
|
|
|
@ -173,13 +173,16 @@ class Metadatum extends Entity {
|
|||
function get_metadata_type_object(){
|
||||
$class_name = $this->get_metadata_type();
|
||||
|
||||
if( !class_exists( $class_name ) ){
|
||||
return null;
|
||||
if( !class_exists( $class_name ) ) {
|
||||
$class_name = "Tainacan\\Metadata_Types\\Text";
|
||||
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;
|
||||
return $object_type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -465,6 +468,7 @@ class Metadatum extends Entity {
|
|||
}
|
||||
}
|
||||
if ( $this->get_metadata_type() == 'Tainacan\Metadata_Types\Compound' && $this->is_multiple() ) {
|
||||
|
||||
$Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance();
|
||||
$children_taxonomy = $Tainacan_Metadata->fetch(
|
||||
[
|
||||
|
|
|
@ -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) {
|
||||
|
@ -139,23 +144,12 @@ class CSV extends Exporter {
|
|||
}
|
||||
|
||||
function get_author_name_last_modification($item_id) {
|
||||
$logs = \Tainacan\Repositories\Logs::get_instance()->fetch([
|
||||
'item_id'=>$item_id,
|
||||
'paged'=>1,
|
||||
'posts_per_page'=>1
|
||||
]);
|
||||
$response;
|
||||
|
||||
if($logs->have_posts()){
|
||||
while ($logs->have_posts()){
|
||||
$logs->the_post();
|
||||
|
||||
$log = new Entities\Log($logs->post);
|
||||
$response = $log->get_user_name();
|
||||
}
|
||||
wp_reset_postdata();
|
||||
$last_id = get_post_meta( $item_id, '_user_edit_lastr', true );
|
||||
if ( $last_id ) {
|
||||
$last_user = get_userdata( $last_id );
|
||||
return apply_filters( 'the_modified_author', $last_user->display_name );
|
||||
}
|
||||
return $response;
|
||||
return "";
|
||||
}
|
||||
|
||||
private function get_description_title_meta($meta) {
|
||||
|
@ -225,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");
|
||||
|
||||
}
|
||||
|
||||
|
@ -248,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>';
|
||||
|
@ -278,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">
|
||||
|
@ -294,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">
|
||||
|
@ -316,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">
|
||||
|
@ -338,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
|
||||
*/
|
||||
|
@ -799,7 +805,7 @@ abstract class Exporter {
|
|||
|
||||
if (method_exists($this, $method_name)) {
|
||||
$author = $this->get_transient('author');
|
||||
$this->add_log('User in process: ' . $author);
|
||||
$this->add_log('User in process: ' . $author . ' (' . date("Y-m-d H:i:s") . ')');
|
||||
wp_set_current_user($author);
|
||||
$result = $this->$method_name();
|
||||
} else {
|
||||
|
|
|
@ -28,7 +28,7 @@ class Exposers_Handler {
|
|||
}
|
||||
|
||||
public function __construct() {
|
||||
self::$instance = $this;
|
||||
self::$instance = $this;
|
||||
|
||||
add_action('init', array(&$this, 'init'));
|
||||
|
||||
|
@ -45,6 +45,7 @@ class Exposers_Handler {
|
|||
$this->register_exposer('Tainacan\Exposers\Csv');
|
||||
//$this->register_exposer('Tainacan\Exposers\OAI_PMH');
|
||||
//$this->register_exposer('Tainacan\Exposers\JSON_LD');
|
||||
$this->register_exposer('Tainacan\Exposers\JSON_flat');
|
||||
do_action('tainacan-register-exposers', $this);
|
||||
}
|
||||
|
||||
|
@ -54,15 +55,15 @@ class Exposers_Handler {
|
|||
* @param $class_name string | object The class name or the instance
|
||||
*/
|
||||
public function register_exposer( $class_name ){
|
||||
$obj = $class_name;
|
||||
$obj = $class_name;
|
||||
if( is_object( $class_name ) ){
|
||||
$class_name = get_class( $class_name );
|
||||
} else {
|
||||
$obj = new $class_name;
|
||||
$obj = new $class_name;
|
||||
}
|
||||
|
||||
if(!in_array( $class_name, $this->exposers)){
|
||||
$this->exposers[$obj->slug] = $class_name;
|
||||
$this->exposers[$obj->slug] = $class_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,11 +73,11 @@ class Exposers_Handler {
|
|||
* @param $class_name string | object The class name or the instance
|
||||
*/
|
||||
public function unregister_exposer( $class_name ){
|
||||
$obj = $class_name;
|
||||
$obj = $class_name;
|
||||
if( is_object( $class_name ) ){
|
||||
$class_name = get_class( $class_name );
|
||||
} else {
|
||||
$obj = new $class_name;
|
||||
$obj = new $class_name;
|
||||
}
|
||||
|
||||
if ( array_key_exists($obj->slug, $this->exposers) ) {
|
||||
|
@ -95,12 +96,12 @@ class Exposers_Handler {
|
|||
* @return string
|
||||
*/
|
||||
public function check_class_name($class_name, $root = false, $prefix = 'Tainacan\Exposer\\') {
|
||||
if(is_string($class_name)) {
|
||||
if(array_key_exists($class_name, $this->exposers)) {
|
||||
$class_name = $this->exposers[$class_name];
|
||||
$prefix = '';
|
||||
}
|
||||
}
|
||||
if(is_string($class_name)) {
|
||||
if(array_key_exists($class_name, $this->exposers)) {
|
||||
$class_name = $this->exposers[$class_name];
|
||||
$prefix = '';
|
||||
}
|
||||
}
|
||||
$class = $prefix.sanitize_text_field($class_name);
|
||||
$class = str_replace(['-', ' '], ['_', '_'], $class);
|
||||
|
||||
|
@ -114,7 +115,7 @@ class Exposers_Handler {
|
|||
* @return boolean
|
||||
*/
|
||||
public function is_tainacan_request($request) {
|
||||
return substr($request->get_route(), 0, strlen('/tainacan/v2')) == '/tainacan/v2';
|
||||
return substr($request->get_route(), 0, strlen('/tainacan/v2')) == '/tainacan/v2';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -122,15 +123,15 @@ class Exposers_Handler {
|
|||
* @param \WP_REST_Request $request
|
||||
*/
|
||||
public static function request_has_url_param($request) {
|
||||
$Tainacan_Exposers = self::get_instance();
|
||||
$query_url_params = $request->get_query_params();
|
||||
if (
|
||||
is_array($query_url_params) && array_key_exists(self::TYPE_PARAM, $query_url_params) &&
|
||||
$Tainacan_Exposers->exposer_exists($query_url_params[self::TYPE_PARAM])
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
$Tainacan_Exposers = self::get_instance();
|
||||
$query_url_params = $request->get_query_params();
|
||||
if (
|
||||
is_array($query_url_params) && array_key_exists(self::TYPE_PARAM, $query_url_params) &&
|
||||
$Tainacan_Exposers->exposer_exists($query_url_params[self::TYPE_PARAM])
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,18 +143,18 @@ class Exposers_Handler {
|
|||
*/
|
||||
public function rest_request_after_callbacks( $response, $handler, $request ) {
|
||||
if($this->is_tainacan_request($request) && $response instanceof \WP_REST_Response ) {
|
||||
if($request->get_method() == 'GET') {
|
||||
if($exposer = $this->request_has_exposer($request)) {
|
||||
$type_responde = $exposer->rest_request_after_callbacks($response, $handler, $request);
|
||||
if(self::request_has_url_param($request)) {
|
||||
header(implode('', $response->get_headers()));
|
||||
echo stripcslashes($response->get_data());
|
||||
exit();
|
||||
}
|
||||
return $type_responde;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($request->get_method() == 'GET') {
|
||||
if($exposer = $this->request_has_exposer($request)) {
|
||||
$type_responde = $exposer->rest_request_after_callbacks($response, $handler, $request);
|
||||
if(self::request_has_url_param($request)) {
|
||||
header(implode('', $response->get_headers()));
|
||||
echo stripcslashes($response->get_data());
|
||||
exit();
|
||||
}
|
||||
return $type_responde;
|
||||
}
|
||||
}
|
||||
}
|
||||
// default JSON response
|
||||
return $response;
|
||||
}
|
||||
|
@ -176,17 +177,17 @@ class Exposers_Handler {
|
|||
$query_url_params = $request->get_query_params();
|
||||
$Tainacan_Exposers = self::get_instance();
|
||||
if(
|
||||
is_array($body) && array_key_exists(self::TYPE_PARAM, $body) &&
|
||||
$Tainacan_Exposers->exposer_exists($body[self::TYPE_PARAM])
|
||||
is_array($body) && array_key_exists(self::TYPE_PARAM, $body) &&
|
||||
$Tainacan_Exposers->exposer_exists($body[self::TYPE_PARAM])
|
||||
) {
|
||||
$exposer = $Tainacan_Exposers->check_class_name($body[self::TYPE_PARAM], true);
|
||||
return new $exposer;
|
||||
} elseif (
|
||||
is_array($query_url_params) && array_key_exists(self::TYPE_PARAM, $query_url_params) &&
|
||||
$Tainacan_Exposers->exposer_exists($query_url_params[self::TYPE_PARAM])
|
||||
){
|
||||
$exposer = $Tainacan_Exposers->check_class_name($query_url_params[self::TYPE_PARAM], true);
|
||||
return new $exposer;
|
||||
is_array($query_url_params) && array_key_exists(self::TYPE_PARAM, $query_url_params) &&
|
||||
$Tainacan_Exposers->exposer_exists($query_url_params[self::TYPE_PARAM])
|
||||
) {
|
||||
$exposer = $Tainacan_Exposers->check_class_name($query_url_params[self::TYPE_PARAM], true);
|
||||
return new $exposer;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -199,19 +200,19 @@ class Exposers_Handler {
|
|||
* @return array of slug or array of \Tainacan\Exposers\Exposer
|
||||
*/
|
||||
public function get_exposers($output = \ARRAY_N) {
|
||||
$ret = [];
|
||||
switch ($output) {
|
||||
case \OBJECT:
|
||||
foreach ($this->exposers as $type) {
|
||||
$ret[] = new $type;
|
||||
}
|
||||
break;
|
||||
case \ARRAY_N:
|
||||
default:
|
||||
return $this->exposers;
|
||||
break;
|
||||
}
|
||||
return $ret;
|
||||
$ret = [];
|
||||
switch ($output) {
|
||||
case \OBJECT:
|
||||
foreach ($this->exposers as $type) {
|
||||
$ret[] = new $type;
|
||||
}
|
||||
break;
|
||||
case \ARRAY_N:
|
||||
default:
|
||||
return $this->exposers;
|
||||
break;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -279,29 +280,29 @@ class Exposers_Handler {
|
|||
* @return string|string[][]
|
||||
*/
|
||||
public static function get_exposer_urls($base_url = '') {
|
||||
return [];
|
||||
return [];
|
||||
$Tainacan_Exposers = self::get_instance();
|
||||
$mappers = $Tainacan_Exposers->get_mappers(\OBJECT);
|
||||
$types = $Tainacan_Exposers->get_types(\OBJECT);
|
||||
$urls = [];
|
||||
foreach ($types as $type) {
|
||||
$url = $base_url.(strpos($base_url, '?') === false ? '?' : '&').self::TYPE_PARAM.'='.$type->slug;
|
||||
$urls[$type->slug] = [$url];
|
||||
if(is_array($type->get_mappers())) {
|
||||
$first = true; // first is default, jump
|
||||
foreach ($type->get_mappers() as $type_mapper) {
|
||||
if($first) {
|
||||
$first = false;
|
||||
continue;
|
||||
}
|
||||
$urls[$type->slug][] = $url.'&'.self::MAPPER_PARAM.'='.$type_mapper;
|
||||
}
|
||||
} else {
|
||||
foreach ($mappers as $mapper) {
|
||||
$urls[$type->slug][] = $url.'&'.self::MAPPER_PARAM.'='.$mapper->slug;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $urls;
|
||||
$mappers = $Tainacan_Exposers->get_mappers(\OBJECT);
|
||||
$types = $Tainacan_Exposers->get_types(\OBJECT);
|
||||
$urls = [];
|
||||
foreach ($types as $type) {
|
||||
$url = $base_url.(strpos($base_url, '?') === false ? '?' : '&').self::TYPE_PARAM.'='.$type->slug;
|
||||
$urls[$type->slug] = [$url];
|
||||
if(is_array($type->get_mappers())) {
|
||||
$first = true; // first is default, jump
|
||||
foreach ($type->get_mappers() as $type_mapper) {
|
||||
if($first) {
|
||||
$first = false;
|
||||
continue;
|
||||
}
|
||||
$urls[$type->slug][] = $url.'&'.self::MAPPER_PARAM.'='.$type_mapper;
|
||||
}
|
||||
} else {
|
||||
foreach ($mappers as $mapper) {
|
||||
$urls[$type->slug][] = $url.'&'.self::MAPPER_PARAM.'='.$mapper->slug;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $urls;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace Tainacan\Exposers;
|
||||
|
||||
/**
|
||||
* Generate a text formated response
|
||||
*
|
||||
*/
|
||||
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 $accept_no_mapper = true;
|
||||
protected $mappers = true;
|
||||
|
||||
function __construct() {
|
||||
$this->set_name( __('Simple JSON', 'tainacan') );
|
||||
$this->set_description( __('Simple JSON for tainacan items', 'tainacan') );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
* @see \Tainacan\Exposers\Types\Type::rest_request_after_callbacks()
|
||||
*/
|
||||
public function rest_request_after_callbacks( $response, $handler, $request ) {
|
||||
$query_url_params = $request->get_query_params();
|
||||
$headers = $response->get_headers();
|
||||
$total_page = $headers['X-WP-TotalPages'];
|
||||
$current_page = isset($request['paged']) ? $request['paged'] : 1;
|
||||
if ($current_page < $total_page ) {
|
||||
$next_page = $current_page + 1;
|
||||
$next_page_link = $request->get_route() . '?' . http_build_query(array_merge($query_url_params, ['paged'=> $next_page]));
|
||||
} else {
|
||||
$next_page = false;
|
||||
$next_page_link = false;
|
||||
}
|
||||
|
||||
$pagination = [
|
||||
'per_page' => $headers['X-WP-ItemsPerPage'], //items per page,
|
||||
'total_page' => $total_page, //total pages
|
||||
'total_items' => $headers['X-WP-Total'], //total items
|
||||
'current_page' => $current_page,
|
||||
'next_page' => $next_page,
|
||||
'next_page_link' => $next_page_link
|
||||
];
|
||||
|
||||
$data = $response->get_data();
|
||||
$items = $data['items'];
|
||||
$response_items = array_map( function($item) {
|
||||
$item_data = $item['metadata'];
|
||||
array_walk(
|
||||
$item_data,
|
||||
function(&$meta, $meta_key) {
|
||||
$meta = array(
|
||||
'label' => $meta['name'],
|
||||
'value' => $meta['value_as_string']
|
||||
);
|
||||
}
|
||||
);
|
||||
return [
|
||||
'id' => $item['id'],
|
||||
'data' => $item_data,
|
||||
'url' => $item['url'],
|
||||
'thumbnail' => isset($item['thumbnail']) ? $item['thumbnail'] : false,
|
||||
'creation_date' => isset($item['creation_date']) ? $item['creation_date'] : '',
|
||||
'modification_date' => isset($item['modification_date']) ? $item['modification_date'] : ''
|
||||
];
|
||||
}, $items);
|
||||
|
||||
$response_data = json_encode(
|
||||
[
|
||||
'pagination' => $pagination,
|
||||
'items' => $response_items
|
||||
]
|
||||
);
|
||||
$response->set_data(addslashes($response_data));
|
||||
return $response;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
@ -181,24 +216,13 @@ class Bulk_Edit_Process extends Generic_Process {
|
|||
}
|
||||
|
||||
private function bulk_list_get_item($count) {
|
||||
$args = [
|
||||
'perpage' => 1,
|
||||
'offset' => $count,
|
||||
'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash'),
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => $this->meta_key,
|
||||
'value' => $this->get_group_id(),
|
||||
'compare' => '=',
|
||||
)
|
||||
)
|
||||
];
|
||||
$item = $this->items_repository->fetch($args, [], 'WP_Query');
|
||||
$this->set_current_step_total($item->found_posts);
|
||||
if ($item->have_posts()) {
|
||||
$item->the_post();
|
||||
$item = new \Tainacan\Entities\Item($item->post);
|
||||
return $item;
|
||||
global $wpdb;
|
||||
$results = $wpdb->get_results( "select post_id, meta_key from $wpdb->postmeta where meta_key = '{$this->meta_key}' AND meta_value = '" . $this->get_group_id() . "' ORDER BY post_id DESC LIMIT $count, 1", ARRAY_A );
|
||||
foreach($results as $meta) {
|
||||
$item = $this->items_repository->fetch((int)$meta['post_id'], [], 'OBJECT');
|
||||
if($item instanceof \Tainacan\Entities\Item) {
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
?>
|
||||
|
@ -489,7 +488,7 @@ class CSV extends Importer {
|
|||
}
|
||||
} else if( strpos($column_value,'file:') === 0 ) {
|
||||
$correct_value = trim(substr($column_value, 5));
|
||||
if( filter_var($correct_value, FILTER_VALIDATE_URL) ) {
|
||||
if( isset(parse_url($correct_value)['scheme'] ) ) {
|
||||
$id = $TainacanMedia->insert_attachment_from_url($correct_value, $item_inserted->get_id());
|
||||
|
||||
if(!$id){
|
||||
|
@ -562,7 +561,7 @@ class CSV extends Importer {
|
|||
if( $attachments ) {
|
||||
foreach( $attachments as $attachment ) {
|
||||
if(empty($attachment)) continue;
|
||||
if( filter_var($attachment, FILTER_VALIDATE_URL) ) {
|
||||
if(isset(parse_url($attachment)['scheme'])) {
|
||||
$id = $TainacanMedia->insert_attachment_from_url($attachment, $item_inserted->get_id());
|
||||
if(!$id) {
|
||||
$this->add_error_log('Error in Attachment file imported from URL ' . $attachment);
|
||||
|
@ -966,7 +965,7 @@ class CSV extends Importer {
|
|||
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') );
|
||||
$this->add_error_log( __("Error while creating metadatum, please review the metadatum description.", 'tainacan') );
|
||||
$this->abort();
|
||||
return false;
|
||||
}
|
||||
|
@ -981,13 +980,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 +1020,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -982,15 +978,22 @@ abstract class Importer {
|
|||
$taxonomy->set_status('publish');
|
||||
$taxonomy->set_allow_insert('yes');
|
||||
|
||||
if($taxonomy->validate()){
|
||||
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*/
|
||||
|
|
|
@ -108,8 +108,8 @@ class Collections extends Repository {
|
|||
'default_displayed_metadata' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Default Displayed Metadata', 'tainacan' ),
|
||||
'type' => 'array/object/string',
|
||||
'items' => [ 'type' => 'array/string/integer/object' ],
|
||||
'type' => ['array', 'object', 'string'],
|
||||
'items' => [ 'type' => ['array','string', 'integer', 'object'] ],
|
||||
'default' => [],
|
||||
'description' => __( 'List of collection properties that will be displayed in the table view', 'tainacan' ),
|
||||
//'validation' => v::stringType(),
|
||||
|
@ -134,16 +134,16 @@ class Collections extends Repository {
|
|||
'metadata_order' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Metadata order', 'tainacan' ),
|
||||
'type' => 'array/object/string',
|
||||
'items' => [ 'type' => 'array/string/integer/object' ],
|
||||
'type' => ['array', 'object', 'string'],
|
||||
'items' => [ 'type' => ['array', 'string', 'integer', 'object'] ],
|
||||
'description' => __( 'The order of the metadata in the collection', 'tainacan' ),
|
||||
//'validation' => v::stringType(),
|
||||
],
|
||||
'filters_order' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Filters order', 'tainacan' ),
|
||||
'type' => 'array/object/string',
|
||||
'items' => [ 'type' => 'array/string/integer/object' ],
|
||||
'type' => ['array', 'object', 'string'],
|
||||
'items' => [ 'type' => ['array', 'string', 'integer', 'object'] ],
|
||||
'description' => __( 'The order of the filters in the collection', 'tainacan' ),
|
||||
//'validation' => v::stringType(),
|
||||
],
|
||||
|
@ -159,7 +159,7 @@ class Collections extends Repository {
|
|||
'cover_page_id' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Cover Page ID', 'tainacan' ),
|
||||
'type' => 'integer/string',
|
||||
'type' => ['integer', 'string'],
|
||||
'description' => __( 'If enabled, this custom page will be used as cover for this collection, instead of default items list.', 'tainacan' ),
|
||||
'on_error' => __( 'Invalid page', 'tainacan' ),
|
||||
//'validation' => v::numeric(),
|
||||
|
@ -194,8 +194,51 @@ class Collections extends Repository {
|
|||
'description' => __( 'Collection items comment status: "open" means comments are allowed, "closed" means comments are not allowed.', 'tainacan' ),
|
||||
'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' ),
|
||||
'type' => 'string',
|
||||
'description' => __( 'Enable this option to never display the item thumbnail on the items list. This is ment for collections made of mainly textual content.', 'tainacan' ),
|
||||
'on_error' => __( 'Value should be yes or no', 'tainacan' ),
|
||||
'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
|
||||
],
|
||||
|
||||
] );
|
||||
}
|
||||
|
||||
|
@ -262,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
|
||||
|
@ -366,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()) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,8 +56,8 @@ class Filters extends Repository {
|
|||
'filter_type_options' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Filter type options', 'tainacan' ),
|
||||
'type' => 'array/object/string',
|
||||
'items' => [ 'type' => 'array/string/integer/object' ],
|
||||
'type' => ['array', 'object', 'string'],
|
||||
'items' => [ 'type' => ['array', 'string', 'integer', 'object'] ],
|
||||
'description' => __( 'The filter type options', 'tainacan' ),
|
||||
'validation' => ''
|
||||
],
|
||||
|
@ -71,14 +71,14 @@ class Filters extends Repository {
|
|||
'collection_id' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Collection', 'tainacan' ),
|
||||
'type' => 'integer/string',
|
||||
'type' => ['integer', 'string'],
|
||||
'description' => __( 'The collection ID', 'tainacan' ),
|
||||
'validation' => ''
|
||||
],
|
||||
'color' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Color', 'tainacan' ),
|
||||
'type' => 'integer/string',
|
||||
'type' => ['integer', 'string'],
|
||||
'description' => __( 'Filter color', 'tainacan' ),
|
||||
'validation' => ''
|
||||
],
|
||||
|
@ -92,7 +92,7 @@ class Filters extends Repository {
|
|||
'max_options' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Max of options', 'tainacan' ),
|
||||
'type' => 'integer/string',
|
||||
'type' => ['integer', 'string'],
|
||||
'description' => __( 'The max number of options to be showed in filter sidebar.', 'tainacan' ),
|
||||
'validation' => '',
|
||||
'default' => 4
|
||||
|
|
|
@ -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()
|
||||
*
|
||||
|
|
|
@ -131,7 +131,7 @@ class Metadata extends Repository {
|
|||
'cardinality' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Cardinality', 'tainacan' ),
|
||||
'type' => 'string/number',
|
||||
'type' => ['string', 'number'],
|
||||
'description' => __( 'Number of multiples possible metadata', 'tainacan' ),
|
||||
'on_error' => __( 'This number of multiples metadata is not allowed', 'tainacan' ),
|
||||
'validation' => v::numeric()->positive(),
|
||||
|
@ -154,22 +154,22 @@ class Metadata extends Repository {
|
|||
'metadata_type_options' => [ // not showed in form
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Metadata type options', 'tainacan' ),
|
||||
'type' => 'array/object/string',
|
||||
'items' => [ 'type' => 'array/string/integer/object' ],
|
||||
'type' => ['array', 'object', 'string'],
|
||||
'items' => [ 'type' => ['array', 'string', 'integer', 'object'] ],
|
||||
'description' => __( 'Specific options for metadata type', 'tainacan' ),
|
||||
// 'validation' => ''
|
||||
],
|
||||
'collection_id' => [ // not showed in form
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Collection', 'tainacan' ),
|
||||
'type' => 'integer/string',
|
||||
'type' => ['integer', 'string'],
|
||||
'description' => __( 'The collection ID', 'tainacan' ),
|
||||
//'validation' => ''
|
||||
],
|
||||
'accept_suggestion' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Metadata Value Accepts Suggestions', 'tainacan' ),
|
||||
'type' => 'bool',
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Allow community to suggest different values for the metadata', 'tainacan' ),
|
||||
'default' => false,
|
||||
'validation' => v::boolType()
|
||||
|
@ -177,8 +177,8 @@ class Metadata extends Repository {
|
|||
'exposer_mapping' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Relationship metadata mapping', 'tainacan' ),
|
||||
'type' => 'array/object/string',
|
||||
'items' => [ 'type' => 'array/string/integer/object' ],
|
||||
'type' => ['array', 'object', 'string'],
|
||||
'items' => [ 'type' => ['array', 'string', 'integer', 'object'] ],
|
||||
'description' => __( 'The metadata mapping options. Metadata can be configured to match another type of data distribution.', 'tainacan' ),
|
||||
'on_error' => __( 'Invalid Metadata Mapping', 'tainacan' ),
|
||||
//'validation' => v::arrayType(),
|
||||
|
@ -187,7 +187,7 @@ class Metadata extends Repository {
|
|||
'display' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'Display', 'tainacan' ),
|
||||
'type' => __( 'string' ),
|
||||
'type' => 'string',
|
||||
'validation' => v::stringType()->in( [ 'yes', 'no', 'never' ] ),
|
||||
'description' => __( 'Display by default on listing or do not display or never display.', 'tainacan' ),
|
||||
'default' => 'no'
|
||||
|
@ -195,7 +195,7 @@ class Metadata extends Repository {
|
|||
'semantic_uri' => [
|
||||
'map' => 'meta',
|
||||
'title' => __( 'The semantic metadatum description URI' ),
|
||||
'type' => __( 'url' ),
|
||||
'type' => 'string',
|
||||
'validation' => v::optional( v::url() ),
|
||||
'description' => __( 'The semantic metadatum description URI like: ', 'tainacan' ) . 'https://schema.org/URL',
|
||||
'default' => ''
|
||||
|
@ -326,17 +326,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 +432,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 +455,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 +575,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 +658,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 +784,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 +1007,6 @@ class Metadata extends Repository {
|
|||
$set_ = 'set_' . $attribute;
|
||||
$metadatum->$set_( $value );
|
||||
}
|
||||
|
||||
if ( $metadatum->validate() ) {
|
||||
$metadatum = $this->insert( $metadatum );
|
||||
|
||||
|
@ -1168,7 +1262,7 @@ class Metadata extends Repository {
|
|||
} else {
|
||||
$pages = ceil( $total / $number );
|
||||
}
|
||||
|
||||
$separator = strip_tags(apply_filters('tainacan-terms-hierarchy-html-separator', '>'));
|
||||
$values = [];
|
||||
foreach ($results as $r) {
|
||||
|
||||
|
@ -1203,7 +1297,8 @@ class Metadata extends Repository {
|
|||
'taxonomy_id' => $taxonomy_id,
|
||||
'parent' => $r->parent,
|
||||
'total_items' => $total_items,
|
||||
'type' => 'Taxonomy'
|
||||
'type' => 'Taxonomy',
|
||||
'hierarchy_path' => get_term_parents_list($r->term_id, $taxonomy_slug, ['format'=>'name', 'separator'=>$separator, 'link'=>false, 'inclusive'=>false])
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -1248,6 +1343,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
|
||||
|
@ -173,9 +176,12 @@ abstract class Repository {
|
|||
$diffs = $this->insert_metadata( $obj, $prop, $diffs );
|
||||
}
|
||||
}
|
||||
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 );
|
||||
|
|
|
@ -68,7 +68,7 @@ class Taxonomies extends Repository {
|
|||
'enabled_post_types' => [
|
||||
'map' => 'meta_multi',
|
||||
'title' => __( 'Enabled for post types', 'tainacan' ),
|
||||
'type' => 'array/string',
|
||||
'type' => ['array', 'string'],
|
||||
'description' => __( 'Also enable this taxonomy for other WordPress post types', 'tainacan' ),
|
||||
'on_error' => __( 'Error enabling this taxonomy for post types', 'tainacan' ),
|
||||
'validation' => '',
|
||||
|
|
|
@ -91,7 +91,7 @@ class Terms extends Repository {
|
|||
'hide_empty' => [
|
||||
'map' => 'hide_empty',
|
||||
'title' => __( 'Hide empty', 'tainacan' ),
|
||||
'type' => 'bool',
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Hide empty terms', 'tainacan' )
|
||||
]
|
||||
] );
|
||||
|
|
|
@ -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' ) );
|
||||
|
@ -64,7 +65,8 @@ class Theme_Helper {
|
|||
'dynamic_metadata' => true,
|
||||
'icon' => '<span class="icon"><i class="tainacan-icon tainacan-icon-viewtable tainacan-icon-1-25em"></i></span>',
|
||||
'type' => 'component',
|
||||
'implements_skeleton' => true
|
||||
'implements_skeleton' => true,
|
||||
'requires_thumbnail' => false
|
||||
]);
|
||||
$this->register_view_mode('cards', [
|
||||
'label' => __('Cards', 'tainacan'),
|
||||
|
@ -72,7 +74,8 @@ class Theme_Helper {
|
|||
'description' => 'A cards view, displaying title, description, author name and creation date.',
|
||||
'icon' => '<span class="icon"><i class="tainacan-icon tainacan-icon-viewcards tainacan-icon-1-25em"></i></span>',
|
||||
'type' => 'component',
|
||||
'implements_skeleton' => true
|
||||
'implements_skeleton' => true,
|
||||
'requires_thumbnail' => false
|
||||
]);
|
||||
$this->register_view_mode('records', [
|
||||
'label' => __('Records', 'tainacan'),
|
||||
|
@ -80,7 +83,8 @@ class Theme_Helper {
|
|||
'description' => 'A records view, similiar to cards, but flexible for metadata',
|
||||
'icon' => '<span class="icon"><i class="tainacan-icon tainacan-icon-viewrecords tainacan-icon-1-25em"></i></span>',
|
||||
'type' => 'component',
|
||||
'implements_skeleton' => true
|
||||
'implements_skeleton' => true,
|
||||
'requires_thumbnail' => false
|
||||
]);
|
||||
$this->register_view_mode('masonry', [
|
||||
'label' => __('Masonry', 'tainacan'),
|
||||
|
@ -99,6 +103,15 @@ class Theme_Helper {
|
|||
'show_pagination' => false,
|
||||
'full_screen' => true
|
||||
]);
|
||||
$this->register_view_mode('list', [
|
||||
'label' => __('List', 'tainacan'),
|
||||
'dynamic_metadata' => true,
|
||||
'description' => 'A list view, similiar to the records, but full width',
|
||||
'icon' => '<span class="icon"><i class="tainacan-icon tainacan-icon-viewlist tainacan-icon-1-25em"></i></span>',
|
||||
'type' => 'component',
|
||||
'implements_skeleton' => true,
|
||||
'requires_thumbnail' => false
|
||||
]);
|
||||
}
|
||||
|
||||
public function enqueue_scripts($force = false) {
|
||||
|
@ -354,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 = ' ';
|
||||
|
@ -383,6 +418,10 @@ class Theme_Helper {
|
|||
$collection = new \Tainacan\Entities\Collection($collection_id);
|
||||
$default_view_mode = $collection->get_default_view_mode();
|
||||
$enabled_view_modes = $collection->get_enabled_view_modes();
|
||||
|
||||
|
||||
// Gets hideItemsThumbnail info from collection setting
|
||||
$args['hide-items-thumbnail'] = $collection->get_hide_items_thumbnail_on_lists() == 'yes' ? true : false;
|
||||
}
|
||||
|
||||
// If in a tainacan taxonomy
|
||||
|
@ -469,22 +508,23 @@ class Theme_Helper {
|
|||
* @param array|string $args {
|
||||
* Optional. Array of arguments
|
||||
*
|
||||
* @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 $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:
|
||||
* * items - the list of items to be rendered
|
||||
* * displayed-metadata - list of metadata to be displayed
|
||||
* Default view-mode-{$slug}
|
||||
* @type string $thumbnail Full URL to an thumbnail that represents the view mode. Displayed in admin.
|
||||
* @type string $icon HTML that outputs an icon that represents the view mode. Displayed in front end.
|
||||
* @type bool $show_pagination Wether to display or not pagination controls. Default true.
|
||||
* @type bool $full_screen Wether the view mode will display full screen or not. Default false.
|
||||
* @type bool $dynamic_metadata Wether to display or not (and use or not) the "displayed metadata" selector. Default false.
|
||||
*
|
||||
*
|
||||
* @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'. 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:
|
||||
* * items - the list of items to be rendered
|
||||
* * displayed-metadata - list of metadata to be displayed
|
||||
* Default view-mode-{$slug}
|
||||
* @type string $thumbnail Full URL to an thumbnail that represents the view mode. Displayed in admin.
|
||||
* @type string $icon HTML that outputs an icon that represents the view mode. Displayed in front end.
|
||||
* @type bool $show_pagination Wether to display or not pagination controls. Default true.
|
||||
* @type bool $full_screen Wether the view mode will display full screen or not. Default false.
|
||||
* @type bool $dynamic_metadata Wether to display or not (and use or not) the "displayed metadata" selector. Default false.
|
||||
* @type bool $implements_skeleton Wether the view mode has its own strategy for disaplying loading state.
|
||||
* @type string $skeleton_template If the view mode is a template, this is the html of its loading state.
|
||||
* @type bool $required_thumbnail Wether the view mode considers essential that the item thumbnail is available, even if it is a placeholder.
|
||||
* }
|
||||
*
|
||||
* @return void
|
||||
|
@ -503,8 +543,8 @@ class Theme_Helper {
|
|||
'full_screen' => false,
|
||||
'dynamic_metadata' => false,
|
||||
'implements_skeleton' => false,
|
||||
'skeleton_template' => ''
|
||||
|
||||
'skeleton_template' => '',
|
||||
'requires_thumbnail' => true
|
||||
);
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
|
@ -550,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');
|
||||
}
|
||||
|
@ -572,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);
|
||||
|
||||
|
@ -619,6 +659,82 @@ class Theme_Helper {
|
|||
|
||||
<?php } else { return; } // End if().
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get previous and next item according to current search query
|
||||
*
|
||||
* @param integer $index the position of the item in the current list. This should be added to pagination.
|
||||
*
|
||||
* @return array containing the next and previous item
|
||||
*/
|
||||
public function get_adjacent_items() {
|
||||
|
||||
// Array with the link results. If nothing goes well here we just don't have any link :(
|
||||
$adjacent_items = [
|
||||
'next' => null,
|
||||
'previous' => null
|
||||
];
|
||||
|
||||
// Adjusts the args to obtain only on one item per request with the correct offset
|
||||
$args = $_GET;
|
||||
|
||||
// Defines where are we getting items from
|
||||
$entity = [];
|
||||
if (isset($args['source_list']) && $args['source_list'] == 'collection' && $collection_id = tainacan_get_collection_id()) {
|
||||
$entity = \Tainacan\Repositories\Collections::get_instance()->fetch($collection_id);
|
||||
}
|
||||
unset($args['source_list']);
|
||||
|
||||
if (isset($args['pos'])) {
|
||||
|
||||
// Sets Page based on position
|
||||
$args['perpage'] = '1';
|
||||
$current_position = (int)$args['pos'] + 1;
|
||||
unset($args['pos']);
|
||||
$args = (new \Tainacan\API\EndPoints\REST_Items_Controller())->process_request_filters($args);
|
||||
|
||||
// Fetch Previous Item
|
||||
if($current_position > 1) {
|
||||
$args['paged'] = $current_position - 1;
|
||||
$items = \Tainacan\Repositories\Items::get_instance()->fetch($args, $entity, 'WP_Query');
|
||||
|
||||
if ($items->have_posts()) {
|
||||
$items->the_post();
|
||||
$item = new Entities\Item($items->post);
|
||||
|
||||
if (!empty($item) && $item instanceof \Tainacan\Entities\Item) {
|
||||
$adjacent_items['previous'] = [
|
||||
'url' => get_permalink( $item->get_id() ) . '?' . http_build_query(array_merge($_GET, ['pos'=> $current_position-2])),
|
||||
'title' => $item->get_title(),
|
||||
'thumbnail' => $item->get_thumbnail()
|
||||
];
|
||||
}
|
||||
\wp_reset_postdata();
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch Next Item
|
||||
$args['paged'] = $current_position + 1;
|
||||
$items = \Tainacan\Repositories\Items::get_instance()->fetch($args, $entity, 'WP_Query');
|
||||
|
||||
if ($items->have_posts()) {
|
||||
$items->the_post();
|
||||
$item = new Entities\Item($items->post);
|
||||
|
||||
if (!empty($item) && $item instanceof \Tainacan\Entities\Item) {
|
||||
$adjacent_items['next'] = [
|
||||
'url' => get_permalink( $item->get_id() ) . '?' . http_build_query(array_merge($_GET, ['pos'=> $current_position])),
|
||||
'title' => $item->get_title(),
|
||||
'thumbnail' => $item->get_thumbnail()
|
||||
];
|
||||
}
|
||||
\wp_reset_postdata();
|
||||
}
|
||||
}
|
||||
|
||||
return $adjacent_items;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -181,6 +181,19 @@ function tainacan_get_the_collection_name() {
|
|||
return apply_filters('tainacan-get-collection-name', $name, $collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* When visiting an item single page containing a search query, returns the previous and next items
|
||||
*
|
||||
* @return array containing next and previous items with basic url, title and thumbnail information
|
||||
*/
|
||||
function tainacan_get_adjacent_items() {
|
||||
if ( is_single() ) {
|
||||
return \Tainacan\Theme_Helper::get_instance()->get_adjacent_items();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* When visiting a collection archive or single, prints the collection name
|
||||
*
|
||||
|
@ -241,9 +254,9 @@ function tainacan_the_collection_url() {
|
|||
|
||||
|
||||
/**
|
||||
* get related to view modes
|
||||
* Get related to view modes
|
||||
*
|
||||
* @return array ['default_view_mode'=> [], '$enabled_view_modes'=> [] ]
|
||||
* @return array ['default_view_mode'=> '', '$enabled_view_modes'=> [], , '$registered_view_modes'=> [] ]
|
||||
*/
|
||||
function tainacan_get_the_view_modes() {
|
||||
$default_view_mode = apply_filters( 'tainacan-default-view-mode-for-themes', 'masonry' );
|
||||
|
@ -253,6 +266,15 @@ function tainacan_get_the_view_modes() {
|
|||
array_push($registered_view_modes_slugs, $key);
|
||||
}
|
||||
$enabled_view_modes = apply_filters( 'tainacan-enabled-view-modes-for-themes', $registered_view_modes_slugs );
|
||||
|
||||
// If in a collection page
|
||||
$collection_id = tainacan_get_collection_id();
|
||||
if ($collection_id) {
|
||||
$collection = new \Tainacan\Entities\Collection($collection_id);
|
||||
$default_view_mode = $collection->get_default_view_mode();
|
||||
$enabled_view_modes = $collection->get_enabled_view_modes();
|
||||
}
|
||||
|
||||
return [
|
||||
'default_view_mode' => $default_view_mode,
|
||||
'enabled_view_modes' => $enabled_view_modes,
|
||||
|
@ -260,6 +282,22 @@ function tainacan_get_the_view_modes() {
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a view mode is enabled in the current list instance
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function tainacan_is_view_mode_enabled($view_mode_slug) {
|
||||
$view_modes = tainacan_get_the_view_modes();
|
||||
|
||||
if (is_array($view_modes['enabled_view_modes'])) {
|
||||
foreach($view_modes['enabled_view_modes'] as $view_mode) {
|
||||
if ($view_mode == $view_mode_slug)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the div used by Vue to render the Items List with a powerful faceted search
|
||||
|
@ -279,6 +317,7 @@ function tainacan_get_the_view_modes() {
|
|||
* @type bool $hide_displayed_metadata_dropdown Hides the "Displayed metadata" dropdown even if the current view modes allows it
|
||||
* @type bool $hide_sorting_area Completely hides all sorting controls
|
||||
* @type bool $hide_sort_by_button Hides the button where user can select the metadata to sort by items (keeps the sort direction)
|
||||
* @type bool $hide_items_thumbnail Forces the thumbnail to be hiden on every listing. This setting also disables view modes that contain the 'requires-thumbnail' attr. By default is false or inherited from collection setting
|
||||
* @type bool $hide_exposers_button Hides the "View as..." button, a.k.a. Exposers modal
|
||||
* @type bool $hide_items_per_page_button Hides the button for selecting amount of items loaded per page
|
||||
* @type bool $hide_go_to_page_button Hides the button for skiping to a specific page
|
||||
|
@ -319,13 +358,15 @@ function tainacan_the_faceted_search($args = array()) {
|
|||
// If in a collection page
|
||||
$collection_id = tainacan_get_collection_id();
|
||||
if ($collection_id) {
|
||||
|
||||
$props .= 'collection-id="' . $collection_id . '" ';
|
||||
$collection = new \Tainacan\Entities\Collection($collection_id);
|
||||
$default_view_mode = $collection->get_default_view_mode();
|
||||
$enabled_view_modes = $collection->get_enabled_view_modes();
|
||||
|
||||
// Gets hideItemsThumbnail info from collection setting
|
||||
$args['hide-items-thumbnail'] = $collection->get_hide_items_thumbnail_on_lists() == 'yes' ? true : false;
|
||||
}
|
||||
|
||||
|
||||
// If in a tainacan taxonomy
|
||||
$term = tainacan_get_term();
|
||||
if ($term) {
|
||||
|
@ -446,9 +487,8 @@ function tainacan_register_view_mode($slug, $args = []) {
|
|||
function tainacan_get_item($post_id = 0) {
|
||||
$post = get_post( $post_id );
|
||||
|
||||
if (!$post) {
|
||||
if (!$post)
|
||||
return null;
|
||||
}
|
||||
|
||||
$theme_helper = \Tainacan\Theme_Helper::get_instance();
|
||||
|
||||
|
|
|
@ -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,83 +2,88 @@
|
|||
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.5
|
||||
Requires PHP: 5.6
|
||||
Stable tag: 0.16.3
|
||||
Stable tag: 0.17
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Tainacan is an open-source, powerful and flexible 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.
|
||||
|
||||
Tainacan is an open-source, powerful and flexible digital repository platform for WordPress. With all the tools of a professional repository platform, you can manage and publish your digital collections as easily as posting to your blog. It is versatile and can be used to create a digital collection, a digital library or a digital repository for your institutional or personal collection.
|
||||
|
||||
== 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, powerful and flexible 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.
|
||||
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.
|
||||
|
||||
|
||||
|
||||
= Features =
|
||||
|
||||
|
||||
* "Metadata and Filters": Use a metadata standard or choose whatever set of metadata you want to describe the items in your collections. Also, choose which metadata will be used as a filter when browsing collections.
|
||||
|
||||
|
||||
* "Faceted Search". Browse your collection (and let the public browse it) using a faceted search interface with the filters you have chosen.
|
||||
|
||||
|
||||
* "Manage Taxonomies": Manage vocabularies that can be used across all your collections.
|
||||
|
||||
|
||||
* "Themes": The Tainacan plugin has its own default theme, which helps you to showcase your collections in a beautiful and effective manner. But it can also work with any WordPress theme, so interface developers can easily add Tainacan specific features to an existing theme.
|
||||
|
||||
|
||||
* "API and Interoperability": Tainacan implements a RESTful API (read and write) to allow other applications to interact with your repository. That way, you can expose your collection in different formats, such as JSON, JsonLD, OAI-PMH and others. If your collection has a specific set of metadata, you can map this metadata to match the patterns you want to use.
|
||||
|
||||
|
||||
* "Gutenberg blocks": Tell stories with your collections. Tainacan offers you several Gutenberg blocks so you can present your collections to the public in many different ways!
|
||||
|
||||
|
||||
== Getting Started ==
|
||||
|
||||
|
||||
After installation, you will see a new menu item in your admin panel called "Tainacan". Click on it to open the Tainacan admin interface.
|
||||
|
||||
|
||||
To get an overview of the main concepts of Tainacan, please visit [this page](https://tainacan.github.io/tainacan-wiki/#/general-concepts).
|
||||
|
||||
|
||||
= Create a collection =
|
||||
|
||||
|
||||
Click "New Collection" to create a new collection, use a mapping standard or import it using one of our importers.
|
||||
|
||||
|
||||
= Configure your collection =
|
||||
|
||||
|
||||
Navigate to the top menu to set your collection up. Create the metadata that items in this collection will have, and choose, from these metadata, which ones are going to be used as a filter.
|
||||
|
||||
|
||||
= Add items =
|
||||
|
||||
|
||||
Back to the "Items" screen, click "Add new" to create a new item.
|
||||
|
||||
|
||||
= Manage and browse your collection =
|
||||
|
||||
|
||||
Through this admin interface you can manage your collection and browse its item using the faceted search interface or advanced search interface.
|
||||
|
||||
|
||||
If you want to visit your collections in the public side of your site, using your current theme, visit http://your-site/collections and you will get the list of your collections.
|
||||
|
||||
|
||||
= Set up Taxonomies =
|
||||
|
||||
|
||||
You can also have metadata as taxonomies, which you can configure with a set of hierarchical terms of your own vocabulary.
|
||||
|
||||
|
||||
= Add links to your menu =
|
||||
|
||||
|
||||
Edit your menu and links directly to your collections. Click "Screen options" at the top of the Menu edition page and enable "Collections".
|
||||
|
||||
|
||||
If you want to add a link to the list of collections, click "View all" tab on the Collections box on the left, and then add the first item named "Collections" to the menu.
|
||||
|
||||
|
||||
= Faceted search in your theme =
|
||||
|
||||
To have a fully-featured faceted search in your theme, you can either make it compatible with a few templates or use our Faceted Search Block.
|
||||
|
||||
|
||||
To have a fully-featured faceted search in your theme, you can either make it compatible with a few templates or use our Faceted Search Block.
|
||||
|
||||
== Installation ==
|
||||
|
||||
|
||||
Upload the files to the plugins directory and activate it. You can also install and activate directly from the admin panel.
|
||||
|
||||
|
||||
If you have Imagick installed in your server, Tainacan will be able to automatically generate a thumbnail from your PDF files. This is desired but not required.
|
||||
|
||||
|
||||
== Find out more ==
|
||||
|
||||
|
||||
* Visit our official website: [https://tainacan.org/](https://tainacan.org/)
|
||||
* Check our documentation Wiki: [https://wiki.tainacan.org/](https://wiki.tainacan.org/)
|
||||
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
|
||||
1. Manage your repository
|
||||
2. Set up your collection
|
||||
3. Choose the metadata and filters for your collection
|
||||
|
|
|
@ -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
|
||||
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';
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
$TAINACAN_BASE_URL = plugins_url('', __FILE__);
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
import PrimaryMenu from './components/navigation/primary-menu.vue';
|
||||
import TainacanHeader from './components/navigation/tainacan-header.vue';
|
||||
import TainacanRepositorySubheader from './components/navigation/tainacan-repository-subheader.vue';
|
||||
import CustomDialog from './components/other/custom-dialog.vue';
|
||||
|
||||
export default {
|
||||
name: "AdminPage",
|
||||
|
@ -76,6 +77,34 @@
|
|||
this.isMenuCompressed = (this.$route.params.collectionId != undefined);
|
||||
this.activeRoute = this.$route.name;
|
||||
this.isRepositoryLevel = this.$route.params.collectionId == undefined;
|
||||
|
||||
if (jQuery && jQuery( document )) {
|
||||
jQuery( document ).ajaxError(this.onHeartBitError);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onHeartBitError(event, jqxhr, settings) {
|
||||
if (settings && settings.url == '/wp-admin/admin-ajax.php') {
|
||||
this.$buefy.snackbar.open({
|
||||
message: this.$i18n.get('error_connectivity'),
|
||||
type: 'is-danger',
|
||||
duration: 5000,
|
||||
actionText: this.$i18n.get('label_know_more'),
|
||||
onAction: () => {
|
||||
this.$buefy.modal.open({
|
||||
component: CustomDialog,
|
||||
props: {
|
||||
title: this.$i18n.get('error_connectivity_label'),
|
||||
message: this.$i18n.get('error_connectivity_detail'),
|
||||
hideCancel: true
|
||||
},
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -104,6 +104,7 @@
|
|||
:label="$i18n.get('label_cover_page')"
|
||||
:type="editFormErrors['cover_page_id'] != undefined ? 'is-danger' : ''"
|
||||
:message="editFormErrors['cover_page_id'] != undefined ? editFormErrors['cover_page_id'] : ''">
|
||||
|
||||
<b-switch
|
||||
id="tainacan-checkbox-cover-page"
|
||||
size="is-small"
|
||||
|
@ -196,6 +197,22 @@
|
|||
{{ $i18n.get('label_create_new_page') }}</a>
|
||||
</b-field>
|
||||
|
||||
<!-- Hide Items Thumbnail on Lists ------------------------ -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.getHelperTitle('collections', 'hide_items_thumbnail_on_lists')">
|
||||
|
||||
<b-switch
|
||||
id="tainacan-checkbox-comment-status"
|
||||
size="is-small"
|
||||
true-value="yes"
|
||||
false-value="no"
|
||||
v-model="form.hide_items_thumbnail_on_lists" />
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'hide_items_thumbnail_on_lists')"
|
||||
:message="$i18n.getHelperMessage('collections', 'hide_items_thumbnail_on_lists')"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Enabled View Modes ------------------------------- -->
|
||||
<div class="field">
|
||||
<label class="label">{{ $i18n.get('label_view_modes_available') }}</label>
|
||||
|
@ -269,21 +286,6 @@
|
|||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<!-- Comment Status ------------------------ -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.get('label_allow_comments')">
|
||||
<b-switch
|
||||
id="tainacan-checkbox-comment-status"
|
||||
size="is-small"
|
||||
true-value="open"
|
||||
false-value="closed"
|
||||
v-model="form.allow_comments" />
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'allow_comments')"
|
||||
:message="$i18n.getHelperMessage('collections', 'allow_comments')"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
<template
|
||||
v-if="formHooks != undefined &&
|
||||
|
@ -429,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')"/>
|
||||
|
@ -437,9 +439,118 @@
|
|||
id="tainacan-text-slug"
|
||||
@input="updateSlug"
|
||||
v-model="form.slug"
|
||||
@focus="clearErrors('slug')"/>
|
||||
@focus="clearErrors('slug')"
|
||||
:disabled="isUpdatingSlug"
|
||||
:loading="isUpdatingSlug"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Comment Status ------------------------ -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.get('label_allow_comments')">
|
||||
|
||||
<b-switch
|
||||
id="tainacan-checkbox-comment-status"
|
||||
size="is-small"
|
||||
true-value="open"
|
||||
false-value="closed"
|
||||
v-model="form.allow_comments" />
|
||||
<help-button
|
||||
:title="$i18n.getHelperTitle('collections', 'allow_comments')"
|
||||
: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 &&
|
||||
|
@ -537,7 +648,12 @@ export default {
|
|||
files:[],
|
||||
enabled_view_modes: [],
|
||||
default_view_mode: [],
|
||||
allow_comments: ''
|
||||
allow_comments: '',
|
||||
allows_submission: 'no',
|
||||
submission_default_status: 'draft',
|
||||
submission_anonymous_user: 'no',
|
||||
hide_items_thumbnail_on_lists: '',
|
||||
submission_use_recaptcha: 'no'
|
||||
},
|
||||
thumbnail: {},
|
||||
cover: {},
|
||||
|
@ -559,16 +675,39 @@ export default {
|
|||
isFetchingCollections: true,
|
||||
thumbnailMediaFrame: undefined,
|
||||
headerImageMediaFrame: undefined,
|
||||
registeredViewModes: tainacan_plugin.registered_view_modes,
|
||||
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'
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
watch: {
|
||||
'form.hide_items_thumbnail_on_lists' (newValue) {
|
||||
if (newValue == 'yes') {
|
||||
const validViewModes = {};
|
||||
Object.keys(tainacan_plugin.registered_view_modes).forEach((viewModeKey) => {
|
||||
if (!tainacan_plugin.registered_view_modes[viewModeKey]['requires_thumbnail'])
|
||||
validViewModes[viewModeKey] = tainacan_plugin.registered_view_modes[viewModeKey];
|
||||
});
|
||||
this.registeredViewModes = validViewModes;
|
||||
|
||||
this.form.enabled_view_modes = this.form.enabled_view_modes.filter((aViewMode) => this.registeredViewModes[aViewMode] != undefined );
|
||||
|
||||
this.updateDefaultViewModeBasedOnEnabled();
|
||||
|
||||
// Setting initial view mode
|
||||
if (this.$userPrefs.get('admin_view_mode_' + this.collectionId) == 'masonry' || this.$userPrefs.get('admin_view_mode_' + this.collectionId) == 'grid')
|
||||
this.$userPrefs.set('admin_view_mode_' + this.collectionId, 'table');
|
||||
|
||||
} else {
|
||||
this.registeredViewModes = tainacan_plugin.registered_view_modes;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('settings') }]);
|
||||
|
||||
if (this.$route.query.fromImporter != undefined)
|
||||
|
@ -609,6 +748,11 @@ 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
|
||||
if (this.form.cover_page_id != undefined && this.form.cover_page_id != '') {
|
||||
|
@ -671,9 +815,8 @@ export default {
|
|||
'fetchAllCollectionNames'
|
||||
]),
|
||||
updateSlug: _.debounce(function() {
|
||||
if(!this.form.name || this.form.name.length <= 0){
|
||||
if (!this.form.name || this.form.name.length <= 0)
|
||||
return;
|
||||
}
|
||||
|
||||
this.isUpdatingSlug = true;
|
||||
|
||||
|
@ -690,7 +833,7 @@ export default {
|
|||
|
||||
this.isUpdatingSlug = false;
|
||||
});
|
||||
}, 500),
|
||||
}, 1000),
|
||||
onSubmit(goTo) {
|
||||
|
||||
this.isLoading = true;
|
||||
|
@ -706,7 +849,12 @@ export default {
|
|||
parent: this.form.parent,
|
||||
enabled_view_modes: this.form.enabled_view_modes,
|
||||
default_view_mode: this.form.default_view_mode,
|
||||
allow_comments: this.form.allow_comments
|
||||
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
|
||||
};
|
||||
this.fillExtraFormData(data);
|
||||
|
||||
|
@ -728,6 +876,11 @@ 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 = '';
|
||||
|
@ -781,6 +934,11 @@ 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
|
||||
this.form.status = 'publish';
|
||||
|
@ -828,6 +986,9 @@ export default {
|
|||
else
|
||||
this.form.enabled_view_modes.push(viewMode);
|
||||
|
||||
this.updateDefaultViewModeBasedOnEnabled();
|
||||
},
|
||||
updateDefaultViewModeBasedOnEnabled() {
|
||||
// Puts a valid view mode as default if the current one is not in the list anymore.
|
||||
if (!this.checkIfViewModeEnabled(this.form.default_view_mode)) {
|
||||
const validViewModeIndex = this.form.enabled_view_modes.findIndex((aViewMode) => (this.registeredViewModes[aViewMode] && !this.registeredViewModes[aViewMode].full_screen));
|
||||
|
@ -1082,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>
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ export default {
|
|||
this.uploadedItems.push( item );
|
||||
|
||||
// Uploads Media Document
|
||||
this.sendFile(file)
|
||||
this.sendFile({ itemId: item.id, file:file })
|
||||
.then((uploadedFile) => {
|
||||
|
||||
// Updates Item with Document
|
||||
|
|
|
@ -21,12 +21,14 @@
|
|||
<span style="font-weight: 600;">{{ (item != null && item != undefined) ? item.title : '' }}</span>
|
||||
</h1>
|
||||
<a
|
||||
v-if="!$route.query.iframemode"
|
||||
@click="$router.go(-1)"
|
||||
class="back-link has-text-secondary">
|
||||
{{ $i18n.get('back') }}
|
||||
</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<transition
|
||||
mode="out-in"
|
||||
:name="(isOnSequenceEdit && sequenceRightDirection != undefined) ? (sequenceRightDirection ? 'page-right' : 'page-left') : ''">
|
||||
|
@ -349,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 -->
|
||||
|
@ -483,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 -->
|
||||
|
@ -514,15 +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>
|
||||
<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"
|
||||
|
@ -791,6 +813,7 @@ export default {
|
|||
pageTitle: '',
|
||||
itemId: Number,
|
||||
item: {},
|
||||
itemRequestCancel: undefined,
|
||||
collectionId: Number,
|
||||
sequenceId: Number,
|
||||
itemPosition: Number,
|
||||
|
@ -806,7 +829,9 @@ export default {
|
|||
status: '',
|
||||
document: '',
|
||||
document_type: '',
|
||||
comment_status: ''
|
||||
comment_status: '',
|
||||
thumbnail_id: '',
|
||||
thumbnail_alt: ''
|
||||
},
|
||||
thumbnail: {},
|
||||
formErrorMessage: '',
|
||||
|
@ -882,7 +907,7 @@ export default {
|
|||
this.fetchSequenceGroup({ collectionId: this.collectionId, groupId: this.sequenceId });
|
||||
}
|
||||
},
|
||||
created(){
|
||||
created() {
|
||||
// Obtains collection ID
|
||||
this.cleanItemMetadata();
|
||||
eventBusItemMetadata.clearAllErrors();
|
||||
|
@ -891,12 +916,12 @@ export default {
|
|||
this.form.collectionId = this.collectionId;
|
||||
|
||||
// CREATING NEW SINGLE ITEM
|
||||
if (this.$route.fullPath.split("/").pop() == "new") {
|
||||
if (this.$route.path.split("/").pop() == "new") {
|
||||
this.isCreatingNewItem = true;
|
||||
this.createNewItem();
|
||||
|
||||
// EDITING EXISTING ITEM
|
||||
} else if (this.$route.fullPath.split("/").pop() == "edit") {
|
||||
} else if (this.$route.path.split("/").pop() == "edit") {
|
||||
this.isLoading = true;
|
||||
|
||||
// Obtains current Item ID from URL
|
||||
|
@ -974,6 +999,7 @@ export default {
|
|||
'sendItem',
|
||||
'updateItem',
|
||||
'updateItemDocument',
|
||||
'updateThumbnailAlt',
|
||||
'fetchItemMetadata',
|
||||
'fetchItem',
|
||||
'cleanItemMetadata',
|
||||
|
@ -988,7 +1014,8 @@ export default {
|
|||
...mapGetters('item',[
|
||||
'getItemMetadata',
|
||||
'getTotalAttachments',
|
||||
'getLastUpdated'
|
||||
'getLastUpdated',
|
||||
'getAttachments'
|
||||
]),
|
||||
...mapActions('collection', [
|
||||
'deleteItem',
|
||||
|
@ -1005,6 +1032,7 @@ export default {
|
|||
'getGroup'
|
||||
]),
|
||||
onSubmit(status, sequenceDirection) {
|
||||
|
||||
// Puts loading on Item edition
|
||||
this.isLoading = true;
|
||||
this.sequenceRightDirection = undefined;
|
||||
|
@ -1038,22 +1066,36 @@ 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;
|
||||
|
||||
if (!this.isOnSequenceEdit) {
|
||||
if (this.form.status != 'trash') {
|
||||
if (previousStatus == 'auto-draft')
|
||||
this.$router.push({ path: this.$routerHelper.getItemPath(this.form.collectionId, this.itemId), query: { recent: true } });
|
||||
else
|
||||
this.$router.push(this.$routerHelper.getItemPath(this.form.collectionId, this.itemId));
|
||||
} else
|
||||
this.$router.push(this.$routerHelper.getCollectionPath(this.form.collectionId));
|
||||
if (!this.$route.query.iframemode) {
|
||||
|
||||
if (!this.isOnSequenceEdit) {
|
||||
if (this.form.status != 'trash') {
|
||||
if (previousStatus == 'auto-draft')
|
||||
this.$router.push({ path: this.$routerHelper.getItemPath(this.form.collectionId, this.itemId), query: { recent: true } });
|
||||
else
|
||||
this.$router.push(this.$routerHelper.getItemPath(this.form.collectionId, this.itemId));
|
||||
} else
|
||||
this.$router.push(this.$routerHelper.getCollectionPath(this.form.collectionId));
|
||||
} else {
|
||||
if (sequenceDirection == 'next')
|
||||
this.onNextInSequence();
|
||||
else if (sequenceDirection == 'previous')
|
||||
this.onPrevInSequence();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (sequenceDirection == 'next')
|
||||
this.onNextInSequence();
|
||||
else if (sequenceDirection == 'previous')
|
||||
this.onPrevInSequence();
|
||||
parent.postMessage({
|
||||
type: 'itemCreationMessage',
|
||||
itemId: this.item.id,
|
||||
itemTitle: this.item.title,
|
||||
itemThumbnail: this.item.thumbnail
|
||||
},
|
||||
tainacan_plugin.admin_url);
|
||||
}
|
||||
})
|
||||
.catch((errors) => {
|
||||
|
@ -1076,7 +1118,17 @@ export default {
|
|||
});
|
||||
},
|
||||
onDiscard() {
|
||||
this.$router.go(-1);
|
||||
if (!this.$route.query.iframemode)
|
||||
this.$router.go(-1);
|
||||
else
|
||||
parent.postMessage({
|
||||
type: 'itemCreationMessage',
|
||||
itemId: null,
|
||||
itemTitle: null,
|
||||
itemThumbnail: null
|
||||
},
|
||||
tainacan_plugin.admin_url);
|
||||
|
||||
},
|
||||
createNewItem() {
|
||||
// Puts loading on Draft Item creation
|
||||
|
@ -1093,7 +1145,12 @@ export default {
|
|||
|
||||
// Creates draft Item
|
||||
this.form.comment_status = this.form.comment_status == 'open' ? 'open' : 'closed';
|
||||
let data = {collection_id: this.form.collectionId, status: 'auto-draft', comment_status: this.form.comment_status};
|
||||
let data = { collection_id: this.form.collectionId, status: 'auto-draft', comment_status: this.form.comment_status };
|
||||
|
||||
// If a parameter was passed with a suggestion of item title, use it
|
||||
if (this.$route.query.newitemtitle)
|
||||
data.title = this.$route.query.newitemtitle;
|
||||
|
||||
this.fillExtraFormData(data);
|
||||
this.sendItem(data).then(res => {
|
||||
|
||||
|
@ -1109,6 +1166,18 @@ 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) {
|
||||
eventBusItemMetadata.$emit('input', {
|
||||
itemId: this.itemId,
|
||||
metadatumId: this.$route.query.newmetadatumid,
|
||||
values: this.$route.query.newitemtitle,
|
||||
parentMetaId: 0
|
||||
});
|
||||
}
|
||||
|
||||
// Loads metadata and attachments
|
||||
this.loadMetadata();
|
||||
|
@ -1227,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);
|
||||
})
|
||||
|
@ -1244,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);
|
||||
|
@ -1265,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);
|
||||
})
|
||||
|
@ -1291,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;
|
||||
|
@ -1319,28 +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.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);
|
||||
}
|
||||
|
@ -1348,6 +1445,15 @@ export default {
|
|||
);
|
||||
|
||||
},
|
||||
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;
|
||||
|
||||
|
@ -1375,63 +1481,80 @@ export default {
|
|||
});
|
||||
},
|
||||
loadExistingItem() {
|
||||
// Initializes Media Frames now that itemId exists
|
||||
this.initializeMediaFrames();
|
||||
|
||||
// Cancels previous Request
|
||||
if (this.itemRequestCancel != undefined)
|
||||
this.itemRequestCancel.cancel('Item search Canceled.');
|
||||
|
||||
this.fetchItem({
|
||||
itemId: this.itemId,
|
||||
contextEdit: true,
|
||||
fetchOnly: 'title,thumbnail,status,modification_date,document_type,document,comment_status,document_as_html'
|
||||
})
|
||||
.then(res => {
|
||||
this.item = res;
|
||||
.then((resp) => {
|
||||
resp.request.then((res) => {
|
||||
this.item = res;
|
||||
|
||||
// Checks if user has permission to edit
|
||||
if (!this.item.current_user_can_edit)
|
||||
this.$router.push(this.$routerHelper.getCollectionPath(this.collectionId));
|
||||
// Checks if user has permission to edit
|
||||
if (!this.item.current_user_can_edit)
|
||||
this.$router.push(this.$routerHelper.getCollectionPath(this.collectionId));
|
||||
|
||||
// Updates Collection BreadCrumb
|
||||
if (this.isOnSequenceEdit) {
|
||||
this.$root.$emit('onCollectionBreadCrumbUpdate', [
|
||||
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
|
||||
{ path: '', label: this.$i18n.get('sequence') },
|
||||
{ path: '', label: this.item.title },
|
||||
{ path: '', label: this.$i18n.get('edit') }
|
||||
]);
|
||||
} else {
|
||||
this.$root.$emit('onCollectionBreadCrumbUpdate', [
|
||||
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
|
||||
{ path: this.$routerHelper.getItemPath(this.form.collectionId, this.itemId), label: this.item.title },
|
||||
{ path: '', label: this.$i18n.get('edit') }
|
||||
]);
|
||||
}
|
||||
// Updates Collection BreadCrumb
|
||||
if (this.isOnSequenceEdit) {
|
||||
this.$root.$emit('onCollectionBreadCrumbUpdate', [
|
||||
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
|
||||
{ path: '', label: this.$i18n.get('sequence') },
|
||||
{ path: '', label: this.item.title },
|
||||
{ path: '', label: this.$i18n.get('edit') }
|
||||
]);
|
||||
} else {
|
||||
this.$root.$emit('onCollectionBreadCrumbUpdate', [
|
||||
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
|
||||
{ path: this.$routerHelper.getItemPath(this.form.collectionId, this.itemId), label: this.item.title },
|
||||
{ path: '', label: this.$i18n.get('edit') }
|
||||
]);
|
||||
}
|
||||
|
||||
// Fills hook forms with it's real values
|
||||
this.$nextTick()
|
||||
.then(() => {
|
||||
this.updateExtraFormData(this.item);
|
||||
});
|
||||
// Fills hook forms with it's real values
|
||||
this.$nextTick()
|
||||
.then(() => {
|
||||
this.updateExtraFormData(this.item);
|
||||
});
|
||||
|
||||
// Fill this.form data with current data.
|
||||
this.form.status = this.item.status;
|
||||
this.form.document = this.item.document;
|
||||
this.form.document_type = this.item.document_type;
|
||||
this.form.comment_status = this.item.comment_status;
|
||||
// Fill this.form data with current data.
|
||||
this.form.status = this.item.status;
|
||||
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;
|
||||
if (this.form.document_type != undefined && this.form.document_type == 'text')
|
||||
this.textContent = this.form.document;
|
||||
if (this.form.document_type != undefined && this.form.document_type == 'url')
|
||||
this.urlLink = this.form.document;
|
||||
if (this.form.document_type != undefined && this.form.document_type == 'text')
|
||||
this.textContent = this.form.document;
|
||||
|
||||
if (this.item.status == 'publish' || this.item.status == 'private')
|
||||
this.visibility = this.item.status;
|
||||
if (this.item.status == 'publish' || this.item.status == 'private')
|
||||
this.visibility = this.item.status;
|
||||
|
||||
this.loadMetadata();
|
||||
this.setLastUpdated(this.item.modification_date);
|
||||
this.loadMetadata();
|
||||
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.form.document,
|
||||
thumbnailId: this.form.thumbnail_id });
|
||||
|
||||
// Initializes Media Frames now that itemId and item.document exists
|
||||
this.initializeMediaFrames();
|
||||
});
|
||||
|
||||
// Item resquest token for cancelling
|
||||
this.itemRequestCancel = resp.source;
|
||||
});
|
||||
|
||||
// Fetch current existing attachments
|
||||
this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document });
|
||||
},
|
||||
onNextInSequence() {
|
||||
this.sequenceRightDirection = true;
|
||||
|
@ -1487,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;
|
||||
|
@ -1553,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;
|
||||
}
|
||||
}
|
||||
|
@ -1585,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;
|
||||
}
|
||||
}
|
||||
|
@ -1615,6 +1738,9 @@ export default {
|
|||
}
|
||||
|
||||
.document-field {
|
||||
/deep/ iframe {
|
||||
max-width: 100%;
|
||||
}
|
||||
.document-buttons-row {
|
||||
text-align: right;
|
||||
top: -21px;
|
||||
|
@ -1673,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 {
|
||||
|
@ -1724,7 +1871,7 @@ export default {
|
|||
|
||||
.sequence-progress {
|
||||
height: 5px;
|
||||
background: var(--tainacan-turquoise5);
|
||||
background: var(--tainacan-secondary);
|
||||
width: 0%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
@ -1742,7 +1889,7 @@ export default {
|
|||
|
||||
.sequence-button {
|
||||
background-color: transparent;
|
||||
color: var(--tainacan-turquoise5);
|
||||
color: var(--tainacan-secondary);
|
||||
border: none;
|
||||
|
||||
.icon {
|
||||
|
@ -1753,7 +1900,7 @@ export default {
|
|||
&:focus,
|
||||
&:active {
|
||||
background-color: transparent !important;
|
||||
color: var(--tainacan-turquoise5) !important;
|
||||
color: var(--tainacan-secondary) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<template>
|
||||
<form
|
||||
autofocus
|
||||
role="dialog"
|
||||
tabindex="-1"
|
||||
aria-modal
|
||||
id="termEditForm"
|
||||
class="tainacan-form"
|
||||
:class="{ 'tainacan-modal-content': isModal }"
|
||||
@submit.prevent="saveEdition(editForm)">
|
||||
<div class="tainacan-page-title">
|
||||
<h2>{{ $i18n.get("title_term_edition") }}</h2>
|
||||
<component
|
||||
:is="isModal ? 'header' : 'div'"
|
||||
class="tainacan-page-title"
|
||||
:class="{ 'tainacan-modal-title': isModal }">
|
||||
<h2>{{ editForm & editForm.id && editForm.id != 'new' ? $i18n.get("title_term_edition") : $i18n.get("title_term_creation") }}</h2>
|
||||
<a
|
||||
v-if="editForm && editForm.url != undefined && editForm.url!= ''"
|
||||
target="_blank"
|
||||
|
@ -15,201 +23,203 @@
|
|||
<span class="menu-text">{{ $i18n.get('label_view_on_theme') }}</span>
|
||||
</a>
|
||||
<hr>
|
||||
</div>
|
||||
</component>
|
||||
|
||||
<b-loading
|
||||
:is-full-page="false"
|
||||
:active.sync="isLoading" />
|
||||
<div :class="isModal ? 'modal-card-body' : ''">
|
||||
<b-loading
|
||||
:is-full-page="false"
|
||||
:active.sync="isLoading" />
|
||||
|
||||
<!-- Name -------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:type="((formErrors.name !== '' || formErrors.repeated !== '') && (formErrors.name !== undefined || formErrors.repeated !== undefined )) ? 'is-danger' : ''"
|
||||
:message="formErrors.name ? formErrors.name : formErrors.repeated">
|
||||
<!-- Name -------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:type="((formErrors.name !== '' || formErrors.repeated !== '') && (formErrors.name !== undefined || formErrors.repeated !== undefined )) ? 'is-danger' : ''"
|
||||
:message="formErrors.name ? formErrors.name : formErrors.repeated">
|
||||
<label class="label is-inline">
|
||||
{{ $i18n.get('label_name') }}
|
||||
<span class="required-term-asterisk">*</span>
|
||||
<help-button
|
||||
:title="$i18n.get('label_name')"
|
||||
:message="$i18n.get('info_help_term_name')"/>
|
||||
</label>
|
||||
<b-input
|
||||
:placeholder="$i18n.get('label_term_without_name')"
|
||||
v-model="editForm.name"
|
||||
name="name"
|
||||
@focus="clearErrors({ name: 'name', repeated: 'repeated' })"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
<template
|
||||
v-if="formHooks != undefined &&
|
||||
formHooks['term'] != undefined &&
|
||||
formHooks['term']['begin-left'] != undefined">
|
||||
<form
|
||||
id="form-term-begin-left"
|
||||
class="form-hook-region"
|
||||
v-html="formHooks['term']['begin-left'].join('')"/>
|
||||
</template>
|
||||
|
||||
<div class="columns is-gapless image-and-description-area">
|
||||
<div class="column">
|
||||
|
||||
<!-- Header Image -------------------------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.get('label_image')">
|
||||
<div class="thumbnail-field">
|
||||
<figure class="image">
|
||||
<span
|
||||
v-if="editForm.header_image === undefined || editForm.header_image === false"
|
||||
class="image-placeholder">{{ $i18n.get('label_empty_term_image') }}</span>
|
||||
<img
|
||||
:alt="$i18n.get('label_image')"
|
||||
:src="(editForm.header_image === undefined || editForm.header_image === false) ? headerPlaceholderPath : editForm.header_image">
|
||||
</figure>
|
||||
<div class="thumbnail-buttons-row">
|
||||
<a
|
||||
class="button is-rounded is-secondary"
|
||||
id="button-edit-header"
|
||||
:aria-label="$i18n.get('label_button_edit_header_image')"
|
||||
@click="headerImageMediaFrame.openFrame($event)">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('edit'),
|
||||
autoHide: true,
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon is-small">
|
||||
<i class="tainacan-icon tainacan-icon-edit"/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
class="button is-rounded is-secondary"
|
||||
id="button-delete-header"
|
||||
:aria-label="$i18n.get('label_button_delete_thumb')"
|
||||
@click="deleteHeaderImage()">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('delete'),
|
||||
autoHide: true,
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon is-small">
|
||||
<i class="tainacan-icon tainacan-icon-delete"/>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
<!-- Description -------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:type="formErrors['description'] !== '' && formErrors['description'] !== undefined ? 'is-danger' : ''"
|
||||
:message="formErrors['description']">
|
||||
<label class="label">
|
||||
{{ $i18n.get('label_description') }}
|
||||
<help-button
|
||||
:title="$i18n.get('label_description')"
|
||||
:message="$i18n.get('info_help_term_description')"/>
|
||||
</label>
|
||||
<b-input
|
||||
type="textarea"
|
||||
name="description"
|
||||
v-model="editForm.description"
|
||||
@focus="clearErrors('description')"/>
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Parent -------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:type="((formErrors.parent !== '' || formErrors.repeated !== '') && (formErrors.parent !== undefined || formErrors.repeated !== undefined )) ? 'is-danger' : ''"
|
||||
:message="formErrors.parent ? formErrors : formErrors.repeated">
|
||||
<label class="label is-inline">
|
||||
{{ $i18n.get('label_name') }}
|
||||
<span class="required-term-asterisk">*</span>
|
||||
<help-button
|
||||
:title="$i18n.get('label_name')"
|
||||
:message="$i18n.get('info_help_term_name')"/>
|
||||
</label>
|
||||
<b-input
|
||||
:placeholder="$i18n.get('label_term_without_name')"
|
||||
v-model="editForm.name"
|
||||
name="name"
|
||||
@focus="clearErrors({ name: 'name', repeated: 'repeated' })"/>
|
||||
</b-field>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
<template
|
||||
v-if="formHooks != undefined &&
|
||||
formHooks['term'] != undefined &&
|
||||
formHooks['term']['begin-left'] != undefined">
|
||||
<form
|
||||
id="form-term-begin-left"
|
||||
class="form-hook-region"
|
||||
v-html="formHooks['term']['begin-left'].join('')"/>
|
||||
</template>
|
||||
|
||||
<div class="columns is-gapless image-and-description-area">
|
||||
<div class="column">
|
||||
|
||||
<!-- Header Image -------------------------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:label="$i18n.get('label_image')">
|
||||
<div class="thumbnail-field">
|
||||
<figure class="image">
|
||||
<span
|
||||
v-if="editForm.header_image === undefined || editForm.header_image === false"
|
||||
class="image-placeholder">{{ $i18n.get('label_empty_term_image') }}</span>
|
||||
<img
|
||||
:alt="$i18n.get('label_image')"
|
||||
:src="(editForm.header_image === undefined || editForm.header_image === false) ? headerPlaceholderPath : editForm.header_image">
|
||||
</figure>
|
||||
<div class="thumbnail-buttons-row">
|
||||
<a
|
||||
class="button is-rounded is-secondary"
|
||||
id="button-edit-header"
|
||||
:aria-label="$i18n.get('label_button_edit_header_image')"
|
||||
@click="headerImageMediaFrame.openFrame($event)">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('edit'),
|
||||
autoHide: true,
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon is-small">
|
||||
<i class="tainacan-icon tainacan-icon-edit"/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
class="button is-rounded is-secondary"
|
||||
id="button-delete-header"
|
||||
:aria-label="$i18n.get('label_button_delete_thumb')"
|
||||
@click="deleteHeaderImage()">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('delete'),
|
||||
autoHide: true,
|
||||
classes: ['tooltip', 'repository-tooltip'],
|
||||
placement: 'bottom'
|
||||
}"
|
||||
class="icon is-small">
|
||||
<i class="tainacan-icon tainacan-icon-delete"/>
|
||||
</span>
|
||||
</a>
|
||||
{{ $i18n.get('label_parent_term') }}
|
||||
<b-switch
|
||||
@input="onToggleSwitch()"
|
||||
id="tainacan-checkbox-has-parent"
|
||||
size="is-small"
|
||||
v-model="hasParent" />
|
||||
<help-button
|
||||
:title="$i18n.get('label_parent_term')"
|
||||
:message="$i18n.get('info_help_parent_term')"/>
|
||||
</label>
|
||||
<b-autocomplete
|
||||
id="tainacan-add-parent-field"
|
||||
:placeholder="$i18n.get('instruction_parent_term')"
|
||||
:data="parentTerms"
|
||||
field="name"
|
||||
clearable
|
||||
v-model="parentTermName"
|
||||
@select="onSelectParentTerm($event)"
|
||||
:loading="isFetchingParentTerms"
|
||||
@input="fetchParentTerms"
|
||||
@focus="clearErrors('parent');"
|
||||
:disabled="!hasParent"
|
||||
check-infinite-scroll
|
||||
@infinite-scroll="fetchMoreParentTerms">
|
||||
<template slot-scope="props">
|
||||
<div class="media">
|
||||
<div
|
||||
v-if="props.option.header_image"
|
||||
class="media-left">
|
||||
<img
|
||||
width="28"
|
||||
:src="props.option.header_image">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{{ props.option.name }}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
</b-field>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="empty">{{ $i18n.get('info_no_parent_term_found') }}</template>
|
||||
</b-autocomplete>
|
||||
<transition name="fade">
|
||||
<p
|
||||
class="checkboxes-warning"
|
||||
v-show="isModal != true && showCheckboxesWarning == true">
|
||||
{{ $i18n.get('info_warning_changing_parent_term') }}
|
||||
</p>
|
||||
</transition>
|
||||
</b-field>
|
||||
|
||||
<div class="column">
|
||||
<!-- Description -------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:type="formErrors['description'] !== '' && formErrors['description'] !== undefined ? 'is-danger' : ''"
|
||||
:message="formErrors['description']">
|
||||
<label class="label">
|
||||
{{ $i18n.get('label_description') }}
|
||||
<help-button
|
||||
:title="$i18n.get('label_description')"
|
||||
:message="$i18n.get('info_help_term_description')"/>
|
||||
</label>
|
||||
<b-input
|
||||
type="textarea"
|
||||
name="description"
|
||||
v-model="editForm.description"
|
||||
@focus="clearErrors('description')"/>
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Hook for extra Form options -->
|
||||
<template
|
||||
v-if="formHooks != undefined &&
|
||||
formHooks['term'] != undefined &&
|
||||
formHooks['term']['end-left'] != undefined">
|
||||
<form
|
||||
id="form-term-end-left"
|
||||
class="form-hook-region"
|
||||
v-html="formHooks['term']['end-left'].join('')"/>
|
||||
</template>
|
||||
|
||||
<!-- Parent -------------- -->
|
||||
<b-field
|
||||
:addons="false"
|
||||
:type="((formErrors.parent !== '' || formErrors.repeated !== '') && (formErrors.parent !== undefined || formErrors.repeated !== undefined )) ? 'is-danger' : ''"
|
||||
:message="formErrors.parent ? formErrors : formErrors.repeated">
|
||||
<label class="label is-inline">
|
||||
{{ $i18n.get('label_parent_term') }}
|
||||
<b-switch
|
||||
@input="onToggleSwitch()"
|
||||
id="tainacan-checkbox-has-parent"
|
||||
size="is-small"
|
||||
v-model="hasParent" />
|
||||
<help-button
|
||||
:title="$i18n.get('label_parent_term')"
|
||||
:message="$i18n.get('info_help_parent_term')"/>
|
||||
</label>
|
||||
<b-autocomplete
|
||||
id="tainacan-add-parent-field"
|
||||
:placeholder="$i18n.get('instruction_parent_term')"
|
||||
:data="parentTerms"
|
||||
field="name"
|
||||
clearable
|
||||
v-model="parentTermName"
|
||||
@select="onSelectParentTerm($event)"
|
||||
:loading="isFetchingParentTerms"
|
||||
@input="fetchParentTerms"
|
||||
@focus="clearErrors('parent');"
|
||||
:disabled="!hasParent"
|
||||
check-infinite-scroll
|
||||
@infinite-scroll="fetchMoreParentTerms">
|
||||
<template slot-scope="props">
|
||||
<div class="media">
|
||||
<div
|
||||
v-if="props.option.header_image"
|
||||
class="media-left">
|
||||
<img
|
||||
width="28"
|
||||
:src="props.option.header_image">
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{{ props.option.name }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="empty">{{ $i18n.get('info_no_parent_term_found') }}</template>
|
||||
</b-autocomplete>
|
||||
<transition name="fade">
|
||||
<p
|
||||
class="checkboxes-warning"
|
||||
v-show="showCheckboxesWarning == true">
|
||||
{{ $i18n.get('info_warning_changing_parent_term') }}
|
||||
</p>
|
||||
</transition>
|
||||
</b-field>
|
||||
|
||||
<!-- Hook for extra Form options -->
|
||||
<template
|
||||
v-if="formHooks != undefined &&
|
||||
formHooks['term'] != undefined &&
|
||||
formHooks['term']['end-left'] != undefined">
|
||||
<form
|
||||
id="form-term-end-left"
|
||||
class="form-hook-region"
|
||||
v-html="formHooks['term']['end-left'].join('')"/>
|
||||
</template>
|
||||
|
||||
<!-- Submit buttons -------------- -->
|
||||
<div class="field is-grouped form-submit">
|
||||
<div class="control">
|
||||
<button
|
||||
type="button"
|
||||
class="button is-outlined"
|
||||
@click.prevent="cancelEdition()"
|
||||
slot="trigger">
|
||||
{{ $i18n.get('cancel') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-success"
|
||||
type="submit">
|
||||
{{ $i18n.get('save') }}
|
||||
</button>
|
||||
<!-- Submit buttons -------------- -->
|
||||
<div class="field is-grouped form-submit">
|
||||
<div class="control">
|
||||
<button
|
||||
type="button"
|
||||
class="button is-outlined"
|
||||
@click.prevent="cancelEdition()"
|
||||
slot="trigger">
|
||||
{{ $i18n.get('cancel') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-success"
|
||||
type="submit">
|
||||
{{ isModal ? $i18n.get('label_create_and_select') : $i18n.get('save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -225,7 +235,8 @@
|
|||
mixins: [ formHooks ],
|
||||
props: {
|
||||
editForm: Object,
|
||||
taxonomyId: ''
|
||||
taxonomyId: '',
|
||||
isModal: false
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -306,14 +317,17 @@
|
|||
this.editForm = {};
|
||||
this.formErrors = {};
|
||||
this.isLoading = false;
|
||||
if (this.isModal)
|
||||
this.$parent.close();
|
||||
})
|
||||
.catch((errors) => {
|
||||
this.isLoading = false;
|
||||
|
||||
for (let error of errors.errors) {
|
||||
for (let metadatum of Object.keys(error)) {
|
||||
this.$set(this.formErrors, metadatum, (this.formErrors[metadatum] !== undefined ? this.formErrors[metadatum] : '') + error[metadatum] + '\n');
|
||||
}
|
||||
}
|
||||
this.isLoading = false;
|
||||
this.$emit('onErrorFound');
|
||||
});
|
||||
|
||||
|
@ -336,6 +350,8 @@
|
|||
.then((term) => {
|
||||
this.formErrors = {};
|
||||
this.$emit('onEditionFinished', { term: term, hasChangedParent: this.hasChangedParent });
|
||||
if (this.isModal)
|
||||
this.$parent.close();
|
||||
})
|
||||
.catch((errors) => {
|
||||
for (let error of errors.errors) {
|
||||
|
@ -350,6 +366,8 @@
|
|||
},
|
||||
cancelEdition() {
|
||||
this.$emit('onEditionCanceled', this.editForm);
|
||||
if (this.isModal)
|
||||
this.$parent.close();
|
||||
},
|
||||
deleteHeaderImage() {
|
||||
this.editForm = Object.assign({},
|
||||
|
@ -477,12 +495,31 @@
|
|||
}
|
||||
|
||||
form#termEditForm {
|
||||
padding: 1.7em 0 1.5em 1.5em;
|
||||
border-left: 1px solid var(--tainacan-gray2);
|
||||
margin-left: 0.75em;
|
||||
position: relative;
|
||||
animation-name: enter;
|
||||
animation-duration: 0.5s;
|
||||
|
||||
&:not(.tainacan-modal-content) {
|
||||
padding: 1.7em 0 1.5em 1.5em;
|
||||
border-left: 1px solid var(--tainacan-gray2);
|
||||
margin-left: 0.75em;
|
||||
position: relative;
|
||||
animation-name: enter;
|
||||
animation-duration: 0.5s;
|
||||
}
|
||||
&.tainacan-modal-content {
|
||||
overflow: hidden;
|
||||
|
||||
.tainacan-modal-title {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.thumbnail-field {
|
||||
max-width: 120px;
|
||||
}
|
||||
.image-placeholder {
|
||||
left: 2px;
|
||||
}
|
||||
.form-submit {
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.tainacan-page-title {
|
||||
margin-bottom: 30px;
|
||||
|
@ -538,6 +575,7 @@
|
|||
z-index: 99;
|
||||
text-align: center;
|
||||
color: var(--tainacan-info-color);
|
||||
background-color: transparent;
|
||||
}
|
||||
#button-delete-header,
|
||||
#button-edit-header {
|
||||
|
|
|
@ -1,51 +1,68 @@
|
|||
<template>
|
||||
<div
|
||||
:style="{ 'height': isLoadingOptions ? (Number(filter.max_options)*28) + 'px' : 'auto' }"
|
||||
:class="{ 'skeleton': isLoadingOptions }"
|
||||
:style="{ 'height': isLoadingOptions && !filtersAsModal ? (Number(filter.max_options)*28) + 'px' : 'auto' }"
|
||||
:class="{ 'skeleton': isLoadingOptions && !filtersAsModal }"
|
||||
class="block">
|
||||
<div
|
||||
v-for="(option, index) in options.slice(0, filter.max_options)"
|
||||
v-if="!isLoadingOptions"
|
||||
:key="index"
|
||||
class="metadatum">
|
||||
<label
|
||||
v-if="index <= filter.max_options - 1"
|
||||
class="b-checkbox checkbox is-small">
|
||||
<input
|
||||
v-model="selected"
|
||||
:value="option.value"
|
||||
@input="resetPage()"
|
||||
type="checkbox">
|
||||
<span class="check" />
|
||||
<span class="control-label">
|
||||
<span class="checkbox-label-text">{{ option.label }}</span>
|
||||
<span
|
||||
v-if="option.total_items != undefined"
|
||||
class="has-text-gray"> {{ "(" + option.total_items + ")" }}</span>
|
||||
</span>
|
||||
</label>
|
||||
<button
|
||||
class="view-all-button link-style"
|
||||
v-if="option.showViewAllButton && index == options.slice(0, filter.max_options).length - 1"
|
||||
@click="openCheckboxModal(option.parent)">
|
||||
{{ $i18n.get('label_view_all') }}
|
||||
</button>
|
||||
</div>
|
||||
<p
|
||||
v-if="isLoadingOptions == false && options.length != undefined && options.length <= 0"
|
||||
class="no-options-placeholder">
|
||||
{{ $i18n.get('info_no_options_avialable_filtering') }}
|
||||
</p>
|
||||
<template v-if="!filtersAsModal">
|
||||
<div
|
||||
v-for="(option, index) in options.slice(0, filter.max_options)"
|
||||
v-if="!isLoadingOptions"
|
||||
:key="index"
|
||||
class="metadatum">
|
||||
<label
|
||||
v-if="index <= filter.max_options - 1"
|
||||
class="b-checkbox checkbox is-small">
|
||||
<input
|
||||
v-model="selected"
|
||||
:value="option.value"
|
||||
@input="resetPage()"
|
||||
type="checkbox">
|
||||
<span class="check" />
|
||||
<span class="control-label">
|
||||
<span class="checkbox-label-text">{{ option.label }}</span>
|
||||
<span
|
||||
v-if="option.total_items != undefined"
|
||||
class="has-text-gray"> {{ "(" + option.total_items + ")" }}</span>
|
||||
</span>
|
||||
</label>
|
||||
<button
|
||||
class="view-all-button link-style"
|
||||
v-if="option.showViewAllButton && index == options.slice(0, filter.max_options).length - 1"
|
||||
@click="openCheckboxModal(option.parent)">
|
||||
{{ $i18n.get('label_view_all') }}
|
||||
</button>
|
||||
</div>
|
||||
<p
|
||||
v-if="isLoadingOptions == false && options.length != undefined && options.length <= 0"
|
||||
class="no-options-placeholder">
|
||||
{{ $i18n.get('info_no_options_avialable_filtering') }}
|
||||
</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<checkbox-radio-filter-input
|
||||
:is-modal="false"
|
||||
:filter="filter"
|
||||
:selected="selected"
|
||||
:metadatum-id="metadatumId"
|
||||
:collection-id="collectionId"
|
||||
:metadatum_type="metadatumType"
|
||||
:is-repository-level="isRepositoryLevel"
|
||||
:query="query" />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isCancel } from '../../../js/axios';
|
||||
import { filterTypeMixin, dynamicFilterTypeMixin } from '../../../js/filter-types-mixin';
|
||||
import CheckboxRadioModal from '../../../components/modals/checkbox-radio-modal.vue';
|
||||
import CheckboxRadioFilterInput from '../../../components/other/checkbox-radio-filter-input.vue';
|
||||
|
||||
export default {
|
||||
components: { CheckboxRadioFilterInput },
|
||||
mixins: [filterTypeMixin, dynamicFilterTypeMixin],
|
||||
props: {
|
||||
filtersAsModal: Boolean
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
options: [],
|
||||
|
@ -74,7 +91,7 @@
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.isUsingElasticSearch)
|
||||
if (!this.isUsingElasticSearch && !this.filtersAsModal)
|
||||
this.loadOptions();
|
||||
},
|
||||
methods: {
|
||||
|
@ -85,14 +102,15 @@
|
|||
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' );
|
||||
|
||||
promise.request
|
||||
.then(() => {
|
||||
.then((res) => {
|
||||
this.updateSelectedValues();
|
||||
this.$emit('updateParentCollapse', res.data.values.length > 0 );
|
||||
})
|
||||
.catch( (error) => {
|
||||
if (isCancel(error)) {
|
||||
|
@ -115,6 +133,7 @@
|
|||
});
|
||||
},
|
||||
updateSelectedValues() {
|
||||
|
||||
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
|
||||
return false;
|
||||
|
||||
|
@ -126,7 +145,7 @@
|
|||
} else {
|
||||
this.selected = [];
|
||||
}
|
||||
|
||||
|
||||
let onlyLabels = [];
|
||||
if (!isNaN(this.selected[0])){
|
||||
for (let aSelected of this.selected) {
|
||||
|
@ -143,7 +162,7 @@
|
|||
openCheckboxModal() {
|
||||
this.$buefy.modal.open({
|
||||
parent: this,
|
||||
component: CheckboxRadioModal,
|
||||
component: CheckboxRadioFilterInput,
|
||||
props: {
|
||||
//parent: parent,
|
||||
filter: this.filter,
|
||||
|
@ -164,9 +183,6 @@
|
|||
trapFocus: true
|
||||
});
|
||||
},
|
||||
updatesIsLoading(isLoadingOptions) {
|
||||
this.isLoadingOptions = isLoadingOptions;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -159,9 +159,11 @@
|
|||
.numeric-filter-container {
|
||||
display: flex;
|
||||
height: auto;
|
||||
align-items: stretch;
|
||||
|
||||
@media screen and (min-width: 769px) and (max-width: 1500px) {
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,10 @@
|
|||
let promise = null;
|
||||
promise = this.getValuesPlainText( this.metadatumId, null, this.isRepositoryLevel );
|
||||
promise.request
|
||||
.then(() => {
|
||||
.then((res) => {
|
||||
this.updateSelectedValues();
|
||||
|
||||
this.$emit('updateParentCollapse', res.data.values.length > 0 );
|
||||
})
|
||||
.catch( error => {
|
||||
if (isCancel(error))
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<b-field
|
||||
class="filter-item-forms">
|
||||
class="filter-item-forms"
|
||||
:style="{ columnSpan: filtersAsModal && filter.filter_type_object && filter.filter_type_object.component && (filter.filter_type_object.component == 'tainacan-filter-taxonomy-checkbox' || filter.filter_type_object.component == 'tainacan-filter-checkbox') ? 'all' : 'unset'}">
|
||||
<b-collapse
|
||||
class="show"
|
||||
:open.sync="open"
|
||||
|
@ -41,7 +42,9 @@
|
|||
:is-loading-items.sync="isLoadingItems"
|
||||
:current-collection-id="$eventBusSearch.collectionId"
|
||||
@input="onInput"
|
||||
@sendValuesToTags="onSendValuesToTags" />
|
||||
@sendValuesToTags="onSendValuesToTags"
|
||||
@updateParentCollapse="onFilterUpdateParentCollapse"
|
||||
:filters-as-modal="filtersAsModal"/>
|
||||
</div>
|
||||
</b-collapse>
|
||||
</b-field>
|
||||
|
@ -56,6 +59,7 @@
|
|||
isRepositoryLevel: Boolean,
|
||||
open: true,
|
||||
isLoadingItems: true,
|
||||
filtersAsModal: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -74,6 +78,11 @@
|
|||
taxonomy: $event.taxonomy,
|
||||
metadatumId: this.filter.metadatum_id
|
||||
});
|
||||
},
|
||||
onFilterUpdateParentCollapse(open) {
|
||||
const componentsThatShouldCollapseIfEmpty = ['tainacan-filter-taxonomy-checkbox', 'tainacan-filter-selectbox', 'tainacan-filter-checkbox'];
|
||||
if (componentsThatShouldCollapseIfEmpty.includes(this.filter.filter_type_object.component))
|
||||
this.open = open;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,10 +93,15 @@
|
|||
.filter-item-forms {
|
||||
break-inside: avoid;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0.75em;
|
||||
}
|
||||
|
||||
.collapse-trigger {
|
||||
margin-left: -5px;
|
||||
margin-left: -7px;
|
||||
.icon {
|
||||
margin-right: 12px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.collapse-label {
|
||||
display: inline-block;
|
||||
|
@ -118,6 +132,7 @@
|
|||
cursor: pointer;
|
||||
outline: none;
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,6 +212,7 @@
|
|||
@media screen and (min-width: 768px) {
|
||||
.dropdown-trigger input {
|
||||
font-size: 0.75em !important;
|
||||
line-height: 1.75em;
|
||||
}
|
||||
.datepicker-header {
|
||||
|
||||
|
|
|
@ -1,48 +1,62 @@
|
|||
<template>
|
||||
<div
|
||||
:style="{ 'height': isLoadingOptions ? (Number(filter.max_options)*28) + 'px' : 'auto' }"
|
||||
:class="{ 'skeleton': isLoadingOptions }"
|
||||
:style="{ 'height': isLoadingOptions && !filtersAsModal ? (Number(filter.max_options)*28) + 'px' : 'auto' }"
|
||||
:class="{ 'skeleton': isLoadingOptions && !filtersAsModal }"
|
||||
class="block">
|
||||
<!-- <span
|
||||
v-if="isLoadingOptions"
|
||||
style="width: 100%"
|
||||
class="icon has-text-centered loading-icon">
|
||||
<div class="control has-icons-right is-loading is-clearfix" />
|
||||
</span> -->
|
||||
<div
|
||||
v-for="(option, index) in options.slice(0, filter.max_options)"
|
||||
v-if="!isLoadingOptions"
|
||||
:key="index"
|
||||
:value="index"
|
||||
class="metadatum">
|
||||
<label
|
||||
v-if="!option.isChild"
|
||||
class="b-checkbox checkbox is-small">
|
||||
<input
|
||||
v-model="selected"
|
||||
@input="resetPage"
|
||||
:value="option.value"
|
||||
type="checkbox">
|
||||
<span class="check" />
|
||||
<span class="control-label">
|
||||
<span class="checkbox-label-text">{{ option.label }}</span>
|
||||
<span
|
||||
v-if="option.total_items != undefined"
|
||||
class="has-text-gray"> {{ "(" + option.total_items + ")" }}</span>
|
||||
</span>
|
||||
</label>
|
||||
<button
|
||||
class="view-all-button link-style"
|
||||
v-if="option.showViewAllButton"
|
||||
@click="openCheckboxModal(option.parent)">
|
||||
{{ $i18n.get('label_view_all') }}
|
||||
</button>
|
||||
</div>
|
||||
<p
|
||||
v-if="!isLoadingOptions && options.length != undefined && options.length <= 0"
|
||||
class="no-options-placeholder">
|
||||
{{ $i18n.get('info_no_options_avialable_filtering') }}
|
||||
</p>
|
||||
<template v-if="!filtersAsModal">
|
||||
<!-- <span
|
||||
v-if="isLoadingOptions"
|
||||
style="width: 100%"
|
||||
class="icon has-text-centered loading-icon">
|
||||
<div class="control has-icons-right is-loading is-clearfix" />
|
||||
</span> -->
|
||||
<div
|
||||
v-for="(option, index) in options.slice(0, filter.max_options)"
|
||||
v-if="!isLoadingOptions"
|
||||
:key="index"
|
||||
:value="index"
|
||||
class="metadatum">
|
||||
<label
|
||||
v-if="!option.isChild"
|
||||
class="b-checkbox checkbox is-small">
|
||||
<input
|
||||
v-model="selected"
|
||||
@input="resetPage"
|
||||
:value="option.value"
|
||||
type="checkbox">
|
||||
<span class="check" />
|
||||
<span class="control-label">
|
||||
<span class="checkbox-label-text">{{ option.label }}</span>
|
||||
<span
|
||||
v-if="option.total_items != undefined"
|
||||
class="has-text-gray"> {{ "(" + option.total_items + ")" }}</span>
|
||||
</span>
|
||||
</label>
|
||||
<button
|
||||
class="view-all-button link-style"
|
||||
v-if="option.showViewAllButton"
|
||||
@click="openCheckboxModal(option.parent)">
|
||||
{{ $i18n.get('label_view_all') }}
|
||||
</button>
|
||||
</div>
|
||||
<p
|
||||
v-if="!isLoadingOptions && options.length != undefined && options.length <= 0"
|
||||
class="no-options-placeholder">
|
||||
{{ $i18n.get('info_no_options_avialable_filtering') }}
|
||||
</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<checkbox-radio-filter-input
|
||||
:is-modal="false"
|
||||
:filter="filter"
|
||||
:taxonomy_id="taxonomyId"
|
||||
:selected="selected"
|
||||
:metadatum-id="metadatumId"
|
||||
:taxonomy="taxonomy"
|
||||
:collection-id="collectionId"
|
||||
:is-taxonomy="true"
|
||||
:query="query" />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -50,14 +64,16 @@
|
|||
import qs from 'qs';
|
||||
import { tainacan as axios, CancelToken, isCancel } from '../../../js/axios';
|
||||
import { mapGetters } from 'vuex';
|
||||
import CheckboxRadioModal from '../../../components/modals/checkbox-radio-modal.vue';
|
||||
import CheckboxRadioFilterInput from '../../../components/other/checkbox-radio-filter-input.vue';
|
||||
import { filterTypeMixin } from '../../../js/filter-types-mixin';
|
||||
|
||||
export default {
|
||||
mixins: [ filterTypeMixin ],
|
||||
components: { CheckboxRadioFilterInput },
|
||||
mixins: [ filterTypeMixin ],
|
||||
props: {
|
||||
isRepositoryLevel: Boolean,
|
||||
currentCollectionId: String
|
||||
currentCollectionId: String,
|
||||
filtersAsModal: Boolean
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
@ -88,9 +104,10 @@
|
|||
this.loadOptions();
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
isLoadingItems: {
|
||||
handler() {
|
||||
if (!this.filtersAsModal)
|
||||
this.isLoadingOptions = this.isLoadingItems;
|
||||
},
|
||||
immediate: true
|
||||
|
@ -110,7 +127,8 @@
|
|||
}
|
||||
},
|
||||
mounted(){
|
||||
this.loadOptions();
|
||||
if (!this.filtersAsModal)
|
||||
this.loadOptions();
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
|
@ -139,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.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 = [];
|
||||
|
@ -164,6 +182,8 @@
|
|||
.then((res) => {
|
||||
this.prepareOptionsForTaxonomy(res.data.values ? res.data.values : res.data);
|
||||
this.isLoadingOptions = false;
|
||||
|
||||
this.$emit('updateParentCollapse', res.data.values.length > 0 );
|
||||
})
|
||||
.catch( error => {
|
||||
if (isCancel(error)) {
|
||||
|
@ -180,10 +200,13 @@
|
|||
} else {
|
||||
for (const facet in this.facetsFromItemSearch) {
|
||||
if (facet == this.filter.id) {
|
||||
if (Array.isArray(this.facetsFromItemSearch[facet]))
|
||||
if (Array.isArray(this.facetsFromItemSearch[facet])) {
|
||||
this.prepareOptionsForTaxonomy(this.facetsFromItemSearch[facet]);
|
||||
else
|
||||
this.$emit('updateParentCollapse', this.facetsFromItemSearch[facet].length > 0 );
|
||||
} else {
|
||||
this.prepareOptionsForTaxonomy(Object.values(this.facetsFromItemSearch[facet]));
|
||||
this.$emit('updateParentCollapse', Object.values(this.facetsFromItemSearch[facet]).length > 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +296,7 @@
|
|||
openCheckboxModal(parent) {
|
||||
this.$buefy.modal.open({
|
||||
parent: this,
|
||||
component: CheckboxRadioModal,
|
||||
component: CheckboxRadioFilterInput,
|
||||
props: {
|
||||
parent: parent,
|
||||
filter: this.filter,
|
||||
|
@ -320,9 +343,6 @@
|
|||
}
|
||||
}
|
||||
this.updateSelectedValues();
|
||||
},
|
||||
updatesIsLoading(isLoadingOptions) {
|
||||
this.isLoadingOptions = isLoadingOptions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -16,14 +16,13 @@
|
|||
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
v-if="allItemsOnPageSelected && items.length > 1">
|
||||
v-if="totalPages > 1 && allItemsOnPageSelected && items.length > 1">
|
||||
<b-checkbox
|
||||
v-model="isAllItemsSelected">
|
||||
{{ $i18n.getWithVariables('label_select_all_%s_items', [totalItems]) }}
|
||||
</b-checkbox>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<b-dropdown
|
||||
:mobile-modal="true"
|
||||
|
@ -36,7 +35,7 @@
|
|||
<button
|
||||
class="button is-white"
|
||||
slot="trigger">
|
||||
<span>{{ $i18n.get('label_bulk_actions') }}</span>
|
||||
<span>{{ $i18n.get('label_actions_for_the_selection') }}</span>
|
||||
<span class="icon">
|
||||
<i class="tainacan-icon tainacan-icon-1-25em tainacan-icon-arrowdown"/>
|
||||
</span>
|
||||
|
@ -63,10 +62,16 @@
|
|||
</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>
|
||||
<b-dropdown-item
|
||||
:disabled="isAllItemsSelected"
|
||||
@click="$parent.openExposersModal(selectedItems)"
|
||||
aria-role="listitem">
|
||||
{{ $i18n.get('label_view_selected_items_as') }}
|
||||
</b-dropdown-item>
|
||||
</b-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -173,7 +178,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>
|
||||
|
||||
|
@ -286,7 +291,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>
|
||||
|
||||
|
@ -450,10 +455,11 @@
|
|||
@click.left="onClickItem($event, item)"
|
||||
@click.right="onRightClickItem($event, item)">
|
||||
<div
|
||||
v-if="collection && collection.hide_items_thumbnail_on_lists != 'yes'"
|
||||
: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>
|
||||
|
@ -466,13 +472,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="{
|
||||
|
@ -559,7 +565,7 @@
|
|||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-for="(column, columnIndex) in tableMetadata"
|
||||
v-for="(column, columnIndex) in displayedMetadata"
|
||||
:key="columnIndex"
|
||||
v-if="collectionId != undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
|
||||
@click.left="onClickItem($event, item)"
|
||||
|
@ -576,7 +582,7 @@
|
|||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
v-for="(column, columnIndex) in tableMetadata"
|
||||
v-for="(column, columnIndex) in displayedMetadata"
|
||||
:key="columnIndex"
|
||||
v-if="collectionId == undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
|
||||
@click.left="onClickItem($event, item)"
|
||||
|
@ -644,12 +650,12 @@
|
|||
<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>
|
||||
<span
|
||||
v-for="(column, metadatumIndex) in tableMetadata"
|
||||
v-for="(column, metadatumIndex) in displayedMetadata"
|
||||
:key="metadatumIndex"
|
||||
:class="{ 'metadata-type-textarea': column.metadata_type_object != undefined && column.metadata_type_object.component == 'tainacan-textarea' }"
|
||||
v-if="collectionId == undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'description')">
|
||||
|
@ -659,7 +665,7 @@
|
|||
class="metadata-value"/>
|
||||
</span>
|
||||
<span
|
||||
v-for="(column, metadatumIndex) in tableMetadata"
|
||||
v-for="(column, metadatumIndex) in displayedMetadata"
|
||||
:key="metadatumIndex"
|
||||
:class="{ 'metadata-type-textarea': column.metadata_type_object != undefined && column.metadata_type_object.component == 'tainacan-textarea' }"
|
||||
v-if="renderMetadata(item.metadata, column) != '' && column.display && column.slug != 'thumbnail' && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop != 'title')">
|
||||
|
@ -669,7 +675,7 @@
|
|||
class="metadata-value"/>
|
||||
</span>
|
||||
<span
|
||||
v-for="(column, metadatumIndex) in tableMetadata"
|
||||
v-for="(column, metadatumIndex) in displayedMetadata"
|
||||
:key="metadatumIndex"
|
||||
v-if="(column.metadatum == 'row_creation' || column.metadatum == 'row_author') && item[column.slug] != undefined">
|
||||
<h3 class="metadata-label">{{ column.name }}</h3>
|
||||
|
@ -697,7 +703,7 @@
|
|||
</th>
|
||||
<!-- Displayed Metadata -->
|
||||
<th
|
||||
v-for="(column, index) in tableMetadata"
|
||||
v-for="(column, index) in displayedMetadata"
|
||||
:key="index"
|
||||
v-if="column.display"
|
||||
class="column-default-width"
|
||||
|
@ -744,7 +750,7 @@
|
|||
<!-- Item Displayed Metadata -->
|
||||
<td
|
||||
:key="columnIndex"
|
||||
v-for="(column, columnIndex) in tableMetadata"
|
||||
v-for="(column, columnIndex) in displayedMetadata"
|
||||
v-if="column.display"
|
||||
class="column-default-width"
|
||||
:class="{ 'metadata-type-textarea': column.metadata_type_object != undefined && column.metadata_type_object.component == 'tainacan-textarea',
|
||||
|
@ -770,7 +776,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'
|
||||
|
@ -778,14 +784,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'
|
||||
|
@ -793,7 +799,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: {
|
||||
|
@ -801,7 +807,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'
|
||||
|
@ -813,11 +819,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>
|
||||
|
@ -909,6 +915,138 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- LIST VIEW MODE -->
|
||||
<div
|
||||
role="list"
|
||||
v-if="viewMode == 'list'"
|
||||
class="tainacan-list-container">
|
||||
<div
|
||||
role="listitem"
|
||||
:href="item.url"
|
||||
:key="index"
|
||||
v-for="(item, index) of items"
|
||||
class="tainacan-list"
|
||||
:class="{ 'selected-list-item': getSelectedItemChecked(item.id) == true }">
|
||||
|
||||
<div
|
||||
v-if="collectionId && !$route.query.readmode && ($route.query.iframemode || collection && collection.current_user_can_bulk_edit)"
|
||||
:class="{ 'is-selecting': isSelectingItems }"
|
||||
class="list-checkbox">
|
||||
<label
|
||||
tabindex="0"
|
||||
class="b-checkbox checkbox is-small">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="getSelectedItemChecked(item.id)"
|
||||
@input="setSelectedItemChecked(item.id)">
|
||||
<span class="check" />
|
||||
<span class="control-label" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Title -->
|
||||
<div class="metadata-title">
|
||||
<p
|
||||
v-tooltip="{
|
||||
delay: {
|
||||
show: 500,
|
||||
hide: 300,
|
||||
},
|
||||
content: item.metadata != undefined ? renderMetadata(item.metadata, column) : '',
|
||||
html: true,
|
||||
autoHide: false,
|
||||
placement: 'auto-start'
|
||||
}"
|
||||
@click.left="onClickItem($event, item)"
|
||||
@click.right="onRightClickItem($event, item)"
|
||||
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_provided') + `</span>`)" />
|
||||
</div>
|
||||
|
||||
<!-- Actions -->
|
||||
<div
|
||||
v-if="item.current_user_can_edit && !$route.query.iframemode"
|
||||
class="actions-area"
|
||||
:label="$i18n.get('label_actions')">
|
||||
<a
|
||||
v-if="!isOnTrash"
|
||||
id="button-edit"
|
||||
:aria-label="$i18n.getFrom('items','edit_item')"
|
||||
@click.prevent.stop="goToItemEditPage(item)">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('edit'),
|
||||
autoHide: true,
|
||||
placement: 'auto'
|
||||
}"
|
||||
class="icon">
|
||||
<i class="has-text-secondary tainacan-icon tainacan-icon-1-25em tainacan-icon-edit"/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
:aria-lavel="$i18n.get('label_button_untrash')"
|
||||
@click.prevent.stop="untrashOneItem(item.id)"
|
||||
v-if="isOnTrash">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: $i18n.get('label_recover_from_trash'),
|
||||
autoHide: true,
|
||||
placement: 'auto'
|
||||
}"
|
||||
class="icon">
|
||||
<i class="has-text-secondary tainacan-icon tainacan-icon-1-25em tainacan-icon-undo"/>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
v-if="item.current_user_can_delete"
|
||||
id="button-delete"
|
||||
:aria-label="$i18n.get('label_button_delete')"
|
||||
@click.prevent.stop="deleteOneItem(item.id)">
|
||||
<span
|
||||
v-tooltip="{
|
||||
content: isOnTrash ? $i18n.get('label_delete_permanently') : $i18n.get('delete'),
|
||||
autoHide: true,
|
||||
placement: 'auto'
|
||||
}"
|
||||
class="icon">
|
||||
<i
|
||||
:class="{ 'tainacan-icon-delete': !isOnTrash, 'tainacan-icon-deleteforever': isOnTrash }"
|
||||
class="has-text-secondary tainacan-icon tainacan-icon-1-25em"/>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Remaining metadata -->
|
||||
<div
|
||||
@click.left="onClickItem($event, item)"
|
||||
@click.right="onRightClickItem($event, item)"
|
||||
class="media">
|
||||
<div
|
||||
class="tainacan-list-thumbnail"
|
||||
v-if="item.thumbnail != undefined">
|
||||
<img
|
||||
: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">
|
||||
<span
|
||||
v-for="(column, metadatumIndex) in displayedMetadata"
|
||||
:key="metadatumIndex"
|
||||
:class="{ 'metadata-type-textarea': column.metadata_type_object.component == 'tainacan-textarea' }"
|
||||
v-if="renderMetadata(item.metadata, column) != '' && column.display && column.slug != 'thumbnail' && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop != 'title')">
|
||||
<h3 class="metadata-label">{{ column.name }}</h3>
|
||||
<p
|
||||
v-html="renderMetadata(item.metadata, column)"
|
||||
class="metadata-value"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -925,7 +1063,7 @@ export default {
|
|||
mixins: [ dateInter ],
|
||||
props: {
|
||||
collectionId: undefined,
|
||||
tableMetadata: Array,
|
||||
displayedMetadata: Array,
|
||||
items: Array,
|
||||
isLoading: false,
|
||||
isOnTrash: false,
|
||||
|
@ -939,7 +1077,7 @@ export default {
|
|||
thumbPlaceholderPath: tainacan_plugin.base_url + '/assets/images/placeholder_square.png',
|
||||
cursorPosX: -1,
|
||||
cursorPosY: -1,
|
||||
contextMenuItem: null
|
||||
contextMenuItem: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -949,15 +1087,15 @@ export default {
|
|||
highlightedItem () {
|
||||
return this.getHighlightedItem();
|
||||
},
|
||||
selectedItemsFromStore() {
|
||||
return this.getSelectedItems();
|
||||
},
|
||||
selectedItems () {
|
||||
if (this.$route.query.iframemode)
|
||||
this.$eventBusSearch.setSelectedItemsForIframe(this.getSelectedItems());
|
||||
|
||||
return this.getSelectedItems();
|
||||
},
|
||||
firstSelectedIndex() {
|
||||
return (this.selectedItems && this.selectedItems.length) ? this.items.findIndex((anItem) => this.selectedItems[0] == anItem.id) : null;
|
||||
},
|
||||
isSelectingItems () {
|
||||
return this.selectedItems.length > 0;
|
||||
},
|
||||
|
@ -967,7 +1105,13 @@ export default {
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
itemsPerPage(){
|
||||
return this.getItemsPerPage();
|
||||
},
|
||||
totalPages(){
|
||||
return Math.ceil(Number(this.totalItems)/Number(this.itemsPerPage));
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isAllItemsSelected(value) {
|
||||
|
@ -1009,9 +1153,6 @@ export default {
|
|||
...mapGetters('bulkedition', [
|
||||
'getGroupId'
|
||||
]),
|
||||
...mapActions('item', [
|
||||
'fetchItem'
|
||||
]),
|
||||
...mapActions('search', [
|
||||
'setSeletecItems',
|
||||
'cleanSelectedItems',
|
||||
|
@ -1022,13 +1163,15 @@ export default {
|
|||
'getOrder',
|
||||
'getOrderBy',
|
||||
'getSelectedItems',
|
||||
'getHighlightedItem'
|
||||
'getHighlightedItem',
|
||||
'getItemsPerPage'
|
||||
]),
|
||||
setSelectedItemChecked(itemId) {
|
||||
if (this.selectedItems.find((item) => item == itemId) != undefined)
|
||||
this.removeSelectedItem(itemId);
|
||||
else
|
||||
else {
|
||||
this.addSelectedItem(itemId);
|
||||
}
|
||||
},
|
||||
getSelectedItemChecked(itemId) {
|
||||
return this.selectedItems.find(item => item == itemId) != undefined;
|
||||
|
@ -1165,6 +1308,7 @@ export default {
|
|||
groupId: groupId
|
||||
}).then(() => {
|
||||
this.$eventBusSearch.loadItems();
|
||||
this.$root.$emit('openProcessesPopup');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -1196,6 +1340,7 @@ export default {
|
|||
groupId: groupId
|
||||
}).then(() => {
|
||||
this.$eventBusSearch.loadItems();
|
||||
this.$root.$emit('openProcessesPopup');
|
||||
});
|
||||
} else {
|
||||
this.trashItemsInBulk({
|
||||
|
@ -1203,6 +1348,7 @@ export default {
|
|||
groupId: groupId
|
||||
}).then(() => {
|
||||
this.$eventBusSearch.loadItems();
|
||||
this.$root.$emit('openProcessesPopup');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -1231,8 +1377,26 @@ export default {
|
|||
this.clearContextMenu();
|
||||
},
|
||||
onClickItem($event, item) {
|
||||
if ($event.ctrlKey || $event.shiftKey) {
|
||||
if ($event.ctrlKey) {
|
||||
this.setSelectedItemChecked(item.id);
|
||||
} else if ($event.shiftKey) {
|
||||
|
||||
if (this.firstSelectedIndex != null) {
|
||||
const lastFirstSelectedIndex = this.firstSelectedIndex;
|
||||
const lastSelectedIndex = this.items.findIndex((anItem) => anItem.id == item.id);
|
||||
|
||||
this.cleanSelectedItems();
|
||||
if (lastFirstSelectedIndex > lastSelectedIndex) {
|
||||
for (let i = lastFirstSelectedIndex; i >= lastSelectedIndex; i--)
|
||||
this.setSelectedItemChecked(this.items[i].id);
|
||||
} else {
|
||||
for (let i = lastFirstSelectedIndex; i <= lastSelectedIndex; i++)
|
||||
this.setSelectedItemChecked(this.items[i].id);
|
||||
}
|
||||
} else {
|
||||
this.setSelectedItemChecked(item.id);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (this.$route.query.iframemode && !this.$route.query.readmode) {
|
||||
this.setSelectedItemChecked(item.id)
|
||||
|
@ -1292,9 +1456,10 @@ export default {
|
|||
@import "../../scss/_view-mode-masonry.scss";
|
||||
@import "../../scss/_view-mode-grid.scss";
|
||||
@import "../../scss/_view-mode-records.scss";
|
||||
@import "../../scss/_view-mode-list.scss";
|
||||
|
||||
.selection-control {
|
||||
|
||||
margin-bottom: 6px;
|
||||
padding: 6px 0px 0px 12px;
|
||||
background: var(--tainacan-white);
|
||||
height: 40px;
|
||||
|
|