Merge branch 'release/0.10'

This commit is contained in:
Leo Germani 2019-07-08 23:18:37 -03:00
commit b6732a9218
147 changed files with 8553 additions and 3176 deletions

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ last-package-build.md5
src/admin/scss/.sass-cache
src/assets/css/tainacan-admin.css
src/assets/css/tainacan-admin.css.map
src/assets/report.html
cypress/videos
cypress/screenshots
.vscode

View File

@ -13,12 +13,12 @@ current_OS=`uname`
# For macOS (Darwin)
if [ $current_OS == "Darwin" ]; then
find src ./webpack.config.js -type f \( -name "*.js" -or -name "*.vue" -or -name "webpack.config.js" \) -exec md5 {} \; | sort -k 2 | md5 > last-js-build.md5
find ./src/scss/ ./src/admin/scss/ ./src/gutenberg-blocks/ ./src/gutenberg-blocks/tainacan-collections/collections-list ./src/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/gutenberg-blocks/tainacan-items/items-list ./src/gutenberg-blocks/tainacan-terms/terms-list -type f \( -name "*.scss" \) -exec md5 {} \; | sort -k 2 | md5 > last-sass-build.md5
find ./src/scss/ ./src/admin/scss/ ./src/gutenberg-blocks/ ./src/gutenberg-blocks/tainacan-collections/collections-list ./src/gutenberg-blocks/tainacan-facets/facets-list ./src/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/gutenberg-blocks/tainacan-items/items-list ./src/gutenberg-blocks/tainacan-terms/terms-list -type f \( -name "*.scss" \) -exec md5 {} \; | sort -k 2 | md5 > last-sass-build.md5
find ./composer.json -type f \( -name "composer.json" \) -exec md5 {} \; | sort -k 2 | md5 > last-composer-build.md5
find ./package.json -type f \( -name "package.json" -or -name "package-lock.json" \) -exec md5 {} \; | sort -k 2 | md5 > last-package-build.md5
else
find src ./webpack.config.js -type f \( -name "*.js" -or -name "*.vue" -or -name "webpack.config.js" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-js-build.md5
find ./src/scss/ ./src/admin/scss/ ./src/gutenberg-blocks ./src/gutenberg-blocks/tainacan-collections/collections-list ./src/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/gutenberg-blocks/tainacan-items/items-list ./src/gutenberg-blocks/tainacan-terms/terms-list -type f \( -name "*.scss" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-sass-build.md5
find ./src/scss/ ./src/admin/scss/ ./src/gutenberg-blocks ./src/gutenberg-blocks/tainacan-collections/collections-list ./src/gutenberg-blocks/tainacan-facets/facets-list ./src/gutenberg-blocks/tainacan-items/dynamic-items-list ./src/gutenberg-blocks/tainacan-items/items-list ./src/gutenberg-blocks/tainacan-terms/terms-list -type f \( -name "*.scss" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-sass-build.md5
find ./composer.json -type f \( -name "composer.json" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-composer-build.md5
find ./package.json -type f \( -name "package.json" -or -name "package-lock.json" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-package-build.md5
fi
@ -27,7 +27,7 @@ new_md5_package=$(<last-package-build.md5)
if [ "$current_md5_package" != "$new_md5_package" ]
then
## Install js dependencies
npm install
npm ci
fi
new_md5_composer=$(<last-composer-build.md5)
@ -68,7 +68,9 @@ rm -rf $wp_plugin_dir
mkdir $wp_plugin_dir
rsync -axz --exclude='vendor/bin/phpc*' --exclude='vendor/squizlabs' --exclude='vendor/wimg' \
--exclude='vendor/respect/validation/.git' --exclude='vendor/symfony/polyfill-mbstring/.git' --exclude='pdf-viewer/pdfjs-dist/web/compressed.tracemonkey-pldi-09.pdf' \
--exclude='vendor/respect/validation/.git' --exclude='vendor/symfony/polyfill-mbstring/.git' \
--exclude='vendor/respect/validation/docs' --exclude='vendor/respect/validation/tests' \
--exclude='pdf-viewer/pdfjs-dist/web/compressed.tracemonkey-pldi-09.pdf' \
src/* $wp_plugin_dir/
rm -rf $wp_plugin_dir/scss

View File

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

View File

@ -23,9 +23,18 @@ The special columns that can be used are:
* **special_item_id** - Inform the item ID in the Tainacan database. This is useful when re-importing items and let the user decide wether to update existing items or ignore them and only add new items.
* **special_document** - let the user inform the item document. See "Importing files and attachments"
* **special_attachments** - let the user inform the attachments. See "Importing files and attachments"
* **special_comment_status** - Inform if the item is open for comments. Possible values are open or closed. Default is closed.
Example:
## Importing files and attachments
```
name, special_item_status, special_comment_status
item uno, draft, closed
item due, private, closed
item tre, publish, open
```
### Importing files and attachments
If you also have files you want to import, that are related to the items in your CSV, you can use some special columns in your csv to do so.
@ -55,6 +64,7 @@ Many images,http://example.com/image.jpg||http://example.com/image2.jpg||http://
Images uploaded via FTP,myfolder/image.jpg||myfolder/image2.jpg
```
## Creating metadata on the fly
When the user maps the columns found in the CSV file to the metadata present in the collection, he/she has can choose the "Create metadatum" option, so the importer will automatically create the metadata as it process the file.

View File

@ -126,8 +126,8 @@ It will give you all the items it received, in the way they were about to be ser
It receives 3 parameters:
* $response: an instance of the `\WP_REST_Response` object
* $response: an instance of the `\WP_REST_Server` object
* $response: an instance of the `\WP_REST_Request` object
* $handler: an instance of the `\WP_REST_Server` object
* $request: an instance of the `\WP_REST_Request` object
This method have to return the modified version of the `\WP_REST_Response` object.
@ -257,4 +257,4 @@ function myNewExposer($exposers) {
}
add_action('init', 'myNewExposer');
```
```

View File

@ -42,12 +42,11 @@ Also increase the `Tested Up` version, if applicable.
Edit `webpack.config.js` to set production mode.
### Build and cleanup
### Build
```
./build.sh
cd $BUILD_PATH
rm -r admin/scss/.sass-cache
```
### Set build to development mode
@ -92,12 +91,11 @@ Commit and push.
Edit `webpack.config.js` to set production mode.
### Build and cleanup
### Build
```
./build.sh
cd $BUILD_PATH
rm -r admin/scss/.sass-cache
```
### Set build to development mode
@ -129,8 +127,10 @@ cp $GIT_PATH/wp-repo-assets/* $SVN_PATH/assets/
Create tag folder
```
mkdir $SVN_PATH/tags/$NEW_VERSION
cp -R $SVN_PATH/trunk/* $SVN_PATH/tags/$NEW_VERSION/
cd $SVN_PATH
mkdir tags/$NEW_VERSION
cp -R trunk/* tags/$NEW_VERSION/
svn add tags/$NEW_VERSION
```
### Finish and commit

View File

@ -25,7 +25,7 @@ You wil also need:
* `Sass` to compile sass into css files
* `WP-Cli` to configure the test environment
* `Phpunit` to run unit tests
* `Node` to handle dependencies and vuild the JS application
* `Node` to handle dependencies and vuild the JS application (at least version 5.7.0)
```
sudo apt-get install phpunit composer ruby ruby-dev nodejs npm

4755
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,9 @@
"build": "cross-env NODE_ENV=development webpack --display-error-details --mode development --progress --hide-modules"
},
"dependencies": {
"axios": "^0.18.0",
"buefy": "^0.7.5",
"bulma": "^0.7.4",
"axios": "^0.19.0",
"buefy": "^0.7.8",
"bulma": "^0.7.5",
"mdi": "^2.2.43",
"moment": "^2.22.2",
"node-sass": "^4.12.0",
@ -34,7 +34,7 @@
"babel-loader": "^8.0.4",
"cross-env": "^5.2.0",
"css-loader": "^1.0.0",
"eslint": "^4.0.0",
"eslint": "^5.16.0",
"eslint-loader": "^2.1.1",
"eslint-plugin-vue": "^4.7.1",
"file-loader": "^2.0.0",
@ -46,6 +46,7 @@
"vue-loader": "^15.4.2",
"vue-template-compiler": "^2.5.17",
"webpack": "^4.22.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.1.2",
"webpack-dev-server": ">=3.1.11"
}

View File

@ -64,6 +64,7 @@
TainacanRepositorySubheader
},
created() {
this.$statusHelper.loadStatuses();
this.$userPrefs.init();
this.isMenuCompressed = (this.$route.params.collectionId != undefined);
this.activeRoute = this.$route.name;

View File

@ -18,7 +18,6 @@ class Admin {
private function __construct() {
add_action( 'wp_ajax_tainacan-date-i18n', array( &$this, 'ajax_date_i18n') );
add_action( 'wp_ajax_tainacan-sample-permalink', array( &$this, 'ajax_sample_permalink') );
add_action( 'admin_menu', array( &$this, 'add_admin_menu' ) );
@ -78,6 +77,7 @@ class Admin {
// wp_enqueue_style( 'style', $TAINACAN_BASE_URL . '/assets/css/fonts/materialdesignicons.css' );
wp_enqueue_style( 'tainacan-fonts', $TAINACAN_BASE_URL . '/assets/css/fonts/tainacanicons.css', [], TAINACAN_VERSION );
wp_enqueue_style( 'roboto-fonts', 'https://fonts.googleapis.com/css?family=Roboto:400,400i,500,500i,700,700i', [], TAINACAN_VERSION );
wp_enqueue_script('underscore');
}
@ -220,6 +220,13 @@ class Admin {
$class = new $metadata_type;
$settings['i18n']['helpers_label'][$class->get_component()] = $class->get_form_labels();
}
$filter_types = $Tainacan_Filters->fetch_filter_types();
foreach ( $filter_types as $index => $filter_type){
$class = new $filter_type;
$settings['i18n']['helpers_label'][$class->get_component()] = $class->get_form_labels();
}
$settings['form_hooks'] = Admin_Hooks::get_instance()->get_registered_hooks();
@ -272,15 +279,6 @@ class Admin {
register_meta( 'user', 'tainacan_prefs', $args );
}
function ajax_date_i18n(){
$unix_time_stamp = strtotime($_POST['date_string']);
echo date_i18n(get_option('date_format'), $unix_time_stamp);
wp_die();
}
function ajax_sample_permalink(){
$id = $_POST['post_id'];

View File

@ -276,14 +276,7 @@
this.metadataIsLoading = false;
});
let locale = navigator.language;
moment.locale(locale);
let localeData = moment.localeData();
this.dateFormat = localeData.longDateFormat('L');
if((this.$route.query.metaquery && Object.keys(this.$route.query.metaquery).length > 0) ||
if ((this.$route.query.metaquery && Object.keys(this.$route.query.metaquery).length > 0) ||
(this.$route.query.taxquery && Object.keys(this.$route.query.taxquery).length > 0) ){
this.searchCriteria = [];
}
@ -362,8 +355,6 @@
},
termList: [],
terms: [],
dateMask: this.getDateLocaleMask(),
dateFormat: '',
metadataIsLoading: false,
metadata: [],
}

View File

@ -124,10 +124,10 @@
:placeholder="$i18n.get('instruction_select_a_status2')"
@input="addToBulkEditionProcedures($event, 'newValue', criterion)">
<option
v-for="(status, key) in statuses"
:key="key"
:value="status">
{{ $i18n.get(status) }}
v-for="(statusOption, index) of $statusHelper.getStatuses().filter(option => { return option.value != 'trash' })"
:key="index"
:value="statusOption.slug">
{{ statusOption.name }}
</option>
</b-select>
</template>

View File

@ -297,15 +297,15 @@
<div class="status-radios">
<b-radio
v-model="form.status"
v-for="statusOption in statusOptions"
:key="statusOption.value"
:native-value="statusOption.value">
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
:native-value="statusOption.slug">
<span class="icon has-text-gray">
<i
class="tainacan-icon tainacan-icon-18px"
:class="'tainacan-icon-' + getStatusIcon(statusOption.value)"/>
:class="$statusHelper.getIcon(statusOption.slug)"/>
</span>
{{ statusOption.label }}
{{ statusOption.name }}
</b-radio>
</div>
</b-field>
@ -555,20 +555,6 @@ export default {
},
thumbnail: {},
cover: {},
// Can be obtained from api later
statusOptions: [{
value: 'publish',
label: this.$i18n.get('public')
}, {
value: 'private',
label: this.$i18n.get('private')
}, {
value: 'draft',
label: this.$i18n.get('draft')
}, {
value: 'trash',
label: this.$i18n.get('trash')
}],
isFetchingPages: false,
coverPages: [],
coverPage: '',
@ -674,10 +660,10 @@ export default {
this.form.status = this.collection.status;
this.form.cover_page_id = this.collection.cover_page_id;
this.form.enable_cover_page = this.collection.enable_cover_page;
this.form.enabled_view_modes = this.collection.enabled_view_modes;
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.isLoading = false;
this.formErrorMessage = '';
this.editFormErrors = {};
@ -876,15 +862,6 @@ export default {
}
}
);
},
getStatusIcon(status) {
switch(status) {
case 'publish': return 'public';
case 'private': return 'private';
case 'draft': return 'draft';
case 'trash': return 'delete';
default: return 'item';
}
}
},
mounted(){
@ -926,10 +903,10 @@ export default {
this.form.cover_page_id = this.collection.cover_page_id;
this.form.parent = this.collection.parent;
this.form.default_view_mode = this.collection.default_view_mode;
this.form.enabled_view_modes = JSON.parse(JSON.stringify(this.collection.enabled_view_modes));
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.moderators = JSON.parse(JSON.stringify(this.collection.moderators));
this.form.allow_comments = this.collection.allow_comments;
// Generates CoverPage from current cover_page_id info
if (this.form.cover_page_id != undefined && this.form.cover_page_id != '') {

View File

@ -244,7 +244,7 @@ export default {
saveEdition(filter) {
if ((filter.filter_type_object && filter.filter_type_object.form_component) || filter.edit_form == '') {
// this.fillExtraFormData(this.editForm);
this.updateFilter({ filterId: filter.id, index: this.index, options: this.editForm})
.then(() => {

View File

@ -370,7 +370,7 @@ export default {
}
.tainacan-page-title {
margin-bottom: 40px;
margin-bottom: 35px;
display: flex;
flex-wrap: wrap;
align-items: flex-end;

View File

@ -9,14 +9,14 @@
<h1 v-if="isCreatingNewItem">
<span
v-if="(item != null && item != undefined && item.status != undefined && !isLoading)"
class="status-tag">{{ $i18n.get(item.status) }}</span>
class="status-tag">{{ $i18n.get('status_' + item.status) }}</span>
{{ $i18n.get('title_create_item_collection') + ' ' }}
<span style="font-weight: 600;">{{ collectionName }}</span>
</h1>
<h1 v-else>
<span
v-if="(item != null && item != undefined && item.status != undefined && !isLoading)"
class="status-tag">{{ $i18n.get(item.status) }}</span>
class="status-tag">{{ $i18n.get('status_' + item.status) }}</span>
{{ $i18n.get('title_edit_item') + ' ' }}
<span style="font-weight: 600;">{{ (item != null && item != undefined) ? item.title : '' }}</span>
</h1>
@ -485,7 +485,7 @@
v-for="(metadatum, index) of metadatumList"
:key="index"
:metadatum="metadatum"
:is-collapsed="metadatumCollapses[index]"
:is-collapsed="metadataCollapses[index]"
@changeCollapse="onChangeCollapse($event, index)"/>
<!-- Hook for extra Form options -->
@ -707,7 +707,7 @@ export default {
isOnSequenceEdit: false,
sequenceRightDirection: false,
isLoading: false,
metadatumCollapses: [],
metadataCollapses: [],
collapseAll: true,
visibility: 'publish',
form: {
@ -718,20 +718,6 @@ export default {
comment_status: ''
},
thumbnail: {},
// Can be obtained from api later
statusOptions: [{
value: 'publish',
label: this.$i18n.get('public')
}, {
value: 'private',
label: this.$i18n.get('private')
}, {
value: 'draft',
label: this.$i18n.get('draft')
}, {
value: 'trash',
label: this.$i18n.get('trash')
}],
formErrorMessage: '',
thumbPlaceholderPath: tainacan_plugin.base_url + '/admin/images/placeholder_square.png',
thumbnailMediaFrame: undefined,
@ -859,9 +845,12 @@ export default {
this.isLoading = false;
if (!this.isOnSequenceEdit) {
if (this.form.status != 'trash')
this.$router.push(this.$routerHelper.getItemPath(this.form.collectionId, this.itemId));
else
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));
}
})
@ -919,11 +908,24 @@ export default {
loadMetadata() {
// Obtains Item Metadatum
this.fetchMetadata(this.itemId).then((metadata) => {
this.isLoading = false;
for (let i = 0; i < metadata.length; i++) {
this.metadatumCollapses.push(false);
this.metadatumCollapses[i] = true;
this.metadataCollapses = [];
if (this.isOnSequenceEdit && this.$route.query.collapses) {
for (let i = 0; i < metadata.length; i++) {
this.metadataCollapses.push(this.$route.query.collapses[i] != undefined ? this.$route.query.collapses[i] : true);
}
} else if (this.isOnSequenceEdit && !this.$route.query.collapses) {
for (let i = 0; i < metadata.length; i++) {
this.metadataCollapses.push(true);
this.metadataCollapses[i] = false;
}
} else {
for (let i = 0; i < metadata.length; i++) {
this.metadataCollapses.push(false);
this.metadataCollapses[i] = true;
}
}
this.isLoading = false;
});
},
setFileDocument(event) {
@ -1095,12 +1097,12 @@ export default {
toggleCollapseAll() {
this.collapseAll = !this.collapseAll;
for (let i = 0; i < this.metadatumCollapses.length; i++)
this.metadatumCollapses[i] = this.collapseAll;
for (let i = 0; i < this.metadataCollapses.length; i++)
this.metadataCollapses[i] = this.collapseAll;
},
onChangeCollapse(event, index) {
this.metadatumCollapses.splice(index, 1, event);
this.metadataCollapses.splice(index, 1, event);
},
onDeletePermanently() {
this.$modal.open({
@ -1121,7 +1123,12 @@ export default {
// Initializes Media Frames now that itemId exists
this.initializeMediaFrames();
this.fetchItem({ itemId: this.itemId, contextEdit: true }).then(res => {
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;
// Checks if user has permission to edit
@ -1173,11 +1180,17 @@ export default {
},
onNextInSequence() {
this.sequenceRightDirection = true;
this.$router.push(this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, this.sequenceId, this.itemPosition + 1));
this.$router.push({
path: this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, this.sequenceId, this.itemPosition + 1),
query: { collapses: this.metadataCollapses }
});
},
onPrevInSequence() {
this.sequenceRightDirection = false;
this.$router.push(this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, this.sequenceId, this.itemPosition - 1));
this.$router.push({
path: this.$routerHelper.getCollectionSequenceEditPath(this.collectionId, this.sequenceId, this.itemPosition - 1),
query: { collapses: this.metadataCollapses }
});
}
},
created(){
@ -1294,7 +1307,7 @@ export default {
.tainacan-page-title {
padding: 0 $page-side-padding;
margin-bottom: 40px;
margin-bottom: 35px;
display: flex;
flex-wrap: wrap;
align-items: flex-end;

View File

@ -5,7 +5,7 @@
:active.sync="isLoadingMetadata"
:can-cancel="false"/>
<div class="tainacan-page-title">
<h1><span class="status-tag">{{ $i18n.get(status) }}</span>{{ $i18n.get('label_bulk_edit_items') }}</h1>
<h1><span class="status-tag">{{ $i18n.get('status_' + status) }}</span>{{ $i18n.get('label_bulk_edit_items') }}</h1>
<a
@click="$router.go(-1)"
class="back-link has-text-secondary">
@ -31,7 +31,7 @@
{{ $i18n.get('info_there_is_one_item_being_edited') }}
</p>
<p v-if="items.length <= 0 && !isLoadingGroupInfo && bulkEditGroup.items_count > 1">
{{ $i18n.getWithVariables('info_there_are_%s_items_being_edited', bulkEditGroup.items_count) }}
{{ $i18n.getWithVariables('info_there_are_%s_items_being_edited', [bulkEditGroup.items_count]) }}
</p>
<p v-if="items.length <= 0 && !isLoadingGroupInfo">
{{ $i18n.get('info_no_preview_found') }}
@ -70,31 +70,17 @@
<div class="section-status">
<div class="field has-addons">
<b-radio
v-for="(statusOption, index) of $statusHelper.getStatuses().filter(option => { return option.value != 'trash' })"
:key="index"
v-model="status"
@input="changeStatus($event)"
value="publish"
native-value="publish">
:value="statusOption.slug"
:native-value="statusOption.slug">
<span class="icon">
<i class="tainacan-icon tainacan-icon-public"/>
</span> {{ $i18n.get('publish_visibility') }}
</b-radio>
<b-radio
v-model="status"
@input="changeStatus($event)"
value="private"
native-value="private">
<span class="icon">
<i class="tainacan-icon tainacan-icon-private"/>
</span> {{ $i18n.get('private_visibility') }}
</b-radio>
<b-radio
v-model="status"
@input="changeStatus($event)"
value="draft"
native-value="draft">
<span class="icon">
<i class="tainacan-icon tainacan-icon-draft"/>
</span> {{ $i18n.get('draft') }}
<i
class="tainacan-icon"
:class="$statusHelper.getIcon(statusOption.slug)"/>
</span> {{ statusOption.name }}
</b-radio>
</div>
</div>
@ -469,7 +455,7 @@ export default {
}
.tainacan-page-title {
margin-bottom: 40px;
margin-bottom: 35px;
display: flex;
flex-wrap: wrap;
align-items: flex-end;

View File

@ -90,15 +90,15 @@
<div class="status-radios">
<b-radio
v-model="form.status"
v-for="statusOption in statusOptions"
:key="statusOption.value"
:native-value="statusOption.value">
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
:native-value="statusOption.slug">
<span class="icon has-text-gray">
<i
class="tainacan-icon tainacan-icon-18px"
:class="'tainacan-icon-' + getStatusIcon(statusOption.value)"/>
:class="$statusHelper.getIcon(statusOption.slug)"/>
</span>
{{ statusOption.label }}
{{ statusOption.name }}
</b-radio>
</div>
</b-field>
@ -224,19 +224,6 @@
allowInsert: String,
enabledPostTypes: Array
},
statusOptions: [{
value: 'publish',
label: this.$i18n.get('public')
}, {
value: 'private',
label: this.$i18n.get('private')
}, {
value: 'draft',
label: this.$i18n.get('draft')
}, {
value: 'trash',
label: this.$i18n.get('trash')
}],
wpPostTypes: tainacan_plugin.wp_post_types,
editFormErrors: {},
formErrorMessage: '',
@ -415,15 +402,6 @@
})
.catch(error => this.$console.error(error));
},
getStatusIcon(status) {
switch(status) {
case 'publish': return 'public';
case 'private': return 'private';
case 'draft': return 'draft';
case 'trash': return 'delete';
default: return 'item';
}
},
clearErrors(attribute) {
this.editFormErrors[attribute] = undefined;
},

View File

@ -432,7 +432,7 @@
animation-duration: 0.5s;
.tainacan-page-title {
margin-bottom: 40px;
margin-bottom: 35px;
h2 {
font-size: 20px;

View File

@ -1,5 +1,7 @@
<template>
<div class="tainacan-cards-container">
<div
style="min-height: initial; position: relative"
class="tainacan-cards-container">
<template v-if="collections.length <= 0 && !isLoading">
<ul class="new-collection-menu">
<li>
@ -260,6 +262,7 @@ export default {
props: {
isLoading: false,
collections: Array,
collectionsTotal: Number
}
}
</script>

View File

@ -17,21 +17,12 @@
</div>
<p v-if="isRepositoryLevel">{{ $i18n.get('info_repository_filters_inheritance') }}</p>
<br>
<div class="columns">
<div
:style="{ height: 'calc(100vh - 6px - ' + columnsTopY + 'px)'}"
class="columns"
ref="filterEditionPageColumns">
<div class="column">
<section
v-if="activeFilterList.length <= 0 && !isLoadingFilters"
class="field is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<span class="icon is-large">
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-filters"/>
</span>
</p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<p>{{ $i18n.get('info_create_filters' ) }}</p>
</div>
</section>
<draggable
class="active-filters-area"
@change="handleChangeOnFilter"
@ -45,6 +36,19 @@
ghostClass: 'sortable-ghost',
filter: 'not-sortable-item',
animation: '250'}">
<section
v-if="activeFilterList.length <= 0 && !isLoadingFilters"
class="field is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<span class="icon is-large">
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-filters"/>
</span>
</p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<p>{{ $i18n.get('info_create_filters' ) }}</p>
</div>
</section>
<div
class="active-filter-item"
:class="{
@ -255,7 +259,7 @@
:key="index"
@click="onFilterTypeSelected(filterType)"
@mouseover="currentFilterTypePreview = { name: filterType.name, template: filterType.preview_template }"
@mouseleave="currentFilterTypePreview = undefined">
@mouseleave="currentFilterTypePreview = { name: filterType.name, template: filterType.preview_template }">
<h4>{{ filterType.name }}</h4>
</div>
</div>
@ -330,7 +334,8 @@ export default {
newFilterIndex: 0,
availableMetadata: [],
filterTypes: [],
currentFilterTypePreview: undefined
currentFilterTypePreview: undefined,
columnsTopY: 0
}
},
computed: {
@ -569,6 +574,7 @@ export default {
this.newFilterIndex = 0;
}
this.openedFilterId = filter.id;
// First time opening
if (this.editForms[this.openedFilterId] == undefined) {
this.editForms[this.openedFilterId] = JSON.parse(JSON.stringify(filter));
@ -609,6 +615,10 @@ export default {
if (!this.isRepositoryLevel)
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('filter') }]);
this.$nextTick(() => {
this.columnsTopY = this.$refs.filterEditionPageColumns.getBoundingClientRect().top;
});
this.isRepositoryLevel = this.$route.name == 'FiltersPage' ? true : false;
if (this.isRepositoryLevel)
this.collectionId = 'default';
@ -666,9 +676,10 @@ export default {
@import "../../scss/_variables.scss";
.filters-list-page {
padding-bottom: 0;
.tainacan-page-title {
margin-bottom: 40px;
margin-bottom: 35px;
display: flex;
flex-wrap: wrap;
align-items: flex-end;
@ -696,9 +707,18 @@ export default {
}
}
.column:not(.available-metadata-area){
overflow: hidden;
flex-grow: 2;
.column {
overflow-x: hidden;
overflow-y: auto;
&:not(.available-metadata-area){
margin-right: $page-side-padding;
flex-grow: 2;
@media screen and (max-width: 769px) {
margin-right: 0;
}
}
}
.loading-spinner {
@ -715,9 +735,9 @@ export default {
.active-filters-area {
font-size: 14px;
margin-right: 0.8em;
margin-left: -0.8em;
padding-right: 6em;
margin-right: 0.8rem;
margin-left: -0.8rem;
padding-right: 3rem;
min-height: 330px;
@media screen and (max-width: 769px) {
@ -888,13 +908,13 @@ export default {
}
h3 {
margin: 0.2em 0em 1em -1.2em;
margin: 0.2rem 0rem 1rem 0rem;
font-weight: 500;
}
.available-metadatum-item {
padding: 0.7em;
margin: 4px;
margin: 4px 4px 4px 1.2rem;
background-color: white;
cursor: pointer;
left: 0;
@ -1013,6 +1033,7 @@ export default {
.column {
overflow: visible;
margin: 0;
}
.filter-types-container {
@ -1091,7 +1112,7 @@ export default {
}
.field {
width: 100%;
margin: 16px;
margin: 6px;
.label {
color: $gray5;
font-weight: normal;
@ -1102,6 +1123,36 @@ export default {
text-decoration: underline;
margin: 0.875rem 1.5rem;
}
.numeric-filter-container,
.date-filter-container {
display: flex;
.field { margin: 0; }
.dropdown {
width: auto;
.dropdown-trigger button {
padding: 0 0.5rem !important;
height: 30px !important;
i:not(.tainacan-icon-arrowdown) {
margin-top: -3px;
font-size: 1.5rem;
font-style: normal;
color: #555758;
}
}
.dropdown-menu {
display: block !important;
}
}
.datepicker {
flex-shrink: 0;
max-width: 70%;
}
}
}
}

View File

@ -107,6 +107,11 @@
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !$route.query.iframemode">
{{ $i18n.getFrom('items','edit_item') }}
</b-dropdown-item>
<!-- <b-dropdown-item
@click="duplicateOneItem(contextMenuItem.id)"
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !$route.query.iframemode">
{{ $i18n.get('label_duplicate_item') }}
</b-dropdown-item> -->
<b-dropdown-item
@click="deleteOneItem(contextMenuItem.id)"
v-if="contextMenuItem != null && contextMenuItem.current_user_can_edit && !$route.query.iframemode">
@ -485,13 +490,13 @@
show: 500,
hide: 300,
},
content: item.creation_date != undefined ? item.creation_date : '',
content: item.creation_date != undefined ? parseDateToNavigatorLanguage(item.creation_date) : '',
html: false,
autoHide: false,
placement: 'auto-start'
}"
class="metadata-author-creation">
{{ $i18n.get('info_date') + ' ' + (item.creation_date != undefined ? item.creation_date : '') }}
{{ $i18n.get('info_date') + ' ' + (item.creation_date != undefined ? parseDateToNavigatorLanguage(item.creation_date) : '') }}
</p>
</div>
</div>
@ -654,6 +659,15 @@
v-html="renderMetadata(item.metadata, column)"
class="metadata-value"/>
</span>
<span
v-for="(column, index) in tableMetadata"
:key="index"
v-if="column.metadatum == 'row_creation' || column.metadatum == 'row_author'">
<h3 class="metadata-label">{{ column.name }}</h3>
<p
v-html="column.metadatum == 'row_creation' ? parseDateToNavigatorLanguage(item[column.slug]) : item[column.slug]"
class="metadata-value"/>
</span>
</div>
</div>
@ -687,8 +701,7 @@
column.metadata_type_object.primitive_type == 'item' ||
column.metadata_type_object.primitive_type == 'compound') : false,
'column-large-width' : column.metadata_type_object != undefined ? (column.metadata_type_object.primitive_type == 'long_string' || column.metadata_type_object.related_mapped_prop == 'description') : false,
}"
:custom-key="column.slug">
}">
<div class="th-wrap">{{ column.name }}</div>
</th>
<th class="actions-header">
@ -718,7 +731,6 @@
:key="columnIndex"
v-for="(column, columnIndex) in tableMetadata"
v-if="column.display"
:label="column.name"
class="column-default-width"
:class="{ 'metadata-type-textarea': column.metadata_type_object != undefined && column.metadata_type_object.component == 'tainacan-textarea',
'thumbnail-cell': column.metadatum == 'row_thumbnail',
@ -750,7 +762,7 @@
v-if="collectionId == undefined &&
column.metadata_type_object != undefined &&
column.metadata_type_object.related_mapped_prop == 'title'"
v-html="(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_informed') + `</span>`)"/>
<p
v-tooltip="{
delay: {
@ -765,7 +777,7 @@
v-if="collectionId == undefined &&
column.metadata_type_object != undefined &&
column.metadata_type_object.related_mapped_prop == 'description'"
v-html="(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_informed') + `</span>`)"/>
<p
v-tooltip="{
delay: {
@ -804,9 +816,23 @@
autoHide: false,
placement: 'auto-start'
}"
v-if="column.metadatum == 'row_author' || column.metadatum == 'row_creation'">
v-if="column.metadatum == 'row_author'">
{{ item[column.slug] }}
</p>
<p
v-tooltip="{
delay: {
show: 500,
hide: 300,
},
content: parseDateToNavigatorLanguage(item[column.slug]),
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-if="column.metadatum == 'row_creation'">
{{ parseDateToNavigatorLanguage(item[column.slug]) }}
</p>
</td>
@ -875,6 +901,7 @@
import { mapActions, mapGetters } from 'vuex';
import CustomDialog from '../other/custom-dialog.vue';
import BulkEditionModal from '../bulk-edition/bulk-edition-modal.vue';
import { dateInter } from "../../../admin/js/mixins";
export default {
name: 'ItemsList',
@ -894,6 +921,7 @@ export default {
enableSelectAllItemsPages: tainacan_plugin.enable_select_all_items_pages
}
},
mixins: [ dateInter ],
props: {
collectionId: undefined,
tableMetadata: Array,
@ -949,6 +977,10 @@ export default {
...mapGetters('bulkedition', [
'getGroupID'
]),
...mapActions('item', [
'fetchItem',
'duplicateItem'
]),
...mapGetters('search', [
'getOrder',
'getOrderBy'
@ -993,6 +1025,18 @@ export default {
this.selectedItems.splice(i, 1, this.isAllItemsSelected);
}
},
duplicateOneItem(itemId) {
this.fetchItem({ itemId: itemId, contextEdit: true })
.then((item) => {
this.duplicateItem({ item: item })
.then((duplicatedItem) => {
this.$console.log(duplicatedItem);
})
.catch((error) => this.$console.error(error));
})
.catch(error => this.$console.error("Error fetching item for duplicate: " + error));
this.clearContextMenu();
},
untrashOneItem(itemId) {
this.$modal.open({
parent: this,
@ -1178,9 +1222,9 @@ export default {
return '';
} else {
if ((component != undefined && component == 'tainacan-textarea') || this.$route.query.iframemode)
return metadata.value_as_string;
return this.viewMode == 'table' ? ('<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_string) : metadata.value_as_string;
else
return metadata.value_as_html;
return this.viewMode == 'table' ? ('<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_html) : metadata.value_as_html;
}
},
getLimitedDescription(description) {

View File

@ -20,21 +20,11 @@
<br>
<b-tabs v-model="activeTab">
<b-tab-item :label="$i18n.get('metadata')">
<div class="columns">
<div class="column">
<section
v-if="activeMetadatumList.length <= 0 && !isLoadingMetadata"
class="field is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<span class="icon is-large">
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-metadata"/>
</span>
</p>
<p>{{ $i18n.get('info_there_is_no_metadatum' ) }}</p>
<p>{{ $i18n.get('info_create_metadata' ) }}</p>
</div>
</section>
<div
:style="{ height: 'calc(100vh - 6px - ' + columnsTopY + 'px)'}"
class="columns"
ref="metadataEditionPageColumns">
<div class="column">
<draggable
v-model="activeMetadatumList"
class="active-metadata-area"
@ -49,6 +39,19 @@
chosenClass: 'sortable-chosen',
filter: 'not-sortable-item',
animation: '250'}">
<section
v-if="activeMetadatumList.length <= 0 && !isLoadingMetadata"
class="field is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<span class="icon is-large">
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-metadata"/>
</span>
</p>
<p>{{ $i18n.get('info_there_is_no_metadatum' ) }}</p>
<p>{{ $i18n.get('info_create_metadata' ) }}</p>
</div>
</section>
<div
class="active-metadatum-item"
:class="{
@ -233,10 +236,8 @@
</b-tab-item>
<!-- Exposer --------------- -->
<b-tab-item
:label="$i18n.get('mapping')"
v-model="activeMetadatumList">
<div class="active-metadata-area">
<b-tab-item :label="$i18n.get('mapping')">
<div>
<section
v-if="activeMetadatumList.length <= 0 && !isLoadingMetadata"
class="field is-grouped-centered section">
@ -254,11 +255,12 @@
<div class="field is-grouped form-submit">
<b-select
id="mappers-options-dropdown"
:placeholder="$i18n.get('instruction_select_a_mapper')">
:placeholder="$i18n.get('instruction_select_a_mapper')"
@input="onSelectMetadataMapper($event)">
<option
v-for="metadatum_mapper in metadatum_mappers"
:key="metadatum_mapper.slug"
@click="onSelectMetadataMapper(metadatum_mapper)">
:value="metadatum_mapper">
{{ $i18n.get(metadatum_mapper.name) }}
</option>
</b-select>
@ -458,7 +460,8 @@ export default {
newMapperMetadataList: [],
new_metadata_label: '',
new_metadata_uri: '',
new_metadata_slug: ''
new_metadata_slug: '',
columnsTopY: 0
}
},
components: {
@ -644,6 +647,7 @@ export default {
this.openedMetadatumId = '';
},
onSelectMetadataMapper(metadatum_mapper) {
this.isMapperMetadataLoading = true;
this.mapper = metadatum_mapper; //TODO try to use v-model again
this.mapperMetadata = [];
@ -861,6 +865,10 @@ export default {
if (!this.isRepositoryLevel)
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('metadata') }]);
this.$nextTick(() => {
this.columnsTopY = this.$refs.metadataEditionPageColumns.getBoundingClientRect().top;
});
this.cleanMetadata();
this.isLoadingMetadatumTypes = true;
this.isLoadingMetadata = true;
@ -896,9 +904,11 @@ export default {
@import "../../scss/_variables.scss";
.metadata-list-page {
padding-bottom: 0;
height: calc(100% - 42px + 26px);
.tainacan-page-title {
margin-bottom: 40px;
margin-bottom: 35px;
display: flex;
flex-wrap: wrap;
align-items: flex-end;
@ -930,10 +940,19 @@ export default {
overflow: visible;
min-height: 500px;
}
.column:not(.available-metadata-area){
overflow: hidden;
flex-grow: 2;
.column {
overflow-x: hidden;
overflow-y: auto;
&:not(.available-metadata-area){
margin-right: $page-side-padding;
flex-grow: 2;
@media screen and (max-width: 769px) {
margin-right: 0;
}
}
}
.page-title {
@ -969,9 +988,9 @@ export default {
.active-metadata-area {
font-size: 14px;
margin-right: 0.8em;
margin-left: -0.8em;
padding-right: 6em;
margin-right: 0.8rem;
margin-left: -0.8rem;
padding-right: 3rem;
min-height: 330px;
@media screen and (max-width: 769px) {
@ -1133,13 +1152,13 @@ export default {
}
h3 {
margin: 0.2em 0em 1em -1.2em;
margin: 0.2rem 0rem 1rem 0rem;
font-weight: 500;
}
.available-metadatum-item {
padding: 0.7em;
margin: 4px;
margin: 4px 4px 4px 1.2rem;
background-color: white;
cursor: pointer;
left: 0;
@ -1169,7 +1188,7 @@ export default {
overflow-x: hidden;
white-space: nowrap;
font-weight: bold;
margin-left: 0.4em;
margin-left: 0.4rem;
display: inline-block;
max-width: 180px;
width: 60%;

View File

@ -11,36 +11,50 @@
{{ $i18n.get('label_new_term') }}
</button>
<b-field class="order-area">
<button
:disabled="localTerms.length <= 0 || isLoadingTerms || isEditingTerm || order == 'asc'"
class="button is-white is-small"
@click="onChangeOrder('asc')">
<span
v-tooltip="{
content: $i18n.get('label_sort_ascending'),
autoHide: true,
classes: ['tooltip', 'repository-tooltip'],
placement: 'bottom'
}"
class="icon gray-icon">
<i class="tainacan-icon tainacan-icon-sortascending"/>
</span>
</button>
<button
:disabled="localTerms.length <= 0 || isLoadingTerms || isEditingTerm || order == 'desc'"
class="button is-white is-small"
@click="onChangeOrder('desc')">
<span
v-tooltip="{
content: $i18n.get('label_sort_descending'),
autoHide: true,
classes: ['tooltip', 'repository-tooltip'],
placement: 'bottom'
}"
class="icon gray-icon">
<i class="tainacan-icon tainacan-icon-sortdescending"/>
</span>
</button>
<label class="label">{{ $i18n.get('label_sort') }}</label>
<b-dropdown
:mobile-modal="true"
:disabled="localTerms.length <= 0 || isLoadingTerms || isEditingTerm"
@input="onChangeOrder(order == 'asc' ? 'desc' : 'asc')"
aria-role="list">
<button
:aria-label="$i18n.get('label_sorting_direction')"
class="button is-white"
slot="trigger">
<span class="icon is-small gray-icon">
<i
:class="order == 'desc' ? 'tainacan-icon-sortdescending' : 'tainacan-icon-sortascending'"
class="tainacan-icon"/>
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'desc' }"
:value="'desc'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortdescending"/>
</span>
{{ $i18n.get('label_descending') }}
</b-dropdown-item>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'asc' }"
:value="'asc'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortascending"/>
</span>
{{ $i18n.get('label_ascending') }}
</b-dropdown-item>
</b-dropdown>
</b-field>
<div class="search-area is-hidden-mobile">
<div class="control has-icons-right is-small is-clearfix">
@ -468,19 +482,35 @@ export default {
align-items: flex-start;
.order-area {
display: inline-flex !important;
padding: 4px;
margin-top: -4px;
margin-left: auto;
.gray-icon,
.gray-icon .icon {
color: $gray4 !important;
.label {
font-size: 0.875rem;
font-weight: normal;
margin-top: 3px;
margin-bottom: 2px;
cursor: default;
}
.gray-icon
.icon i::before,
.button {
display: flex;
align-items: center;
}
.field {
align-items: center;
}
.gray-icon, .gray-icon .icon {
color: $gray4 !important;
padding-right: 10px;
}
.gray-icon .icon i::before,
.gray-icon i::before {
font-size: 21px !important;
width: 26px;
font-size: 1.3125rem !important;
max-width: 26px;
}
}

View File

@ -68,7 +68,7 @@ export default {
@import "../../scss/_variables.scss";
.tainacan-page-title {
margin-bottom: 40px;
margin-bottom: 35px;
display: flex;
flex-wrap: wrap;
align-items: flex-end;

View File

@ -31,7 +31,7 @@
<template v-if="modalOnClick">
<b-modal
:active.sync="isPreviewModalActive"
:width="640"
:width="1024"
scroll="keep">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
@ -40,7 +40,10 @@
<div
class="is-flex rendered-content"
v-html="file.description.rendered" />
<iframe
style="width: 100%; min-height: 50vh;"
v-if="file.guid != undefined && file.guid.rendered != undefined && file.mime_type != undefined && file.mime_type == 'application/pdf'"
:src="file.guid.rendered" />
<div class="field is-grouped form-submit">
<div class="control">
<button
@ -163,6 +166,8 @@ export default {
}
.rendered-content {
justify-content: center !important;
flex-direction: column;
align-items: center;
}
</style>

View File

@ -24,6 +24,8 @@ import FormTaxonomy from '../../classes/metadata-types/taxonomy/FormTaxonomy.vue
import FormSelectbox from '../../classes/metadata-types/selectbox/FormSelectbox.vue';
import FilterCustomInterval from '../../classes/filter-types/custom-interval/CustomInterval.vue';
import FilterNumeric from '../../classes/filter-types/numeric/Numeric.vue';
import FilterDate from '../../classes/filter-types/date/Date.vue';
import FilterSelectbox from '../../classes/filter-types/selectbox/Selectbox.vue';
import FilterAutocomplete from '../../classes/filter-types/autocomplete/Autocomplete.vue';
import FilterCheckbox from '../../classes/filter-types/checkbox/Checkbox.vue';
@ -32,6 +34,8 @@ import FilterTaginput from '../../classes/filter-types/taginput/Taginput.vue';
import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox.vue';
import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue';
import FormNumeric from '../../classes/filter-types/numeric/FormNumeric.vue';
import TainacanFormItem from '../../classes/metadata-types/tainacan-form-item.vue';
import TainacanFiltersList from '../../classes/filter-types/tainacan-filter-item.vue';
@ -43,7 +47,7 @@ import store from '../../js/store/store'
import router from './router'
import eventBusSearch from '../../js/event-bus-search';
import termsListBus from './terms-list-bus.js';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, UserCapabilitiesPlugin } from './utilities';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, UserCapabilitiesPlugin, StatusHelperPlugin } from './utilities';
// Configure and Register Plugins
Vue.use(Buefy);
@ -53,6 +57,7 @@ Vue.use(I18NPlugin);
Vue.use(UserPrefsPlugin);
Vue.use(RouterHelperPlugin);
Vue.use(UserCapabilitiesPlugin);
Vue.use(StatusHelperPlugin);
Vue.use(ConsolePlugin, {visual: false});
Vue.use(VueTheMask);
@ -64,7 +69,7 @@ Vue.component('tainacan-numeric', Numeric);
Vue.component('tainacan-date', Date);
Vue.component('tainacan-relationship', Relationship);
Vue.component('tainacan-taxonomy', Taxonomy);
/* Metadata Option forms */
Vue.component('tainacan-form-relationship', FormRelationship);
Vue.component('tainacan-form-taxonomy', FormTaxonomy);
Vue.component('tainacan-form-selectbox', FormSelectbox);
@ -73,12 +78,16 @@ Vue.component('tainacan-filter-item', TainacanFiltersList);
/* Filters */
Vue.component('tainacan-filter-custom-interval', FilterCustomInterval);
Vue.component('tainacan-filter-numeric', FilterNumeric);
Vue.component('tainacan-filter-date', FilterDate);
Vue.component('tainacan-filter-selectbox', FilterSelectbox);
Vue.component('tainacan-filter-autocomplete', FilterAutocomplete);
Vue.component('tainacan-filter-checkbox', FilterCheckbox);
Vue.component('tainacan-filter-taginput', FilterTaginput);
Vue.component('tainacan-filter-taxonomy-checkbox', FilterTaxonomyCheckbox);
Vue.component('tainacan-filter-taxonomy-taginput', FilterTaxonomyTaginput);
/* Filter Metadata Option forms */
Vue.component('tainacan-filter-form-numeric', FormNumeric);
/* Others */
Vue.component('help-button', HelpButton);

View File

@ -22,29 +22,31 @@ export const wpAjax = {
new_slug: newSlug,
nonce: tainacan_plugin.nonce,
}));
},
getDatei18n(dateString){
return this.axiosWPAjax.post('', qs.stringify({
action: 'tainacan-date-i18n',
date_string: dateString,
nonce: tainacan_plugin.nonce,
}));
},
}
}
};
export const dateInter = {
methods: {
getDateLocaleMask() {
let locale = navigator.language;
created() {
let locale = navigator.language;
moment.locale(locale);
moment.locale(locale);
let localeData = moment.localeData();
let format = localeData.longDateFormat('L');
return format.replace(/[\w]/g, '#');
let localeData = moment.localeData();
this.dateFormat = localeData.longDateFormat('L');
this.dateMask = this.dateFormat.replace(/[\w]/g, '#');
},
data() {
return {
dateFormat: '',
dateMask: ''
}
},
methods: {
parseDateToNavigatorLanguage(date) {
date = new Date(date.replace(/-/g, '/'));
return moment(date, moment.ISO_8601).format(this.dateFormat);
},
}
};

View File

@ -5,19 +5,9 @@ import VTooltip from 'v-tooltip';
import VueMasonry from 'vue-masonry-css';
// Custom elements
import Text from '../../classes/metadata-types/text/Text.vue';
import Textarea from '../../classes/metadata-types/textarea/Textarea.vue';
import Selectbox from '../../classes/metadata-types/selectbox/Selectbox.vue';
import Numeric from '../../classes/metadata-types/numeric/Numeric.vue';
import Date from '../../classes/metadata-types/date/Date.vue';
import Relationship from '../../classes/metadata-types/relationship/Relationship.vue';
import Taxonomy from '../../classes/metadata-types/taxonomy/Taxonomy.vue';
import FormRelationship from '../../classes/metadata-types/relationship/FormRelationship.vue';
import FormTaxonomy from '../../classes/metadata-types/taxonomy/FormTaxonomy.vue';
import FormSelectbox from '../../classes/metadata-types/selectbox/FormSelectbox.vue';
import FilterCustomInterval from '../../classes/filter-types/custom-interval/CustomInterval.vue';
import FilterNumeric from '../../classes/filter-types/numeric/Numeric.vue';
import FilterDate from '../../classes/filter-types/date/Date.vue';
import FilterSelectbox from '../../classes/filter-types/selectbox/Selectbox.vue';
import FilterAutocomplete from '../../classes/filter-types/autocomplete/Autocomplete.vue';
import FilterCheckbox from '../../classes/filter-types/checkbox/Checkbox.vue';
@ -26,7 +16,6 @@ import FilterTaginput from '../../classes/filter-types/taginput/Taginput.vue';
import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox.vue';
import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue';
import TaincanFormItem from '../../classes/metadata-types/tainacan-form-item.vue';
import TaincanFiltersList from '../../classes/filter-types/tainacan-filter-item.vue';
import ItemsPage from '../pages/lists/items-page.vue';
import TermItemsPage from '../pages/lists/term-items-page.vue';
@ -37,12 +26,10 @@ import ViewModeMasonry from '../../theme-helper/view-mode-masonry.vue';
import ViewModeSlideshow from '../../theme-helper/view-mode-slideshow.vue';
// Remaining imports
import HelpButton from '../components/other/help-button.vue';
import draggable from 'vuedraggable'
import store from '../../js/store/store'
import routerTheme from './theme-router.js'
import eventBusSearch from '../../js/event-bus-search';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin } from './utilities';
import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, StatusHelperPlugin } from './utilities';
// Configure and Register Plugins
Vue.use(Buefy);
@ -51,25 +38,16 @@ Vue.use(VueMasonry);
Vue.use(I18NPlugin);
Vue.use(UserPrefsPlugin);
Vue.use(RouterHelperPlugin);
Vue.use(StatusHelperPlugin);
Vue.use(ConsolePlugin, {visual: false});
/* Metadata */
Vue.component('tainacan-text', Text);
Vue.component('tainacan-textarea', Textarea);
Vue.component('tainacan-selectbox', Selectbox);
Vue.component('tainacan-numeric', Numeric);
Vue.component('tainacan-date', Date);
Vue.component('tainacan-relationship', Relationship);
Vue.component('tainacan-taxonomy', Taxonomy);
Vue.component('tainacan-form-relationship', FormRelationship);
Vue.component('tainacan-form-taxonomy', FormTaxonomy);
Vue.component('tainacan-form-selectbox', FormSelectbox);
Vue.component('tainacan-form-item', TaincanFormItem);
Vue.component('tainacan-filter-item', TaincanFiltersList);
/* Filters */
Vue.component('tainacan-filter-custom-interval', FilterCustomInterval);
Vue.component('tainacan-filter-numeric', FilterNumeric);
Vue.component('tainacan-filter-date', FilterDate);
Vue.component('tainacan-filter-selectbox', FilterSelectbox);
Vue.component('tainacan-filter-autocomplete', FilterAutocomplete);
Vue.component('tainacan-filter-checkbox', FilterCheckbox);
@ -78,8 +56,6 @@ Vue.component('tainacan-filter-taxonomy-checkbox', FilterTaxonomyCheckbox);
Vue.component('tainacan-filter-taxonomy-taginput', FilterTaxonomyTaginput);
/* Others */
Vue.component('help-button', HelpButton);
Vue.component('draggable', draggable);
Vue.component('items-page', ItemsPage);
Vue.component('term-items-page', TermItemsPage);

View File

@ -101,14 +101,18 @@ I18NPlugin.install = function (Vue, options = {}) {
getWithVariables(key, variables) { // TRY WITH regex: \%((\d)\$)*s
let rawString = tainacan_plugin.i18n[key];
if (rawString != undefined && rawString != null && rawString != '' ) {
let splits = rawString.match(/\%((\d)\$)*s/gm); // An array with all the %s, %1$s, %2$s, etc
let parsedString = '';
for (let i = 0; i < splits.length; i++) {
parsedString += rawString.split(splits[i]).join(variables[i]);
}
return parsedString;
// let splits = rawString.match(/\%((\d)\$)*s*/gm); // An array with all the %s, %1$s, %2$s, etc
// let parsedString = '';
// for (let i = 0; i < splits.length; i++) {
// parsedString += rawString.split(splits[i]).join(variables[i]);
// }
// return parsedString;
const regex = /\%(\d\$)*s/m;
for (let variable of variables)
rawString = rawString.replace(regex, variable);
return rawString;
} else {
"Invalid i18n key: " + tainacan_plugin.i18n[key];
}
@ -150,7 +154,8 @@ UserPrefsPlugin.install = function (Vue, options = {}) {
.then( updatedRes => {
let prefs = JSON.parse(updatedRes.data.meta['tainacan_prefs']);
this.tainacanPrefs = prefs;
});
})
.catch( () => console.log("Request to /users/me failed. Maybe you're not logged in.") );
} else {
let prefs = JSON.parse(tainacan_plugin.user_prefs);
this.tainacanPrefs = prefs;
@ -175,9 +180,7 @@ UserPrefsPlugin.install = function (Vue, options = {}) {
this.tainacanPrefs[key] = value;
}
})
.catch(error => {
reject( error );
});
.catch( () => console.log("Request to /users/me failed. Maybe you're not logged in.") );
});
},
clean() {
@ -338,4 +341,61 @@ UserCapabilitiesPlugin.install = function (Vue, options = {}) {
return false;
}
}
};
// STATUS ICONS PLUGIN - Sets icon for status option
export const StatusHelperPlugin = {};
StatusHelperPlugin.install = function (Vue, options = {}) {
Vue.prototype.$statusHelper = {
statuses: [
{ name: tainacan_plugin.i18n['status_publish'], slug: 'publish' },
// { name: tainacan_plugin.i18n['status_private'], slug: 'private' },
// { name: tainacan_plugin.i18n['status_draft'], slug: 'draft' },
// { name: tainacan_plugin.i18n['status_trash'], slug: 'trash' }
],
getIcon(status) {
switch (status) {
case 'publish': return 'tainacan-icon-public';
case 'private': return 'tainacan-icon-private';
case 'draft': return 'tainacan-icon-draft';
case 'trash': return 'tainacan-icon-delete';
default: '';
}
},
hasIcon(status) {
return ['publish', 'private', 'draft', 'trash'].includes(status);
},
getStatuses() {
return this.statuses;
},
loadStatuses() {
wpApi.get('/statuses/')
.then( res => {
let loadedStatus = res.data;
this.statuses = [];
if (loadedStatus['publish'] != undefined)
this.statuses.push(loadedStatus['publish']);
if (loadedStatus['private'] != undefined)
this.statuses.push(loadedStatus['private']);
this.statuses.concat(Object.values(loadedStatus).filter((status) => {
return !['publish','private','draft','trash'].includes(status.slug);
}));
if (loadedStatus['draft'] != undefined)
this.statuses.push(loadedStatus['draft']);
if (loadedStatus['trash'] != undefined)
this.statuses.push(loadedStatus['trash']);
})
.catch(error => {
console.error( error );
});
}
}
};

View File

@ -41,7 +41,7 @@
<span class="icon is-medium">
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-items"/>
</span>
<span class="menu-text">{{ $i18n.get('label_all_items') }}</span>
<span class="menu-text">{{ $i18n.get('label_all_published_items') }}</span>
</router-link>
</li> -->
<li>
@ -109,6 +109,9 @@
</section>
<section class="home-section home-section-collection">
<div
class="collection-section-connector"
aria-hidden/>
<div class="home-section-header collections-section-header">
<div class="home-section-icon">
<router-link
@ -118,19 +121,30 @@
<i class="tainacan-icon tainacan-icon-collections"/>
</router-link>
</div>
<h1>{{ $i18n.get('collections') }}</h1>
<router-link
tag="a"
to="/collections">
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-viewtable"/>
</span>
<span class="menu-text">{{ $i18n.get('label_view_all_collections') }}</span>
</router-link>
<h1>{{ $i18n.get('label_recent_collections') }}</h1>
</div>
<collections-home-list
:is-loading="isLoadingCollections"
:collections="collections"/>
:collections="collections"
:collections-total="collectionsTotal"/>
<router-link
class="collections-see-more"
tag="a"
to="/collections">
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-viewtable"/>
</span>
<span
v-if="collectionsTotal != undefined && collectionsTotal > 1"
class="menu-text">
{{ $i18n.getWithVariables('label_view_all_%s_collections', [collectionsTotal]) }}
</span>
<span
v-if="collectionsTotal != undefined && collectionsTotal == 1"
class="menu-text">
{{ $i18n.get('label_view_collections_list') }}
</span>
</router-link>
</section>
</div>
@ -169,12 +183,13 @@ export default {
this.cleanCollections();
this.isLoadingCollections = true;
this.fetchCollections({ page: 1, collectionsPerPage: 9, status: undefined, contextEdit: true })
.then(() => {
this.isLoadingCollections = false;
})
.catch(() => {
this.isLoadingCollections = false;
});
.then((res) => {
this.collectionsTotal = res.total;
this.isLoadingCollections = false;
})
.catch(() => {
this.isLoadingCollections = false;
});
}
},
mounted(){
@ -203,6 +218,7 @@ export default {
}
}
&.home-section-collection {
position: relative;
margin-left: 52px;
}
@ -215,6 +231,15 @@ export default {
top: 43px;
left: 26px;
}
.collection-section-connector {
border-left: 1px solid $gray2;
border-bottom: 1px solid $gray2;
position: absolute;
width: calc(100% + 26px);
height: 100%;
top: 0px;
left: -26px;
}
.home-section-header {
width: 100%;
@ -282,6 +307,34 @@ export default {
}
}
}
a.collections-see-more {
padding: 10px 16px;
display: inline-flex;
text-overflow: ellipsis;
white-space: nowrap;
background: $gray1;
color: $turquoise5;
float: right;
width: calc(100% - 20px);
@media screen and (min-width: 768px) {
width: calc(50% - 20px);
}
@media screen and (min-width: 1215px) {
width: calc(33.3333% - 20px);
}
@media screen and (min-width: 1408px) {
width: calc(25% - 20px);
}
@media screen and (min-width: 1920px) {
width: calc(20% - 20px);
}
.menu-text { margin-left: 0.5rem;}
&:hover {
background-color: $gray2;
}
}
}
.repository-menu-list {

View File

@ -57,6 +57,55 @@
<!-- Sorting options ---- -->
<b-field class="header-item">
<label class="label">{{ $i18n.get('label_sort') }}</label>
<b-dropdown
:mobile-modal="true"
:disabled="collections.length <= 0 || isLoading"
@input="onChangeOrder(order == 'asc' ? 'desc' : 'asc')"
aria-role="list">
<button
:aria-label="$i18n.get('label_sorting_direction')"
class="button is-white"
slot="trigger">
<span class="icon is-small gray-icon">
<i
:class="order == 'desc' ? 'tainacan-icon-sortdescending' : 'tainacan-icon-sortascending'"
class="tainacan-icon tainacan-icon-18px"/>
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'desc' }"
:value="'desc'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortdescending"/>
</span>
{{ $i18n.get('label_descending') }}
</b-dropdown-item>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'asc' }"
:value="'asc'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortascending"/>
</span>
{{ $i18n.get('label_ascending') }}
</b-dropdown-item>
</b-dropdown>
<span
class="label"
style="padding-left: 0.65rem;">
{{ $i18n.get('info_by_inner') }}
</span>
<b-select
class="sorting-select"
:disabled="collections.length <= 0"
@ -70,38 +119,6 @@
{{ option.label }}
</option>
</b-select>
<button
:disabled="collections.length <= 0 || isLoading || order == 'desc'"
class="button is-white is-small"
@click="onChangeOrder('desc')"
:aria-label="$i18n.get('label_sort_descending')">
<span
v-tooltip="{
content: $i18n.get('label_sort_descending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', 'repository-tooltip']
}"
class="icon gray-icon is-small">
<i class="tainacan-icon tainacan-icon-sortdescending tainacan-icon-20px"/>
</span>
</button>
<button
:disabled="collections.length <= 0 || isLoading || order == 'asc'"
class="button is-white is-small"
@click="onChangeOrder('asc')"
:aria-label="$i18n.get('label_sort_ascending')">
<span
v-tooltip="{
content: $i18n.get('label_sort_ascending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', 'repository-tooltip']
}"
class="icon gray-icon is-small">
<i class="tainacan-icon tainacan-icon-sortascending tainacan-icon-20px"/>
</span>
</button>
</b-field>
</div>
@ -110,21 +127,44 @@
<ul>
<li
@click="onChangeTab('')"
:class="{ 'is-active': status == undefined || status == ''}">
<a>{{ `${$i18n.get('label_all_collections')}` }}<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalCollections ? `(${Number(repositoryTotalCollections.private) + Number(repositoryTotalCollections.publish)})` : '' }`}` }}</span></a>
:class="{ 'is-active': status == undefined || status == ''}"
v-tooltip="{
content: $i18n.get('info_collections_tab_all'),
autoHide: true,
placement: 'auto',
}">
<a :style="{ fontWeight: 'bold', color: '#454647 !important', lineHeight: '1.5rem' }">
{{ `${$i18n.get('label_all_collections')}` }}
<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalCollections ? `(${Number(repositoryTotalCollections.private) + Number(repositoryTotalCollections.publish)})` : '' }`}` }}</span>
</a>
</li>
<li
@click="onChangeTab('draft')"
:class="{ 'is-active': status == 'draft'}">
<a>{{ `${$i18n.get('label_draft_items')}` }}<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalCollections ? `(${repositoryTotalCollections.draft})` : '' }`}` }}</span></a>
</li>
<li
@click="onChangeTab('trash')"
:class="{ 'is-active': status == 'trash'}">
<a>{{ `${$i18n.get('label_trash_items')}` }}<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalCollections ? `(${repositoryTotalCollections.trash})` : '' }`}` }}</span></a>
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
@click="onChangeTab(statusOption.slug)"
:class="{ 'is-active': status == statusOption.slug}"
:style="{ marginRight: statusOption.slug == 'private' ? 'auto' : '' }"
v-tooltip="{
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.slug,[$i18n.get('collections')]),
autoHide: true,
placement: 'auto',
}">
<a>
<span
v-if="$statusHelper.hasIcon(statusOption.slug)"
class="icon has-text-gray">
<i
class="tainacan-icon tainacan-icon-18px"
:class="$statusHelper.getIcon(statusOption.slug)"
/>
</span>
{{ statusOption.name }}
<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalCollections ? `(${repositoryTotalCollections[statusOption.slug]})` : '' }`}` }}</span>
</a>
</li>
</ul>
</div>
<div>
<collections-list
:is-loading="isLoading"
@ -144,8 +184,12 @@
</span>
</p>
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_collection_created') }}</p>
<p v-if="status == 'draft'">{{ $i18n.get('info_no_collection_draft') }}</p>
<p v-if="status == 'trash'">{{ $i18n.get('info_no_collection_trash') }}</p>
<p
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
v-if="status == statusOption.slug">
{{ $i18n.get('info_no_collections_' + statusOption.slug) }}
</p>
<div v-if="$userCaps.hasCapability('edit_tainacan-collections') && status == undefined || status == ''">
<b-dropdown
@ -435,12 +479,38 @@ export default {
align-items: center;
width: 100%;
.header-item:not(:last-child) {
padding-right: 0.5em;
}
.header-item {
.header-item .button .icon i{
width: 100%;
&:not(:last-child) {
padding-right: 0.5em;
}
.label {
font-size: 0.875rem;
font-weight: normal;
margin-top: 3px;
margin-bottom: 2px;
cursor: default;
}
.button {
display: flex;
align-items: center;
}
.field {
align-items: center;
}
.gray-icon, .gray-icon .icon {
color: $gray4 !important;
padding-right: 10px;
}
.gray-icon .icon i::before,
.gray-icon i::before {
font-size: 1.3125rem !important;
max-width: 26px;
}
}
@media screen and (max-width: 769px) {

View File

@ -156,11 +156,18 @@
<!-- SEARCH CONTROL ------------------------- -->
<div
:aria-label="$i18n.get('label_sort_visualization')"
aria-labelledby="search-control-landmark"
role="region"
ref="search-control"
v-if="!openAdvancedSearch && !(registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen)"
class="search-control">
<h3
id="search-control-landmark"
class="sr-only">
{{ $i18n.get('label_sort_visualization') }}
</h3>
<!-- <b-loading
:is-full-page="false"
:active.sync="isLoadingMetadata"/> -->
@ -283,7 +290,54 @@
<!-- Change OrderBy Select and Order Button-->
<div class="search-control-item">
<b-field>
<label class="label is-hidden-mobile">{{ $i18n.get('label_sorting') + ':' }}</label>
<label class="label">{{ $i18n.get('label_sort') }}</label>
<b-dropdown
:mobile-modal="true"
@input="onChangeOrder()"
aria-role="list">
<button
:aria-label="$i18n.get('label_sorting_direction')"
class="button is-white"
slot="trigger">
<span class="icon is-small gray-icon">
<i
:class="order == 'DESC' ? 'tainacan-icon-sortdescending' : 'tainacan-icon-sortascending'"
class="tainacan-icon"/>
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'DESC' }"
:value="'DESC'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortdescending"/>
</span>
{{ $i18n.get('label_descending') }}
</b-dropdown-item>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'ASC' }"
:value="'ASC'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortascending"/>
</span>
{{ $i18n.get('label_ascending') }}
</b-dropdown-item>
</b-dropdown>
<span
class="label"
style="padding-left: 0.65rem;">
{{ $i18n.get('info_by_inner') }}
</span>
<b-dropdown
:mobile-modal="true"
@input="onChangeOrderBy($event)"
@ -308,60 +362,7 @@
aria-role="listitem">
{{ metadatum.name }}
</b-dropdown-item>
<!-- Once we have sorting by metadata we can use this -->
<!-- <b-dropdown-item
:class="{ 'is-active': orderBy == metadatum.slug }"
v-for="metadatum of sortingMetadata"
v-if="
metadatum.slug === 'creation_date' ||
metadatum.slug === 'author_name' || (
metadatum.id !== undefined &&
metadatum.metadata_type_object &&
metadatum.metadata_type_object.related_mapped_prop !== 'description' &&
metadatum.metadata_type_object.primitive_type !== 'term' &&
metadatum.metadata_type_object.primitive_type !== 'item' &&
metadatum.metadata_type_object.primitive_type !== 'compound'
)"
:value="metadatum"
:key="metadatum.slug">
{{ metadatum.name }}
</b-dropdown-item> -->
</b-dropdown>
<!-- Order ASC vs DESC buttons -->
<button
aria-controls="items-list-results"
class="button is-white is-small"
:aria-label="$i18n.get('label_sort_descending')"
:disabled="totalItems <= 0 || order == 'DESC'"
@click="onChangeOrder()">
<span
v-tooltip="{
content: $i18n.get('label_sort_descending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', isRepositoryLevel ? 'repository-tooltip' : '']
}"
class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-sortdescending"/>
</span>
</button>
<button
aria-controls="items-list-results"
:disabled="totalItems <= 0 || order == 'ASC'"
:aria-label="$i18n.get('label_sort_ascending')"
class="button is-white is-small"
@click="onChangeOrder()">
<span
v-tooltip="{
content: $i18n.get('label_sort_ascending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', isRepositoryLevel ? 'repository-tooltip' : '']
}"
class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-sortascending"/>
</span>
</button>
</b-field>
</div>
@ -615,22 +616,44 @@
<div
v-if="!isOnTheme && !openAdvancedSearch"
class="tabs">
<ul>
<ul>
<li
@click="onChangeTab('')"
:class="{ 'is-active': status == undefined || status == ''}">
<a>{{ `${$i18n.get('label_all_items')}` }}<span class="has-text-gray">&nbsp;{{ collection && collection.total_items ? ` (${Number(collection.total_items.private) + Number(collection.total_items.publish)})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.private + repositoryTotalItems.publish })` : '' }}</span></a>
:class="{ 'is-active': status == undefined || status == ''}"
v-tooltip="{
content: $i18n.get('info_items_tab_all'),
autoHide: true,
placement: 'auto',
}">
<a :style="{ fontWeight: 'bold', color: '#454647 !important', lineHeight: '1.5rem' }">
{{ $i18n.get('label_all_published_items') }}
<span class="has-text-gray">&nbsp;{{ collection && collection.total_items ? ` (${Number(collection.total_items.private) + Number(collection.total_items.publish)})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.private + repositoryTotalItems.publish })` : '' }}</span>
</a>
</li>
<li
@click="onChangeTab('draft')"
:class="{ 'is-active': status == 'draft'}">
<a>{{ `${$i18n.get('label_draft_items')}` }}<span class="has-text-gray">&nbsp;{{ collection && collection.total_items ? ` (${collection.total_items.draft})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.draft })` : '' }}</span></a>
</li>
<li
v-if="!isRepositoryLevel"
@click="onChangeTab('trash')"
:class="{ 'is-active': status == 'trash'}">
<a>{{ `${$i18n.get('label_trash_items')}` }}<span class="has-text-gray">&nbsp;{{ collection && collection.total_items ? ` (${collection.total_items.trash})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.trash })` : '' }}</span></a>
v-for="(statusOption, index) of $statusHelper.getStatuses()"
v-if="(isRepositoryLevel || statusOption.slug != 'private') || (statusOption.slug == 'private' && $userCaps.hasCapability('read_private_tnc_col_' + collectionId + '_items'))"
:key="index"
@click="onChangeTab(statusOption.slug)"
:class="{ 'is-active': status == statusOption.slug}"
:style="{ marginRight: statusOption.slug == 'private' ? 'auto' : '' }"
v-tooltip="{
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.slug,[$i18n.get('items')]),
autoHide: true,
placement: 'auto',
}">
<a>
<span
v-if="$statusHelper.hasIcon(statusOption.slug)"
class="icon has-text-gray">
<i
class="tainacan-icon tainacan-icon-18px"
:class="$statusHelper.getIcon(statusOption.slug)"
/>
</span>
{{ statusOption.name }}
<span class="has-text-gray">&nbsp;{{ collection && collection.total_items ? ` (${collection.total_items[statusOption.slug]})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems[statusOption.slug] })` : '' }}</span>
</a>
</li>
</ul>
</div>
@ -701,7 +724,7 @@
registeredViewModes[viewMode] != undefined &&
registeredViewModes[viewMode].type == 'template'"
v-html="itemsListTemplate"/>
<component
v-if="isOnTheme &&
registeredViewModes[viewMode] != undefined &&
@ -712,7 +735,7 @@
:items="items"
:is-filters-menu-compressed="isFiltersMenuCompressed || openAdvancedSearch "
:total-items="totalItems"
:is-loading="isLoadingItems"
:is-loading="showLoading"
:is="registeredViewModes[viewMode] != undefined ? registeredViewModes[viewMode].component : ''"/>
<!-- Empty Placeholder (only used in Admin) -->
@ -726,8 +749,12 @@
</span>
</p>
<p v-if="status == undefined || status == ''">{{ hasFiltered ? $i18n.get('info_no_item_found_filter') : $i18n.get('info_no_item_created') }}</p>
<p v-if="status == 'draft'">{{ $i18n.get('info_no_item_draft') }}</p>
<p v-if="status == 'trash'">{{ $i18n.get('info_no_item_trash') }}</p>
<p
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
v-if="status == statusOption.slug">
{{ $i18n.get('info_no_items_' + statusOption.slug) }}
</p>
<router-link
v-if="!hasFiltered && (status == undefined || status == '') && !$route.query.iframemode"
@ -963,9 +990,11 @@
this.localDisplayedMetadata = JSON.parse(JSON.stringify(this.displayedMetadata));
},
openAdvancedSearch(newValue){
if(newValue == false){
if (newValue == false){
this.$eventBusSearch.$emit('closeAdvancedSearch');
this.advancedSearchResults = false;
} else {
this.$eventBusSearch.clearAllFilters();
}
}
},
@ -1756,7 +1785,6 @@
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.search-control-item {
@ -1874,6 +1902,14 @@
margin-bottom: 20px;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
@media screen and (min-width: 1024px) {
overflow: visible;
}
li {
cursor: pointer;
}
}
.items-list-area {

View File

@ -20,7 +20,55 @@
<!-- Sorting options ---- -->
<b-field class="header-item">
<label class="label">{{ $i18n.get('label_sorting') + ':' }}</label>
<label class="label">{{ $i18n.get('label_sort') }}</label>
<b-dropdown
:mobile-modal="true"
:disabled="taxonomies.length <= 0 || isLoading"
@input="onChangeOrder(order == 'asc' ? 'desc' : 'asc')"
aria-role="list">
<button
:aria-label="$i18n.get('label_sorting_direction')"
class="button is-white"
slot="trigger">
<span class="icon is-small gray-icon">
<i
:class="order == 'desc' ? 'tainacan-icon-sortdescending' : 'tainacan-icon-sortascending'"
class="tainacan-icon tainacan-icon-18px"/>
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'desc' }"
:value="'desc'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortdescending"/>
</span>
{{ $i18n.get('label_descending') }}
</b-dropdown-item>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'asc' }"
:value="'asc'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortascending"/>
</span>
{{ $i18n.get('label_ascending') }}
</b-dropdown-item>
</b-dropdown>
<span
class="label"
style="padding-left: 0.65rem;">
{{ $i18n.get('info_by_inner') }}
</span>
<b-select
class="sorting-select"
:disabled="taxonomies.length <= 0"
@ -34,36 +82,6 @@
{{ option.label }}
</option>
</b-select>
<button
:disabled="taxonomies.length <= 0 || isLoading || order == 'desc'"
class="button is-white is-small"
@click="onChangeOrder('desc')">
<span
v-tooltip="{
content: $i18n.get('label_sort_descending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', 'repository-tooltip']
}"
class="icon gray-icon is-small">
<i class="tainacan-icon tainacan-icon-sortdescending tainacan-icon-20px"/>
</span>
</button>
<button
:disabled="taxonomies.length <= 0 || isLoading || order == 'asc'"
class="button is-white is-small"
@click="onChangeOrder('asc')">
<span
v-tooltip="{
content: $i18n.get('label_sort_ascending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', 'repository-tooltip']
}"
class="icon gray-icon is-small">
<i class="tainacan-icon tainacan-icon-sortascending tainacan-icon-20px"/>
</span>
</button>
</b-field>
</div>
@ -76,18 +94,40 @@
<ul>
<li
@click="onChangeTab('')"
:class="{ 'is-active': status == undefined || status == ''}">
<a>{{ `${$i18n.get('label_all_taxonomies')}` }}<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalTaxonomies ? `(${Number(repositoryTotalTaxonomies.private) + Number(repositoryTotalTaxonomies.publish)})` : '' }`}` }}</span></a>
:class="{ 'is-active': status == undefined || status == ''}"
v-tooltip="{
content: $i18n.get('info_taxonomies_tab_all'),
autoHide: true,
placement: 'auto',
}">
<a :style="{ fontWeight: 'bold', color: '#454647 !important', lineHeight: '1.5rem' }">
{{ `${$i18n.get('label_all_taxonomies')}` }}
<span class="has-text-gray">&nbsp;{{ repositoryTotalTaxonomies ? `(${Number(repositoryTotalTaxonomies.private) + Number(repositoryTotalTaxonomies.publish)})` : '' }}</span>
</a>
</li>
<li
@click="onChangeTab('draft')"
:class="{ 'is-active': status == 'draft'}">
<a>{{ `${$i18n.get('label_draft_items')}` }}<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalTaxonomies ? `(${repositoryTotalTaxonomies.draft})` : '' }`}` }}</span></a>
</li>
<li
@click="onChangeTab('trash')"
:class="{ 'is-active': status == 'trash'}">
<a>{{ `${$i18n.get('label_trash_items')}` }}<span class="has-text-gray">&nbsp;{{ `${` ${repositoryTotalTaxonomies ? `(${repositoryTotalTaxonomies.trash})` : '' }`}` }}</span></a>
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
@click="onChangeTab(statusOption.slug)"
:class="{ 'is-active': status == statusOption.slug}"
:style="{ marginRight: statusOption.slug == 'private' ? 'auto' : '' }"
v-tooltip="{
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.slug,[$i18n.get('taxonomies')]),
autoHide: true,
placement: 'auto',
}">
<a>
<span
v-if="$statusHelper.hasIcon(statusOption.slug)"
class="icon has-text-gray">
<i
class="tainacan-icon tainacan-icon-18px"
:class="$statusHelper.getIcon(statusOption.slug)"
/>
</span>
{{ statusOption.name }}
<span class="has-text-gray">&nbsp;{{ repositoryTotalTaxonomies ? `(${repositoryTotalTaxonomies[statusOption.slug]})` : '' }}</span>
</a>
</li>
</ul>
</div>
@ -108,8 +148,12 @@
<i class="tainacan-icon tainacan-icon-36px tainacan-icon-terms"/>
</span>
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_taxonomy_created') }}</p>
<p v-if="status == 'draft'">{{ $i18n.get('info_no_taxonomy_draft') }}</p>
<p v-if="status == 'trash'">{{ $i18n.get('info_no_taxonomy_trash') }}</p>
<p
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
v-if="status == statusOption.slug">
{{ $i18n.get('info_no_taxonomies_' + statusOption.slug) }}
</p>
<router-link
v-if="status == undefined || status == ''"
id="button-create-taxonomy"
@ -328,17 +372,38 @@
align-items: center;
width: 100%;
.header-item:not(:last-child) {
padding-right: 0.5em;
}
.header-item {
.header-item .button .icon i{
width: 100%;
}
.header-item .label{
font-weight: normal;
font-size: 0.875rem;
margin-top: 3px;
&:not(:last-child) {
padding-right: 0.5em;
}
.label {
font-size: 0.875rem;
font-weight: normal;
margin-top: 3px;
margin-bottom: 2px;
cursor: default;
}
.button {
display: flex;
align-items: center;
}
.field {
align-items: center;
}
.gray-icon, .gray-icon .icon {
color: $gray4 !important;
padding-right: 10px;
}
.gray-icon .icon i::before,
.gray-icon i::before {
font-size: 1.3125rem !important;
max-width: 26px;
}
}
@media screen and (max-width: 769px) {

View File

@ -267,7 +267,54 @@
<!-- Change OrderBy Select and Order Button-->
<div class="search-control-item">
<b-field>
<label class="label is-hidden-mobile">{{ $i18n.get('label_sorting') + ':' }}</label>
<label class="label">{{ $i18n.get('label_sorting_direction') }}</label>
<b-dropdown
:mobile-modal="true"
@input="onChangeOrder()"
aria-role="list">
<button
:aria-label="$i18n.get('label_sorting_direction')"
class="button is-white"
slot="trigger">
<span class="icon is-small gray-icon">
<i
:class="order == 'DESC' ? 'tainacan-icon-sortdescending' : 'tainacan-icon-sortascending'"
class="tainacan-icon"/>
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'DESC' }"
:value="'DESC'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortdescending"/>
</span>
{{ $i18n.get('label_descending') }}
</b-dropdown-item>
<b-dropdown-item
aria-controls="items-list-results"
role="button"
:class="{ 'is-active': order == 'ASC' }"
:value="'ASC'"
aria-role="listitem"
style="padding-bottom: 0.45rem">
<span class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-sortascending"/>
</span>
{{ $i18n.get('label_ascending') }}
</b-dropdown-item>
</b-dropdown>
<span
class="label"
style="padding-left: 0.65rem;">
{{ $i18n.get('info_by_inner') }}
</span>
<b-dropdown
:mobile-modal="true"
@input="onChangeOrderBy($event)"
@ -278,7 +325,7 @@
slot="trigger">
<span>{{ orderByName }}</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown "/>
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
@ -292,60 +339,7 @@
aria-role="listitem">
{{ metadatum.name }}
</b-dropdown-item>
<!-- Once we have sorting by metadata we can use this -->
<!-- <b-dropdown-item
:class="{ 'is-active': orderBy == metadatum.slug }"
v-for="metadatum of sortingMetadata"
v-if="
metadatum.slug === 'creation_date' ||
metadatum.slug === 'author_name' || (
metadatum.id !== undefined &&
metadatum.metadata_type_object &&
metadatum.metadata_type_object.related_mapped_prop !== 'description' &&
metadatum.metadata_type_object.primitive_type !== 'term' &&
metadatum.metadata_type_object.primitive_type !== 'item' &&
metadatum.metadata_type_object.primitive_type !== 'compound'
)"
:value="metadatum"
:key="metadatum.slug">
{{ metadatum.name }}
</b-dropdown-item> -->
</b-dropdown>
<!-- Order ASC vs DESC buttons -->
<button
aria-controls="items-list-results"
class="button is-white is-small"
:aria-label="$i18n.get('label_sort_descending')"
:disabled="totalItems <= 0 || order == 'DESC'"
@click="onChangeOrder()">
<span
v-tooltip="{
content: $i18n.get('label_sort_descending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', isRepositoryLevel ? 'repository-tooltip' : '']
}"
class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-sortdescending"/>
</span>
</button>
<button
aria-controls="items-list-results"
:disabled="totalItems <= 0 || order == 'ASC'"
:aria-label="$i18n.get('label_sort_ascending')"
class="button is-white is-small"
@click="onChangeOrder()">
<span
v-tooltip="{
content: $i18n.get('label_sort_ascending'),
autoHide: true,
placement: 'bottom',
classes: ['tooltip', isRepositoryLevel ? 'repository-tooltip' : '']
}"
class="icon is-small gray-icon">
<i class="tainacan-icon tainacan-icon-sortascending"/>
</span>
</button>
</b-field>
</div>
@ -603,13 +597,42 @@
<ul>
<li
@click="onChangeTab('')"
:class="{ 'is-active': status == undefined || status == ''}"><a>{{ $i18n.get('label_all_items') }}</a></li>
:class="{ 'is-active': status == undefined || status == ''}"
v-tooltip="{
content: $i18n.get('info_items_tab_all'),
autoHide: true,
placement: 'auto',
}">
<a :style="{ fontWeight: 'bold', color: '#454647 !important', lineHeight: '1.5rem' }">
{{ $i18n.get('label_all_published_items') }}
<span class="has-text-gray">&nbsp;{{ collection && collection.total_items ? ` (${Number(collection.total_items.private) + Number(collection.total_items.publish)})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems.private + repositoryTotalItems.publish })` : '' }}</span>
</a>
</li>
<li
@click="onChangeTab('draft')"
:class="{ 'is-active': status == 'draft'}"><a>{{ $i18n.get('label_draft_items') }}</a></li>
<li
@click="onChangeTab('trash')"
:class="{ 'is-active': status == 'trash'}"><a>{{ $i18n.get('label_trash_items') }}</a></li>
v-for="(statusOption, index) of $statusHelper.getStatuses()"
v-if="(isRepositoryLevel || statusOption.slug != 'private') || (statusOption.slug == 'private' && $userCaps.hasCapability('read_private_tnc_col_' + collectionId + '_items'))"
:key="index"
@click="onChangeTab(statusOption.slug)"
:class="{ 'is-active': status == statusOption.slug}"
:style="{ marginRight: statusOption.slug == 'private' ? 'auto' : '' }"
v-tooltip="{
content: $i18n.getWithVariables('info_%s_tab_' + statusOption.slug,[$i18n.get('items')]),
autoHide: true,
placement: 'auto',
}">
<a>
<span
v-if="$statusHelper.hasIcon(statusOption.slug)"
class="icon has-text-gray">
<i
class="tainacan-icon tainacan-icon-18px"
:class="$statusHelper.getIcon(statusOption.slug)"
/>
</span>
{{ statusOption.name }}
<span class="has-text-gray">&nbsp;{{ collection && collection.total_items ? ` (${collection.total_items[statusOption.slug]})` : (isRepositoryLevel && repositoryTotalItems) ? ` (${ repositoryTotalItems[statusOption.slug] })` : '' }}</span>
</a>
</li>
</ul>
</div>
@ -689,7 +712,7 @@
:items="items"
:is-filters-menu-compressed="isFiltersMenuCompressed"
:total-items="totalItems"
:is-loading="isLoadingItems"
:is-loading="showLoading"
:is="registeredViewModes[viewMode] != undefined ? registeredViewModes[viewMode].component : ''"/>
<!-- Empty Placeholder (only used in Admin) -->
@ -703,8 +726,12 @@
</span>
</p>
<p v-if="status == undefined || status == ''">{{ hasFiltered ? $i18n.get('info_no_item_found_filter') : $i18n.get('info_no_item_created') }}</p>
<p v-if="status == 'draft'">{{ $i18n.get('info_no_item_draft') }}</p>
<p v-if="status == 'trash'">{{ $i18n.get('info_no_item_trash') }}</p>
<p
v-for="(statusOption, index) of $statusHelper.getStatuses()"
:key="index"
v-if="status == statusOption.slug">
{{ $i18n.get('info_no_items_' + statusOption.slug) }}
</p>
<router-link
v-if="!hasFiltered && (status == undefined || status == '')"
@ -918,9 +945,11 @@
this.localDisplayedMetadata = JSON.parse(JSON.stringify(this.displayedMetadata));
},
openAdvancedSearch(newValue){
if(newValue == false){
if (newValue == false){
this.$eventBusSearch.$emit('closeAdvancedSearch');
this.advancedSearchResults = false;
} else {
this.$eventBusSearch.clearAllFilters();
}
}
},

View File

@ -15,7 +15,7 @@
<script>
import TainacanCollectionSubheader from '../../components/navigation/tainacan-collection-subheader.vue';
import { mapActions } from 'vuex';
import { mapActions, mapGetters } from 'vuex';
export default {
name: 'CollectionPage',
@ -31,6 +31,9 @@ export default {
methods: {
...mapActions('collection', [
'fetchCollectionUserCanEdit'
]),
...mapGetters('collection', [
'getCollection'
])
},
created(){
@ -38,9 +41,14 @@ export default {
this.$eventBusSearch.setCollectionId(this.collectionId);
},
mounted() {
this.fetchCollectionUserCanEdit(this.collectionId).then((caps) => {
this.currentUserCanEdit = caps;
}).catch((error) => this.$console.error(error));
let storedCollection = this.getCollection();
if (storedCollection != undefined && storedCollection.id == this.collectionId && storedCollection.currentUserCanEdit != undefined)
this.currentUserCanEdit = storedCollection.currentUserCanEdit;
else {
this.fetchCollectionUserCanEdit(this.collectionId).then((caps) => {
this.currentUserCanEdit = caps;
}).catch((error) => this.$console.error(error));
}
}
}
</script>

View File

@ -7,9 +7,11 @@
<div class="tainacan-page-title">
<h1>
<span
v-if="(item != null && item != undefined && item.status != undefined && !isLoading)"
class="status-tag">{{ $i18n.get(item.status) }}</span>
<span
v-if="(item != null && item != undefined && item.status != undefined && !isLoading)"
class="status-tag">
{{ $i18n.get('status_' + item.status) }}
</span>
{{ $i18n.get('title_item_page') + ' ' }}
<span style="font-weight: 600;">{{ (item != null && item != undefined) ? item.title : '' }}</span>
</h1>
@ -337,6 +339,13 @@
</div>
<div class="footer">
<div class="form-submission-footer">
<router-link
v-if="item.current_user_can_edit && $route.query.recent == true"
class="button is-secondary"
style="margin-right: auto;"
:to="{ path: $routerHelper.getNewItemPath(collectionId)}">
{{ $i18n.get('label_create_another_item') }}
</router-link>
<router-link
v-if="item.current_user_can_edit"
class="button is-secondary"
@ -467,7 +476,12 @@
});
// Obtains Item
this.fetchItem({ itemId: this.itemId, contextEdit: true }).then((item) => {
this.fetchItem({
itemId: this.itemId,
contextEdit: true,
fetchOnly: 'title,thumbnail,status,modification_date,document_type,document,comment_status,document_as_html'
})
.then((item) => {
this.$root.$emit('onCollectionBreadCrumbUpdate', [
{path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items')},
{path: '', label: item.title}
@ -510,7 +524,7 @@
.tainacan-page-title {
padding: 0 $page-side-padding;
margin-bottom: 40px;
margin-bottom: 35px;
display: flex;
flex-wrap: wrap;
align-items: flex-end;

View File

@ -7,6 +7,9 @@
color: $secondary;
align-items: center;
}
.gray-icon {
padding-right: 0 !important;
}
}
.button.is-primary, .button.is-secondary, .button.is-success {
.icon {
@ -19,14 +22,18 @@
}
.dropdown-menu {
padding: 0px;
margin-top: 0;
border-radius: 0px;
min-width: 6rem;
border: none;
.dropdown-content {
padding: 0px;
border-radius: 0px !important;
max-height: 240px;
overflow-y: auto;
box-shadow: none;
border: 1px solid $gray3;
.dropdown-item {
display: block;
@ -80,6 +87,19 @@
max-height: unset !important;
}
}
.taginput-container .mdi-magnify::before,
.autocomplete .mdi-magnify::before {
content: 'search';
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: inherit;
text-rendering: auto;
vertical-align: middle;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 20px;
}
.taginput-container {
padding: 0px !important;
@ -90,6 +110,9 @@
}
.autocomplete .icon {
height: 2.2em !important;
.mdi-magnify::before {
margin-top: -3px;
}
}
.input {
margin-bottom: 0px !important;

View File

@ -53,6 +53,7 @@
border-radius: 0px;
background-color: white;
padding: 40px $page-side-padding;
padding: 40px 4.166666667vw;
position: relative;
overflow-y: auto;
overflow-x: hidden;

View File

@ -7,8 +7,10 @@
}
input[type="radio"] + .check::before {
background: black !important;
width: 7px !important;
height: 7px !important;
width: 15px !important;
height: 15px !important;
margin-left: calc(-16px/2) !important;
margin-bottom: calc(-16px/2) !important;
}
&:focus input[type="radio"] + .check,
&:active input[type="radio"] + .check,

View File

@ -50,6 +50,14 @@
.button.is-outlined {
color: $blue5 !important;
}
.b-numberinput {
button.is-primary,
button.is-primary:hover,
button.is-primary:focus,
button.is-primary:active {
color: $blue5 !important;
}
}
.tabs {
li.is-active a {
border-bottom-color: $blue5;
@ -81,7 +89,21 @@
.dropdown-menu .dropdown-content {
.dropdown-item.is-active { background-color: $blue2; }
}
.datepicker {
.datepicker-header a>span>i:before {
color: $blue5 !important;
}
.datepicker-table {
.datepicker-cell.is-today,
.datepicker-cell.is-today:hover {
background-color: $blue1 !important;
}
.datepicker-cell.is-selected,
.datepicker-cell.is-selected:hover {
background-color: $blue5 !important;
}
}
}
.switch {
&:hover input[type="checkbox"]:checked + .check {
background-color: $blue2;

View File

@ -49,7 +49,52 @@
background-color: $red1;
}
}
.control{
.b-numberinput {
height: 30px;
.control {
margin-right: 0 !important;
}
div.control {
flex-shrink: 1;
order: -1;
}
button,
input {
height: 30px !important;
}
button.is-primary,
button.is-primary:hover,
button.is-primary:focus,
button.is-primary:active {
border: 1px solid $gray2;
background-color: $gray1 !important;
color: $secondary !important;
padding: 0 0.6rem !important;
border-radius: 0 !important;
.mdi::before {
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: inherit;
text-rendering: auto;
vertical-align: middle;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transform: none !important;
font-size: 20px;
margin-top: -2px;
}
.mdi-plus::before {
content: "plus" !important;
}
.mdi-minus::before {
content: "minus" !important;
}
}
}
.control {
&.has-icons-right {
.icon {
height: 2.0em;

View File

@ -74,6 +74,7 @@
width: 100%;
height: auto;
transition: height 0.2s ease;
display: block;
}
img:not(.skeleton) {
visibility: hidden;

View File

@ -134,6 +134,10 @@
color: $gray4;
}
& span:last-of-type>.metadata-value {
margin-bottom: 0px;
}
}
}

View File

@ -31,12 +31,12 @@
@import "../scss/_iframe_read_mode_overrides.scss";
// Clears wordpress content
body.tainacan-admin-page #adminmenumain, body.tainacan-admin-page #wpfooter, body.tainacan-admin-page #wp-auth-check-wrap {
display: none;
}
html {
overflow-y: hidden;
}
body.tainacan-admin-page #adminmenumain, body.tainacan-admin-page #wpfooter, body.tainacan-admin-page #wp-auth-check-wrap {
display: none;
}
#tainacan-admin-app {
background: #ffffff;
position: fixed;
@ -51,6 +51,21 @@ html {
font-family: $family-sans-serif;
}
// Scrollbars
#tainacan-admin-app * {
// For Firefox
scrollbar-color: $gray3 transparent;
scrollbar-width: thin;
// For Chromium and related
&::-webkit-scrollbar {
width: 0.4rem;
}
&::-webkit-scrollbar-thumb {
background-color: $gray3;
}
}
// Tainacan Loading
.tainacan-icon {
opacity: 0; // Will make it 1 once window.load is done;

View File

@ -1,11 +1,11 @@
@import "../../../node_modules/bulma/sass/utilities/_all.sass"
@import "../../../node_modules/bulma/sass/base/helpers.sass"
@import "../../../node_modules/bulma/sass/elements/form.sass"
@import "../../../node_modules/bulma/sass/form/_all.sass"
@import "../../../node_modules/bulma/sass/components/pagination.sass"
@import "../../../node_modules/bulma/sass/elements/icon.sass"
@import "../../../node_modules/bulma/sass/elements/tag.sass"
@import "../../../node_modules/bulma/sass/components/tabs.sass"
@import "../../../node_modules/bulma/sass/elements/button.sass"
@import "../../../node_modules/bulma/sass/grid/columns.sass"
@import "../../../node_modules/bulma/sass/components/dropdown.sass"
@import "../../../node_modules/bulma/sass/components/modal.sass"
@import "../../../node_modules/bulma/sass/components/breadcrumb.sass"

View File

@ -2,7 +2,7 @@
return apply_filters( 'tainacan-admin-i18n', [
// Advanced search comparators
// Comparators
'is_equal_to' => __( 'Equal', 'tainacan' ),
'is_not_equal_to' => __( 'Not equal', 'tainacan' ),
'contains' => __( 'Contains', 'tainacan' ),
@ -11,6 +11,10 @@ return apply_filters( 'tainacan-admin-i18n', [
'less_than' => __( 'Less than', 'tainacan' ),
'greater_than_or_equal_to' => __( 'Greater than or equal to', 'tainacan' ),
'less_than_or_equal_to' => __( 'Less than or equal to', 'tainacan' ),
'before' => __( 'Before', 'tainacan' ),
'after' => __( 'After', 'tainacan' ),
'before_or_on_day' => __( 'Before (inclusive)', 'tainacan' ),
'after_or_on_day' => __( 'After (inclusive)', 'tainacan' ),
// Tainacan common terms
'repository' => __( 'Repository', 'tainacan' ),
@ -82,14 +86,14 @@ return apply_filters( 'tainacan-admin-i18n', [
'delete' => __( 'Delete', 'tainacan' ),
// Wordpress Status
'publish' => __( 'Publish', 'tainacan' ),
'public' => __( 'Public', 'tainacan' ),
'draft' => __( 'Draft', 'tainacan' ),
'private' => __( 'Private', 'tainacan' ),
'trash' => __( 'Trash', 'tainacan' ),
'auto-draft' => __( 'Automatic Draft', 'tainacan' ),
'publish_visibility' => __( 'Visible to everyone', 'tainacan' ),
'private_visibility' => __( 'Visible only for editors', 'tainacan' ),
'status_publish' => __( 'Publish', 'tainacan' ),
'status_public' => __( 'Public', 'tainacan' ),
'status_draft' => __( 'Draft', 'tainacan' ),
'status_private' => __( 'Private', 'tainacan' ),
'status_trash' => __( 'Trash', 'tainacan' ),
'status_auto-draft' => __( 'Automatic Draft', 'tainacan' ),
'publish_visibility' => __( 'Public (Visible to everyone)', 'tainacan' ),
'private_visibility' => __( 'Private (Visible only for editors)', 'tainacan' ),
// Page Titles (used mainly on Router)
'title_repository_collections_page' => __( 'Repository Collections', 'tainacan' ),
@ -213,6 +217,8 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_core_title' => __( 'Core Title', 'tainacan' ),
'label_core_description' => __( 'Core Description', 'tainacan' ),
'label_sorting' => __( 'Sorting', 'tainacan' ),
'label_sorting_direction' => __( 'Sorting direction', 'tainacan' ),
'label_sort' => __( 'Sort', 'tainacan' ),
'label_activity_date' => __( 'Activity date', 'tainacan' ),
'label_activity_title' => __( 'Activity', 'tainacan' ),
'label_header_image' => __( 'Header Image', 'tainacan' ),
@ -235,11 +241,9 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_expand_all' => __( 'Expand all', 'tainacan' ),
'label_collapse_all' => __( 'Collapse all', 'tainacan' ),
'label_view_term' => __( 'View Term', 'tainacan' ),
'label_all_items' => __( 'All items', 'tainacan' ),
'label_all_published_items' => __( 'All published items', 'tainacan' ),
'label_all_collections' => __( 'All collections', 'tainacan' ),
'label_all_taxonomies' => __( 'All taxonomies', 'tainacan' ),
'label_draft_items' => __( 'Draft', 'tainacan' ),
'label_trash_items' => __( 'Trash', 'tainacan' ),
'label_bulk_actions' => __( 'Bulk actions', 'tainacan' ),
'label_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),
'label_edit_selected_collections' => __( 'Edit selected collections', 'tainacan' ),
@ -366,8 +370,8 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_no_output_info' => __( 'No output info', 'tainacan' ),
'label_output' => __( 'Output', 'tainacan' ),
'label_no_mapping' => __( 'No mapping', 'tainacan' ),
'label_sort_descending' => __( 'Sort descending', 'tainacan' ),
'label_sort_ascending' => __( 'Sort ascending', 'tainacan' ),
'label_descending' => __( 'Descending', 'tainacan' ),
'label_ascending' => __( 'Ascending', 'tainacan' ),
'label_slideshow' => __( 'Slideshow', 'tainacan' ),
'label_items_list' => __( 'Items List', 'tainacan' ),
'label_list_pagination' => __( 'List pagination', 'tainacan' ),
@ -404,7 +408,14 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_previous_group_slides' => __( 'Previous group of slides', 'tainacan' ),
'label_plugin_home_page' => __( 'Plugin home page', 'tainacan' ),
'label_wordpress_admin_page' => __( 'WordPress Admin Page', 'tainacan' ),
'label_view_all_%s_collections' => __( 'View all %s collections', 'tainacan' ),
'label_view_collections_list' => __( 'View collections list', 'tainacan' ),
'label_comparator' => __( 'Comparator', 'tainacan' ),
'label_table_of_items' => __( 'Table of Items', 'tainacan' ),
'label_duplicate_item' => __( 'Duplicate item', 'tainacan' ),
'label_create_another_item' => __( 'Create another item', 'tainacan' ),
'label_recent_collections' => __( 'Recent Collections', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),
'instruction_delete_selected_items' => __( 'Delete selected items', 'tainacan' ),
@ -448,24 +459,53 @@ return apply_filters( 'tainacan-admin-i18n', [
'instruction_click_or_drag_metadatum_create' => __( 'Click or drag and drop to create a new metadatum', 'tainacan' ),
'instruction_drag_and_drop_filter_sort' => __( 'Drag and drop to change filter order', 'tainacan' ),
'instruction_drag_and_drop_metadatum_sort' => __( 'Drag and drop to change metadatum order', 'tainacan' ),
'instruction_select_a_date' => __( 'Select a date', 'tainacan' ),
// Info. Other feedback to user.
'info_items_tab_all' => __( 'Every published item, including those visible only to editors.', 'tainacan' ),
'info_items_tab_publish' => __( 'Only items that are visible to everyone.', 'tainacan' ),
'info_items_tab_private' => __( 'Items visible only to editors.', 'tainacan' ),
'info_items_tab_draft' => __( 'Draft items, not published.', 'tainacan' ),
'info_items_tab_trash' => __( 'Items that were sent to trash.', 'tainacan' ),
'info_collections_tab_all' => __( 'Every published collection, including those visible only to editors.', 'tainacan' ),
'info_collections_tab_publish' => __( 'Only collections that are visible to everyone.', 'tainacan' ),
'info_collections_tab_private' => __( 'Collections visible only to editors.', 'tainacan' ),
'info_collections_tab_draft' => __( 'Draft collections, not published.', 'tainacan' ),
'info_collections_tab_trash' => __( 'Collections that were sent to trash.', 'tainacan' ),
'info_taxonomies_tab_all' => __( 'Every published taxonomy, including those visible only to editors.', 'tainacan' ),
'info_taxonomies_tab_publish' => __( 'Only taxonomies that are visible to everyone.', 'tainacan' ),
'info_taxonomies_tab_private' => __( 'Taxonomies visible only to editors.', 'tainacan' ),
'info_taxonomies_tab_draft' => __( 'Draft taxonomies, not published.', 'tainacan' ),
'info_taxonomies_tab_trash' => __( 'Taxonomies that were sent to trash.', 'tainacan' ),
'info_error_invalid_date' => __( 'Invalid date', 'tainacan' ),
'info_search_results' => __( 'Search Results', 'tainacan' ),
'info_search_criteria' => __( 'Search Criteria', 'tainacan' ),
'info_name_is_required' => __( 'Name is required.', 'tainacan' ),
'info_no_collection_created' => __( 'No collection was created in this repository.', 'tainacan' ),
'info_no_collection_draft' => __( 'No draft collection found.', 'tainacan' ),
'info_no_collection_trash' => __( 'No collection in trash.', 'tainacan' ),
'info_no_taxonomy_draft' => __( 'No draft taxonomy found.', 'tainacan' ),
'info_no_taxonomy_trash' => __( 'No taxonomy in trash.', 'tainacan' ),
'info_no_items_publish' => __( 'No public items found.', 'tainacan' ),
'info_no_items_private' => __( 'No private items found.', 'tainacan' ),
'info_no_items_draft' => __( 'No draft items found.', 'tainacan' ),
'info_no_items_trash' => __( 'No items found on trash.', 'tainacan' ),
'info_no_collections_publish' => __( 'No public collections found.', 'tainacan' ),
'info_no_collections_private' => __( 'No private collections found.', 'tainacan' ),
'info_no_collections_draft' => __( 'No draft collections found.', 'tainacan' ),
'info_no_collections_trash' => __( 'No collections found on trash.', 'tainacan' ),
'info_no_taxonomies_publish' => __( 'No public taxonomies found.', 'tainacan' ),
'info_no_taxonomies_private' => __( 'No private taxonomies found.', 'tainacan' ),
'info_no_taxonomies_draft' => __( 'No draft taxonomies found.', 'tainacan' ),
'info_no_taxonomies_trash' => __( 'No taxonomies found on trash.', 'tainacan' ),
'info_no_taxonomy_created' => __( 'No taxonomy was created in this repository.', 'tainacan' ),
'info_no_terms_created_on_taxonomy' => __( 'No term was created for this taxonomy.', 'tainacan' ),
'info_no_terms_found' => __( 'No term was found here', 'tainacan' ),
'info_no_more_terms_found' => __( 'No more terms found', 'tainacan' ),
'info_no_item_created' => __( 'No item was created in this collection.', 'tainacan' ),
'info_no_item_draft' => __( 'No draft item found.', 'tainacan' ),
'info_no_item_trash' => __( 'No item in trash.', 'tainacan' ),
'info_no_page_found' => __( 'No page was found with this name.', 'tainacan' ),
'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ),
'info_no_item_found_filter' => __( 'No item was found here with these filters.', 'tainacan' ),
@ -474,6 +514,8 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_no_moderator_on_collection' => __( "This collection doesn't have any moderator yet.", 'tainacan' ),
'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ),
'info_error_deleting_taxonomy' => __( 'Error on deleting taxonomy', 'tainacan' ),
'info_error_first_value_greater' => __( 'First value should be lower than second value', 'tainacan' ),
'info_error_value_must_be_number' => __( 'Value should be a number', 'tainacan' ),
'info_collection_deleted' => __( 'Collection deleted.', 'tainacan' ),
'info_item_deleted' => __( 'Item deleted.', 'tainacan' ),
'info_taxonomy_deleted' => __( 'Taxonomy deleted', 'tainacan' ),
@ -564,9 +606,8 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_no_options_avialable_filtering' => __( 'No options for this filtering.', 'tainacan' ),
'info_no_options_found' => __( 'No options found.', 'tainacan' ),
'info_all_files_uploaded' => __( 'All files uploaded.', 'tainacan' ),
'info_there_are_%s_items_being_edited' => __( 'There are %s items being edited', 'tainacan' ),
'info_there_is_one_item_being_edited' => __( 'There is one item being edited', 'tainacan' ),
'info_item_being_edited' => __( 'item being edited', 'tainacan' ),
'info_there_are_%s_items_being_edited' => __( 'There are %s items being edited;', 'tainacan' ),
'info_there_is_one_item_being_edited' => __( 'There is one item being edited.', 'tainacan' ),
'info_no_preview_found' => __( 'No preview was found.', 'tainacan' ),
'info_leaving_bulk_edition' => __( 'You are leaving the bulk edition now.', 'tainacan' ),
'info_current_view_mode_metadata_not_allowed' => __( 'Current view mode does not allow displayed metadata selection.', 'tainacan' ),
@ -597,12 +638,30 @@ return apply_filters( 'tainacan-admin-i18n', [
// Tainacan Filter Types
'tainacan-filter-custom-interval' => __( 'Custom Interval', 'tainacan' ),
'tainacan-filter-numeric' => __( 'Numeric', 'tainacan' ),
'tainacan-filter-date' => __( 'Date', 'tainacan' ),
'tainacan-filter-selectbox' => __( 'Select Box', 'tainacan' ),
'tainacan-filter-autocomplete' => __( 'Autocomplete', 'tainacan' ),
'tainacan-filter-taginput' => __( 'Tag Input', 'tainacan' ),
'tainacan-filter-checkbox' => __( 'Check Box', 'tainacan' ),
'tainacan-filter-taxonomy-taginput' => __( 'Taxonomy Tag Input', 'tainacan' ),
'tainacan-filter-taxonomy-checkbox' => __( 'Taxonomy Check Box', 'tainacan' ),
'tainacan-filter-taxonomy-selectbox' => __( 'Taxonomy Select Box', 'tainacan' )
'tainacan-filter-taxonomy-selectbox' => __( 'Taxonomy Select Box', 'tainacan' ),
// Datepicker week days
/* translators: This refers to the short label that will appear on datepickers for Sunday */
'datepicker_short_sunday' => __( 'Su', 'tainacan' ),
/* translators: This refers to the short label that will appear on datepickers for Monday */
'datepicker_short_monday' => __( 'M', 'tainacan' ),
/* translators: This refers to the short label that will appear on datepickers for Tuesday */
'datepicker_short_tuesday' => __( 'Tu', 'tainacan' ),
/* translators: This refers to the short label that will appear on datepickers for Wednesday */
'datepicker_short_wednesday' => __( 'W', 'tainacan' ),
/* translators: This refers to the short label that will appear on datepickers for Thursday */
'datepicker_short_thursday' => __( 'Th', 'tainacan' ),
/* translators: This refers to the short label that will appear on datepickers for Friday */
'datepicker_short_friday' => __( 'F', 'tainacan' ),
/* translators: This refers to the short label that will appear on datepickers for Saturday */
'datepicker_short_saturday' => __( 'Sa', 'tainacan' )
] );
?>

View File

@ -22,6 +22,7 @@
export default {
name: "ThemeItemsList",
created() {
this.$statusHelper.loadStatuses();
this.$userPrefs.init();
}
}
@ -36,8 +37,8 @@ export default {
@import "./scss/theme-basics.sass";
// Buefy imports
@import "../../node_modules/buefy/src/scss/components/_datepicker.scss";
@import "../../node_modules/buefy/src/scss/utils/_all.scss";
@import "../../node_modules/buefy/src/scss/components/_datepicker.scss";
@import "../../node_modules/buefy/src/scss/components/_checkbox.scss";
@import "../../node_modules/buefy/src/scss/components/_radio.scss";
@import "../../node_modules/buefy/src/scss/components/_tag.scss";
@ -45,6 +46,7 @@ export default {
@import "../../node_modules/buefy/src/scss/components/_dropdown.scss";
@import "../../node_modules/buefy/src/scss/components/_modal.scss";
@import "../../node_modules/buefy/src/scss/components/_notices.scss";
@import "../../node_modules/buefy/src/scss/components/_numberinput.scss";
// Tainacan imports
@import "../admin/scss/_tables.scss";
@ -150,9 +152,6 @@ export default {
top: 5px;
}
}
.filter-item-forms .datepicker .dropdown-content {
max-width: 100% !important;
}
}
.search-control {

View File

@ -357,13 +357,20 @@ class REST_Collections_Controller extends REST_Controller {
* @return string|\WP_Error|\WP_REST_Response
*/
public function delete_item( $request ) {
$collection_id = $request['collection_id'];
$permanently = $request['permanently'];
$collection = $this->collections_repository->fetch($request['collection_id']);
if(! $collection instanceof Entities\Collection) {
return new \WP_REST_Response([
'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id
], 400);
}
if($permanently == true) {
$collection = $this->collections_repository->delete($collection_id);
$collection = $this->collections_repository->delete($collection);
} else {
$collection = $this->collections_repository->trash($collection_id);
$collection = $this->collections_repository->trash($collection);
}
$prepared_collection = $this->prepare_item_for_response($collection, $request);

View File

@ -63,6 +63,7 @@ class REST_Facets_Controller extends REST_Controller {
$metadatum = $this->metadatum_repository->fetch($metadatum_id);
$metadatum_type = $metadatum->get_metadata_type();
$metadatum_type_object = $metadatum->get_metadata_type_object();
$offset = null;
$number = null;
@ -130,6 +131,25 @@ class REST_Facets_Controller extends REST_Controller {
$all_values = $this->metadatum_repository->fetch_all_metadatum_values( $metadatum_id, $args );
if (isset($request['context']) && $request['context'] == 'extended') {
if ($metadatum_type_object->get_repository() instanceof \Tainacan\Repositories\Repository) {
$all_values['values'] = array_map(function($val) use($metadatum_type_object) {
$second_arg = [];
if (isset($val['taxonomy'])) {
$second_arg = $val['taxonomy'];
}
$entity = $metadatum_type_object->get_repository()->fetch( (int) $val['value'], $second_arg );
if ($entity) {
$val['entity'] = $entity->_toArray();
}
return $val;
}, $all_values['values']);
}
}
$response = [
'values' => $all_values['values'],
'last_term' => $all_values['last_term']

View File

@ -136,25 +136,25 @@ class REST_Filters_Controller extends REST_Controller {
$metadatum_id = $request['metadatum_id'];
$filter_obj->set_collection_id( $collection_id );
$filter_obj->set_metadatum( $metadatum_id );
$filter_obj->set_metadatum_id( $metadatum_id );
} elseif (isset($request['collection_id'])){
$collection_id = $request['collection_id'];
$filter_obj->set_collection_id( $collection_id );
if(!isset($body['metadatum'])){
if(!isset($body['metadatum_id'])){
throw new \InvalidArgumentException('You need provide a metadatum id');
}
$filter_obj->set_metadatum($body['metadatum']);
$filter_obj->set_metadatum_id($body['metadatum_id']);
} else {
$filter_obj->set_collection_id( 'filter_in_repository' );
if(!isset($body['metadatum'])){
if(!isset($body['metadatum_id'])){
throw new \InvalidArgumentException('You need provide a metadatum id');
}
$filter_obj->set_metadatum($body['metadatum']);
$filter_obj->set_metadatum_id($body['metadatum_id']);
}
$filter_obj->set_filter_type($filter_type);
@ -223,13 +223,21 @@ class REST_Filters_Controller extends REST_Controller {
* @return \WP_Error|\WP_REST_Response
*/
public function delete_item( $request ) {
$filter_id = $request['filter_id'];
$permanently = $request['permanently'];
$filter = $this->filter_repository->fetch($request['filter_id']);
if (! $filter instanceof Entities\Filter) {
return new \WP_REST_Response([
'error_message' => __('A filter with this ID was not found', 'tainacan' ),
'filter_id' => $filter_id
], 400);
}
if($permanently == true) {
$filter = $this->filter_repository->delete($filter_id);
$filter = $this->filter_repository->delete($filter);
} else {
$filter = $this->filter_repository->trash($filter_id);
$filter = $this->filter_repository->trash($filter);
}
return new \WP_REST_Response($this->prepare_item_for_response($filter, $request), 200);
@ -421,7 +429,14 @@ class REST_Filters_Controller extends REST_Controller {
$filter_id = $request['filter_id'];
$filter = $this->filter_repository->fetch($filter_id);
if(! $filter instanceof Entities\Filter) {
return new \WP_REST_Response([
'error_message' => __('A filter with this ID was not found', 'tainacan' ),
'filter_id' => $filter_id
], 400);
}
return new \WP_REST_Response($this->prepare_item_for_response($filter, $request), 200);
}

View File

@ -123,6 +123,7 @@ class REST_Items_Controller extends REST_Controller {
$item_array['metadata'][ $slug ]['value'] = $item_metadata_array['value'];
$item_array['metadata'][ $slug ]['value_as_html'] = $item_metadata_array['value_as_html'];
$item_array['metadata'][ $slug ]['value_as_string'] = $item_metadata_array['value_as_string'];
$item_array['metadata'][ $slug ]['semantic_uri'] = $item_metadata_array['metadatum']['semantic_uri'];
$item_array['metadata'][ $slug ]['multiple'] = $metadatum->get_multiple();
$item_array['metadata'][ $slug ]['mapping'] = $metadatum->get_exposer_mapping();
@ -215,7 +216,11 @@ class REST_Items_Controller extends REST_Controller {
}
// \error_log("DEBUG-1:");
// \error_log(\json_encode($item_arr));
$item_arr = apply_filters('tainacan-api-items-prepare-for-response', $item_arr, $item, $request);
// \error_log("DEBUG-2:");
// \error_log(\json_encode($item_arr));
return $item_arr;
}
@ -232,7 +237,14 @@ class REST_Items_Controller extends REST_Controller {
$item_id = $request['item_id'];
$item = $this->items_repository->fetch($item_id);
if (! $item instanceof Entities\Item) {
return new \WP_REST_Response([
'error_message' => __('An item with this ID was not found', 'tainacan' ),
'item_id' => $item_id
], 400);
}
$response = $this->prepare_item_for_response($item, $request);
return new \WP_REST_Response(apply_filters('tainacan-rest-response', $response, $request), 200);
@ -508,11 +520,20 @@ class REST_Items_Controller extends REST_Controller {
public function delete_item( $request ) {
$item_id = $request['item_id'];
$permanently = $request['permanently'];
$item = $this->items_repository->fetch($request['item_id']);
if (! $item instanceof Entities\Item) {
return new \WP_REST_Response([
'error_message' => __('An item with this ID was not found', 'tainacan' ),
'item_id' => $item_id
], 400);
}
if($permanently == true) {
$item = $this->items_repository->delete($item_id);
$item = $this->items_repository->delete($item);
} else {
$item = $this->items_repository->trash($item_id);
$item = $this->items_repository->trash($item);
}
$prepared_item = $this->prepare_item_for_response($item, $request);

View File

@ -137,6 +137,13 @@ class REST_Metadata_Controller extends REST_Controller {
}
$result = $this->metadatum_repository->fetch($metadatum_id, 'OBJECT');
if (! $result instanceof Entities\Metadatum) {
return new \WP_REST_Response([
'error_message' => __('Metadata with this ID was not found', 'tainacan'),
'item_id' => $item_id
], 400);
}
return new \WP_REST_Response($this->prepare_item_for_response($result, $request), 200);
}
@ -288,9 +295,10 @@ class REST_Metadata_Controller extends REST_Controller {
$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'])){
$taxonomy = new Entities\Taxonomy($item_arr['metadata_type_options']['taxonomy_id']);
$item_arr['metadata_type_options']['taxonomy'] = $taxonomy->get_db_identifier();
$taxonomy = Repositories\Taxonomies::get_instance()->get_db_identifier_by_id( $item_arr['metadata_type_options']['taxonomy_id'] );
//$taxonomy = new Entities\Taxonomy($item_arr['metadata_type_options']['taxonomy_id']);
//$item_arr['metadata_type_options']['taxonomy'] = $taxonomy->get_db_identifier();
$item_arr['metadata_type_options']['taxonomy'] = $taxonomy;
}
if($request['context'] === 'edit'){
@ -384,8 +392,17 @@ class REST_Metadata_Controller extends REST_Controller {
*/
public function delete_item( $request ) {
$metadatum_id = $request['metadatum_id'];
$metadatum_trashed = $this->metadatum_repository->trash($metadatum_id);
$metadatum = $this->metadatum_repository->fetch($metadatum_id);
if (! $metadatum instanceof Entities\Metadatum) {
return new \WP_REST_Response([
'error_message' => __('Metadata with this ID was not found', 'tainacan'),
'item_id' => $item_id
], 400);
}
$metadatum_trashed = $this->metadatum_repository->trash($metadatum);
$prepared = $this->prepare_item_for_response($metadatum_trashed, $request);

View File

@ -182,7 +182,14 @@ class REST_Taxonomies_Controller extends REST_Controller {
$taxonomy_id = $request['taxonomy_id'];
$taxonomy = $this->taxonomy_repository->fetch($taxonomy_id);
if (! $taxonomy instanceof Entities\Taxonomy) {
return new \WP_REST_Response([
'error_message' => __('A taxonomy with this ID was not found', 'tainacan' ),
'taxonomy_id' => $taxonomy_id
], 400);
}
$taxonomy_prepared = $this->prepare_item_for_response($taxonomy, $request);
return new \WP_REST_Response($taxonomy_prepared, 200);
@ -218,11 +225,20 @@ class REST_Taxonomies_Controller extends REST_Controller {
public function delete_item( $request ) {
$taxonomy_id = $request['taxonomy_id'];
$permanently = $request['permanently'];
$taxonomy = $this->taxonomy_repository->fetch($taxonomy_id);
if (! $taxonomy instanceof Entities\Taxonomy) {
return new \WP_REST_Response([
'error_message' => __('A taxonomy with this ID was not found', 'tainacan' ),
'taxonomy_id' => $taxonomy_id
], 400);
}
if($permanently == true){
$deleted = $this->taxonomy_repository->delete($taxonomy_id);
$deleted = $this->taxonomy_repository->delete($taxonomy);
} else {
$deleted = $this->taxonomy_repository->trash($taxonomy_id);
$deleted = $this->taxonomy_repository->trash($taxonomy);
}
if ( $deleted instanceof \WP_Error ) {

View File

@ -149,19 +149,20 @@ class REST_Terms_Controller extends REST_Controller {
public function delete_item( $request ) {
$term_id = $request['term_id'];
$taxonomy_id = $request['taxonomy_id'];
$taxonomy = $this->taxonomy_repository->fetch($taxonomy_id);
$taxonomy = $this->taxonomy_repository->fetch( $taxonomy_id );
$taxonomy_name = $taxonomy->get_db_identifier();
if(!$taxonomy_name){
$term = $this->terms_repository->fetch($term_id, $taxonomy);
if ( ! $term instanceof Entities\Term ) {
return new \WP_REST_Response([
'error_message' => 'The ID of taxonomy may be incorrect.'
]);
'error_message' => __('A term with this ID was not found', 'tainacan' ),
'taxonomy_id' => $taxonomy_id,
'term_id' => $term_id
], 400);
}
$delete_args = ['term_id' => $term_id, 'taxonomy' => $taxonomy_name];
$is_deleted = $this->terms_repository->delete($delete_args);
$is_deleted = $this->terms_repository->delete($term);
return new \WP_REST_Response($is_deleted, 200);
}
@ -375,6 +376,14 @@ class REST_Terms_Controller extends REST_Controller {
$taxonomy = $this->taxonomy_repository->fetch($tax_id);
$term = $this->terms_repository->fetch($term_id, $taxonomy);
if ( ! $term instanceof Entities\Term ) {
return new \WP_REST_Response([
'error_message' => __('A term with this ID was not found', 'tainacan' ),
'taxonomy_id' => $tax_id,
'term_id' => $term_id
], 400);
}
return new \WP_REST_Response($this->prepare_item_for_response($term, $request), 200);
}

View File

@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<metadata>
Created by FontForge 20170910 at Thu Apr 11 17:41:05 2019
Created by FontForge 20170910 at Wed May 22 19:09:21 2019
By Jimmy Wärting
</metadata>
<defs>
@ -15,7 +15,7 @@ Created by FontForge 20170910 at Thu Apr 11 17:41:05 2019
panose-1="0 0 0 0 0 0 0 0 0 0"
ascent="750"
descent="-250"
bbox="42 -208 958 708"
bbox="42 -209 958 708"
underline-thickness="50"
underline-position="-125"
unicode-range="U+000D-2421"
@ -51,10 +51,10 @@ t-39.5 27t-48.5 10t-48.5 -10t-39.5 -27t-27 -39.5t-10 -48.5t10 -48.5t27 -39.5t39.
<glyph glyph-name="uni21B8" unicode="home"
d="M208 -125v333h-125l417 375l417 -375h-125v-333h-209v250h-166v-250h-209z" />
<glyph glyph-name="tour" unicode="tour"
d="M792 668q35 0 59 -24.5t24 -59.5v-583q0 -35 -24 -59.5t-59 -24.5h-167l-125 -125l-125 125h-167q-35 0 -59 24.5t-24 59.5v583q0 35 24 59.5t59 24.5h584zM542 84h-84v-83h84v83zM628 324q18 18 28.5 42t10.5 52q0 35 -13 65t-36 52.5t-53 35.5t-65 13q-34 0 -64.5 -13
t-53.5 -35.5t-36 -52.5t-13 -65h84q0 34 24 58.5t59 24.5t59 -24.5t24 -58.5q0 -35 -24 -59l-52 -53q-23 -23 -36 -53t-13 -65v-20h84q0 23 3.5 40t9.5 30.5t15 24.5t20 22z" />
d="M125 583q0 35 24 59.5t59 24.5h584q35 0 59 -24.5t24 -59.5v-583q0 -35 -24 -59t-59 -24h-167l-125 -125l-125 125h-167q-35 0 -59 24t-24 59v583zM410 0l90 -90l90 90h202v583h-584v-583h202zM333 375q0 35 13 65t36 53t53.5 36t64.5 13q35 0 65 -13t53 -36t36 -53
t13 -65q0 -39 -19.5 -63.5t-43 -45t-43 -42.5t-19.5 -57h-84q0 34 9.5 56.5t23 39t30 28t30 23.5t23 26t9.5 35q0 35 -24 59t-59 24t-59 -24t-24 -59h-84zM458 125h84v-83h-84v83z" />
<glyph glyph-name="processes" unicode="processes"
d="M542 458h-126v-291h-83v291h-125l167 167zM792 42l-167 -167l-167 167h126v291h83v-291h125z" />
d="M458 42h126v291h83v-291h125l-167 -167zM375 625l167 -167h-126v-291h-83v291h-125z" />
<glyph glyph-name="help" unicode="help"
d="M458 83h84v-83h-84v83zM500 666q86 0 162 -32.5t132.5 -89t89.5 -132.5t33 -162t-33 -162t-89.5 -132.5t-132.5 -89.5t-162 -33t-162 33t-132.5 89.5t-89.5 132.5t-33 162t33 162t89.5 132.5t132.5 89t162 32.5zM500 -84q69 0 129.5 26.5t106 71.5t71.5 106t26 130
t-26 129.5t-71.5 105.5t-106 71.5t-129.5 26.5t-129.5 -26.5t-106 -71.5t-71.5 -105.5t-26 -129.5t26 -130t71.5 -106t106 -71.5t129.5 -26.5zM500 500q35 0 65 -13t53 -36t36 -53t13 -65q0 -39 -19.5 -63.5t-43 -45t-43 -42.5t-19.5 -57h-84q0 34 9.5 56.5t23 39t30 28
@ -95,9 +95,9 @@ t24 -59.5t59 -24.5zM625 500q0 27 -9.5 49.5t-26.5 39.5t-39.5 26.5t-49.5 9.5t-49.5
d="M709 417h-417v-84h417v84zM709 250h-417v-83h417v83zM583 83h-291v-83h291v83zM500 584q-17 0 -29.5 -12.5t-12.5 -29.5t12.5 -29.5t29.5 -12.5t29.5 12.5t12.5 29.5t-12.5 29.5t-29.5 12.5zM792 584q35 0 59 -24.5t24 -59.5v-584q0 -35 -24 -59t-59 -24h-584
q-35 0 -59 24t-24 59v584q0 35 24 59.5t59 24.5h174q14 36 45.5 59.5t72.5 23.5t72.5 -23.5t45.5 -59.5h174z" />
<glyph glyph-name="download" unicode="download"
d="M208 1h584v-84h-584v84zM500 84l-292 292h167v250h250v-250h167z" />
d="M375 376v250h250v-250h167l-292 -292l-292 292h167zM208 1h584v-84h-584v84z" />
<glyph glyph-name="upload" unicode="upload"
d="M792 500h-584v84h584v-84zM500 417l292 -292h-167v-250h-250v250h-167z" />
d="M208 125l292 292l292 -292h-167v-250h-250v250h-167zM792 584v-84h-584v84h584z" />
<glyph glyph-name="playfill" unicode="playfill"
d="M500 667q86 0 162 -33t132.5 -89.5t89.5 -132.5t33 -162t-33 -162t-89.5 -132.5t-132.5 -89.5t-162 -33t-162 33t-132.5 89.5t-89.5 132.5t-33 162t33 162t89.5 132.5t132.5 89.5t162 33zM667 250l-250 188v-376z" />
<glyph glyph-name="play" unicode="play"
@ -130,7 +130,7 @@ d="M542 0h-84v84h84v-84zM542 500v-334h-84v334h84z" />
d="M500 667q87 0 163 -32.5t132.5 -89t89 -132.5t32.5 -163t-32.5 -163t-89 -132.5t-132.5 -89t-163 -32.5t-163 32.5t-132.5 89t-89 132.5t-32.5 163t32.5 163t89 132.5t132.5 89t163 32.5zM559 250l150 150l-59 59l-150 -150l-150 150l-59 -59l150 -150l-150 -150l59 -59
l150 150l150 -150l59 59z" />
<glyph glyph-name="repproved" unicode="repproved"
d="M559 251l233 -233l-59 -59l-233 233l-233 -233l-59 59l233 233l-233 233l59 59l233 -233l233 233l59 -59z" />
d="M208 484l59 59l233 -233l233 233l59 -59l-233 -233l233 -233l-59 -59l-233 233l-233 -233l-59 59l233 233z" />
<glyph glyph-name="arrowleft" unicode="arrowleft"
d="M584 42l-209 209l209 209v-418z" />
<glyph glyph-name="arrowright" unicode="arrowright"
@ -168,7 +168,7 @@ t20 29.5t7.5 36v0q0 19 -7.5 36t-20 29.5t-29.5 20t-36 7.5v0z" />
<glyph glyph-name="notifications" unicode="notifications"
d="M500 -167q-35 0 -59 24.5t-24 58.5h166q0 -34 -24 -58.5t-59 -24.5zM833 0v-42h-666v42l83 83v208q0 48 12.5 91t36.5 78t59 59.5t80 34.5v28q0 26 18 44.5t44 18.5t44 -18.5t18 -44.5v-28q45 -10 80 -34.5t59 -59.5t36.5 -78t12.5 -91v-208zM667 291q0 39 -11.5 73
t-33 59.5t-52.5 40t-70 14.5t-70 -14.5t-52 -40t-32.5 -59.5t-11.5 -73v-250h333v250z" />
<glyph glyph-name="more" unicode="more"
<glyph glyph-name="plus" unicode="plus"
d="M792 209h-250v-250h-84v250h-250v84h250v250h84v-250h250v-84z" />
<glyph glyph-name="menu" unicode="menu"
d="M125 83h750v-83h-750v83zM125 292h750v-84h-750v84zM875 500v-83h-750v83h750z" />
@ -188,13 +188,13 @@ d="M459 666h-375v-499h375v499zM917 -167h-375v500h375v-500zM459 -167h-375v250h375
<glyph glyph-name="viewgallery" unicode="viewgallery"
d="M917 418h-167v-334h167v334zM250 84h-167v334h167v-334zM667 -41h-334v584h334v-584z" />
<glyph glyph-name="sortasc" unicode="sortasc"
d="M667 417h-166v83h166v-83zM792 167h-291v83h291v-83zM917 -83h-416v84h416v-84zM251 625l-166 -167h125v-541h83v541h125z" />
d="M85 457l166 167l167 -167h-125v-541h-83v541h-125zM917 416h-416v83h416v-83zM792 166h-291v83h291v-83zM501 -84v84h166v-84h-166z" />
<glyph glyph-name="sortdesc" unicode="sortdesc"
d="M667 416h-167v84h167v-84zM792 166h-292v84h292v-84zM917 -84h-417v83h417v-83zM292 -1v542h-84v-542h-125l167 -166l167 166h-125z" />
d="M208 0v542h84v-542h125l-167 -166l-167 166h125zM500 417v84h417v-84h-417zM792 251v-84h-292v84h292zM500 -83v83h167v-83h-167z" />
<glyph glyph-name="viewrecords" unicode="viewrecords"
d="M333 543h-208v-584h208v584zM625 -41h-208v584h208v-584zM917 -41h-208v584h208v-584z" />
<glyph glyph-name="close" unicode="close"
d="M559 251l233 -233l-59 -59l-233 233l-233 -233l-59 59l233 233l-233 233l59 59l233 -233l233 233l59 -59z" />
d="M208 484l59 59l233 -233l233 233l59 -59l-233 -233l233 -233l-59 -59l-233 233l-233 -233l-59 59l233 233z" />
<glyph glyph-name="heartoutline" unicode="heartoutline"
d="M504 -23q75 68 135.5 124.5t103.5 107t66.5 96.5t23.5 91q0 31 -11 58t-30.5 46.5t-46 30.5t-57.5 11q-24 0 -47.5 -7.5t-43 -20.5t-35 -31.5t-23.5 -39.5h-78q-8 21 -23.5 39.5t-35 31.5t-42.5 20.5t-47 7.5q-31 0 -58 -11t-46.5 -30.5t-30.5 -46.5t-11 -58
q0 -45 23.5 -91t66.5 -96.5t103.5 -107t134.5 -124.5l5 -4zM688 625q48 0 90 -17.5t72.5 -48.5t48.5 -73t18 -90q0 -59 -25.5 -114t-72.5 -112t-112.5 -119.5t-146.5 -135.5l-60 -55l-60 55q-81 73 -146.5 135.5t-112.5 119.5t-72.5 112t-25.5 114q0 48 18 90t49 73t73 48.5
@ -238,6 +238,38 @@ d="M936 500q-37 -56 -89 -93v-23q0 -89 -33.5 -179.5t-98 -164t-159.5 -119.5t-218 -
q18 -9 38.5 -14.5t42.5 -5.5q-36 23 -57.5 62t-21.5 86q0 24 6.5 46.5t17.5 42.5q66 -81 161 -131t207 -55q-4 17 -4 41q0 37 14 69.5t38 56.5t56.5 38t69.5 14q80 0 131 -56q31 6 59.5 17t54.5 26q-22 -65 -79 -99q27 4 53 11t50 18z" />
<glyph glyph-name="facebook" unicode="facebook"
d="M707 668v-167h-83q-22 0 -32 -20.5t-10 -41.5v-105h125v-166h-125v-334h-166v334h-125v166h125v167q0 35 13 65t35.5 53t53 36t64.5 13h125z" />
<glyph glyph-name="item" unicode="item"
d="M542 625l250 -250v-417q0 -35 -24.5 -59t-59.5 -24h-417q-35 0 -59 24t-24 59l1 584q0 34 24 58.5t59 24.5h250zM500 333h229l-229 229v-229z" />
<glyph glyph-name="dincol" unicode="dincol"
d="M457 85q1 -6 1 -11.5v-11.5q0 -16 -1.5 -31t-6.5 -30h301v84h-294zM167 502v-219q-47 -12 -84 -43v262h84zM834 542q34 0 58.5 -24.5t24.5 -59.5v-249q0 -35 -24.5 -59.5t-58.5 -24.5h-385q-9 34 -28 63t-45 50.5t-58 35.5t-68 17l1 251q0 35 24 59t59 24h208l83 -83h209
zM351 -18q5 8 10 19q14 28 14 61q0 6 -0.5 11.5t-1.5 11.5q-2 11 -5 21t-8 19q-18 39 -53.5 61t-77.5 22q-31 0 -62 -13q-34 -17 -56.5 -48t-26.5 -70q-1 -1 0 -2q-1 -5 -1 -13q0 -30 11.5 -56.5t31.5 -46.5t46.5 -31.5t56.5 -11.5q23 0 43 6.5t37 17.5l24 -23v-1l84 -83
l41 42zM229 0q-26 0 -44.5 18t-18.5 44t18.5 44.5t44.5 18.5t44.5 -18.5t18.5 -44.5t-18.5 -44t-44.5 -18z" />
<glyph glyph-name="dinitems" unicode="dinitems"
d="M610 669v-87h-307v-318q-31 9 -66 9h-11t-11 -1v310q0 36 26 61.5t62 25.5h307zM917 231v-351q0 -36 -25.5 -62t-62.5 -26h-306l43 43l-106 105q18 42 18 92q0 57 -23.5 105t-63.5 81v188q0 36 25.5 62t61.5 26h176zM806 231l-196 197v-197h196zM478 -165l-44 -44
l-113 113q-18 -12 -39.5 -19t-44.5 -7q-32 0 -60 12t-49 33t-33 49t-12 60t12.5 60t33.5 49t49 33t59 12q32 0 60 -12t49 -33t33 -49t12 -60q0 -23 -7 -44.5t-19 -39.5zM303 32q0 27 -19.5 46.5t-46.5 19.5q-6 0 -11.5 -1t-10.5 -3q-19 -7 -31.5 -23.5t-12.5 -38.5
q0 -27 19.5 -46.5t46.5 -19.5t46.5 19.5t19.5 46.5z" />
<glyph glyph-name="dinterms" unicode="dinterms"
d="M893 183l-88 -100q-15 -20 -37 -30.5t-47 -10.5h-264q1 5 1 10v10q0 45 -16 85t-44 70.5t-66 49.5t-82 23v59q0 23 8.5 43t23 34.5t34.5 23t42 8.5h363q25 0 47 -10.5t37 -30.5l88 -99q24 -30 24 -68t-24 -67zM166 627q-34 0 -58.5 -24t-24.5 -59v-305q36 30 83 44v261
h501v83h-501zM458 -125l-41 -42l-84 83v1l-24 23q-17 -11 -37 -17.5t-43 -6.5q-30 0 -57 11.5t-46.5 31.5t-31 46.5t-11.5 56.5t11.5 57t31 46.5t46.5 31t57 11.5h10.5t10.5 -2q27 -4 49.5 -16.5t39.5 -32t26.5 -44t9.5 -51.5q0 -22 -6.5 -42.5t-17.5 -37.5l23 -24h1z
M292 62q0 26 -18.5 44.5t-44.5 18.5t-44.5 -18.5t-18.5 -44.5t18.5 -44t44.5 -18t44.5 18t18.5 44z" />
<glyph glyph-name="slideritems" unicode="slideritems"
d="M769 250l-186 188v-188h186zM875 250v-333q0 -35 -24.5 -59.5t-59.5 -24.5h-334q-16 0 -30 6q14 26 22.5 56.5t8.5 63.5q0 56 -23 104t-61 82l1 272q0 35 24 59t59 24h166zM291 667h292v-83h-292v-389q-40 14 -84 14v375q0 34 24.5 58.5t59.5 24.5zM42 -41l125 124v-250z
M375 -42l-125 -124v249z" />
<glyph glyph-name="sliderterms" unicode="sliderterms"
d="M893 97l-88 -100q-15 -20 -37 -30.5t-47 -10.5h-219q0 51 -20 96.5t-54 79.5t-79.5 53.5t-96.5 19.5h-2v58q0 23 8.5 42.5t23.5 34.5t34.5 23.5t41.5 8.5h363q25 0 47 -10.5t37 -30.5l88 -99q24 -30 24 -68t-24 -67zM167 541q-35 0 -59 -24.5t-24 -58.5v-318q37 34 83 50
v268h500v83h-500zM292 83v-250l125 125zM209 -167l-1 250l-125 -125z" />
<glyph glyph-name="slidercol" unicode="slidercol"
d="M485 45q15 -39 15 -84h250v84h-265zM167 463v-266q-47 -16 -84 -50v316h84zM834 502q34 0 58.5 -24t24.5 -59v-250q0 -35 -24.5 -59.5t-58.5 -24.5h-367q-32 57 -89.5 91.5t-127.5 34.5v291q0 35 24.5 59.5t58.5 24.5h209l83 -84h209zM417 -39l-125 -125v250zM83 -39
l125 125l1 -253z" />
<glyph glyph-name="instagram" unicode="instagram"
d="M325 667h350q50 0 94 -19t77 -52t52 -77t19 -94v-350q0 -50 -19 -94t-52 -77t-77 -52t-94 -19h-350q-50 0 -94 19t-77 52t-52 77t-19 94v350q0 50 19 94t52 77t77 52t94 19zM317 584q-31 0 -58.5 -12t-48 -32.5t-32.5 -48t-12 -58.5v-366q0 -31 12 -58.5t32.5 -48
t48 -32.5t58.5 -12h366q31 0 58.5 12t48 32.5t32.5 48t12 58.5v366q0 31 -12 58.5t-32.5 48t-48 32.5t-58.5 12h-366zM719 521q22 0 37 -15t15 -37t-15 -37t-37 -15t-37 15t-15 37t15 37t37 15zM500 458q43 0 81 -16.5t66.5 -44.5t45 -66t16.5 -81t-16.5 -81t-45 -66.5
t-66.5 -45t-81 -16.5t-81 16.5t-66 45t-44.5 66.5t-16.5 81t16.5 81t44.5 66t66 44.5t81 16.5zM500 375q-26 0 -48.5 -10t-39.5 -27t-27 -39.5t-10 -48.5t10 -48.5t27 -39.5t39.5 -27t48.5 -10t48.5 10t39.5 27t27 39.5t10 48.5t-10 48.5t-27 39.5t-39.5 27t-48.5 10z" />
<glyph glyph-name="youtube" unicode="youtube"
d="M417 125l216 125l-216 125v-250zM910 372q2 -25 3 -46.5t1 -40.5l3 -35q0 -69 -5 -119t-14 -82q-15 -57 -72 -72q-18 -6 -53 -9t-74 -4.5t-75.5 -2t-57.5 -0.5l-66 -3q-132 0 -213 5t-113 14q-57 15 -72 72q-5 15 -8 37t-5 45t-2.5 45.5t-0.5 38.5l-3 35q0 69 5 119
t14 82q15 57 72 72q18 6 53 9t74 4.5t75.5 2t57.5 0.5l66 3q132 0 213 -5t113 -14q27 -7 43 -22.5t24.5 -36.5t12 -44.5t4.5 -47.5z" />
<glyph glyph-name="minus" unicode="minus"
d="M789 208h-584v84h584v-84z" />
<glyph glyph-name=".notdef" horiz-adv-x="500"
/>
<glyph glyph-name="uni0000" horiz-adv-x="0"

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

View File

@ -147,8 +147,11 @@
.tainacan-icon-metadata:before {
content: "metadata";
}
.tainacan-icon-more:before {
content: "more";
.tainacan-icon-plus:before {
content: "plus";
}
.tainacan-icon-minus:before {
content: "minus";
}
.tainacan-icon-showmore:before {
content: "showmore";
@ -279,6 +282,27 @@
.tainacan-icon-twitter:before {
content: "twitter";
}
.tainacan-icon-youtube:before {
content: "facebook";
}
.tainacan-icon-slidercol:before {
content: "slidercol";
}
.tainacan-icon-slideritems:before {
content: "slideritems";
}
.tainacan-icon-sliderterms:before {
content: "sliderterms";
}
.tainacan-icon-dincol:before {
content: "dincol";
}
.tainacan-icon-dinitems:before {
content: "dinitems";
}
.tainacan-icon-dinterms:before {
content: "dinterms";
}
.tainacan-icon-18px.tainacan-icon-set,
.tainacan-icon-18px.tainacan-icon:before {

View File

@ -72,6 +72,9 @@
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0;

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,iBAAiB;EACxB,UAAU,EAAE,OAAO;EAEnB,gBAAE;IACE,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,OAAO;IAEb,oBAAI;MACA,GAAG,EAAE,GAAG;MACR,YAAY,EAAE,OAAO;MACrB,QAAQ,EAAE,QAAQ;MAClB,IAAI,EAAE,OAAO;;AAIzB,mCAAoC;EAChC,SAAS,EAAE,mBAAmB;EAC9B,UAAU,EAAE,IAAI;EAChB,IAAI,EAAE,OAAO;EAEb,uCAAI;IACA,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,GAAG;IACR,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,OAAO;;AAKrB,wBAAyB;EACrB,KAAK,EAAE,GAAG;EAEV,0C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gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss"],
"names": [],
"file": "tainacan-gutenberg-block-collections-list.css"

View File

@ -72,6 +72,9 @@
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0;
@ -179,7 +182,7 @@
display: flex;
width: 100%;
align-items: stretch;
text-decoration: none; }
text-decoration: none !important; }
.wp-block-tainacan-dynamic-items-list .dynamic-items-collection-header:hover {
text-decoration: none; }
.wp-block-tainacan-dynamic-items-list .dynamic-items-collection-header .collection-name {
@ -268,6 +271,7 @@
border-color: #dbdbdb !important; } }
.wp-block-tainacan-dynamic-items-list .dynamic-items-search-bar button {
margin-right: 0.75rem;
padding: 0 0.35rem;
min-height: 28px;
z-index: 2;
border: none;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,484 @@
.block-control {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px;
position: relative;
top: -14px;
left: -14px;
width: calc(100% + 28px);
background: #f2f2f2; }
.block-control p {
font-size: 0.875rem !important;
margin: 12px 1.5rem 16px 0;
fill: #555758; }
.block-control p svg {
top: 4px;
margin-right: 0.75rem;
position: relative;
fill: #555758; }
.components-placeholder__fieldset p {
font-size: 0.875rem !important;
margin-top: -2px;
fill: #555758; }
.components-placeholder__fieldset p svg {
margin-right: 1rem;
top: 4px;
position: relative;
fill: #555758; }
.wp-block-tainacan-modal {
width: 50%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal {
width: 75%; } }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-modal {
width: 100%; } }
.wp-block-tainacan-modal.dynamic-modal {
width: 90%;
height: 90%;
width: 80vw;
height: 80vh; }
.wp-block-tainacan-modal.dynamic-modal iframe {
width: calc(100% + 32px);
height: calc(100% - 128px);
margin-left: -16px; }
.wp-block-tainacan-modal.dynamic-modal .modal-footer-area {
height: 68px;
width: calc(100% + 32px);
margin-left: -16px !important;
padding: 1.2rem 1.2rem !important;
border-top: 1px solid #cbcbcb; }
.wp-block-tainacan-modal .spinner-container {
min-height: 56px;
padding: 1rem;
display: flex;
justify-content: center;
align-items: center;
color: #555758; }
.wp-block-tainacan-modal .spinner-container .components-spineer {
margin: 8px; }
.wp-block-tainacan-modal .modal-search-area {
display: flex;
justify-content: center;
margin-bottom: 24px; }
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 60%; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-modal .modal-search-area .components-base-control {
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0;
display: -ms-grid;
display: grid;
grid-template-columns: repeat(auto-fill, 250px);
grid-gap: 0px;
justify-content: space-evenly;
list-style-type: none;
margin: 12px;
max-height: 50vh;
overflow-y: auto; }
.wp-block-tainacan-modal .modal-checkbox-list .components-base-control,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-base-control {
overflow: hidden; }
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option {
display: flex;
justify-content: flex-start; }
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item img,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option img,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item img,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option img {
width: 24px;
height: 24px;
margin-right: 10px; }
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option label {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inline-block;
max-width: 85%; }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-modal .modal-checkbox-list .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-checkbox-list .components-radio-control__option label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .modal-checkbox-list-item label,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field .components-radio-control__option label {
max-width: 80%; } }
.wp-block-tainacan-modal .modal-loadmore-section {
display: flex;
align-items: baseline;
justify-content: center; }
.wp-block-tainacan-modal .modal-loadmore-section p {
color: #555758;
margin-right: 12px;
margin-top: 2px; }
.wp-block-tainacan-modal .modal-footer-area {
border-top: 1px solid #e2e4e7;
display: flex;
align-items: baseline;
justify-content: space-between;
padding: 16px 16px 0 16px;
margin: 0 -16px; }
.wp-block-tainacan-facets-list {
margin: 2rem 0px; }
.wp-block-tainacan-facets-list .spinner-container {
min-height: 56px;
padding: 1rem;
display: flex;
justify-content: center;
align-items: center;
color: #555758; }
@-webkit-keyframes skeleton-animation {
0% {
opacity: 1.0; }
50% {
opacity: 0.2; }
100% {
opacity: 1.0; } }
@-moz-keyframes skeleton-animation {
0% {
opacity: 1.0; }
50% {
opacity: 0.2; }
100% {
opacity: 1.0; } }
@-o-keyframes skeleton-animation {
0% {
opacity: 1.0; }
50% {
opacity: 0.2; }
100% {
opacity: 1.0; } }
@keyframes skeleton-animation {
0% {
opacity: 1.0; }
50% {
opacity: 0.2; }
100% {
opacity: 1.0; } }
.wp-block-tainacan-facets-list .skeleton {
border-radius: 2px;
background: #f2f2f2;
-webkit-animation: skeleton-animation 1.8s ease infinite;
-moz-animation: skeleton-animation 1.8s ease infinite;
-o-animation: skeleton-animation 1.8s ease infinite;
animation: skeleton-animation 1.8s ease infinite; }
.wp-block-tainacan-facets-list .facets-collection-header {
display: flex;
width: 100%;
align-items: stretch;
text-decoration: none !important; }
.wp-block-tainacan-facets-list .facets-collection-header:hover {
text-decoration: none; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name {
width: auto;
min-width: 350px;
flex-grow: 1;
padding: 1rem 100px 1rem 1rem;
text-align: right;
line-height: 1.5rem;
min-height: 165px;
display: flex;
justify-content: flex-end;
align-items: center;
background-color: #454647; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name h3 {
color: white;
text-decoration: none;
font-size: 1.3rem; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name h3:hover {
text-decoration: none; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name span.label {
font-weight: normal;
font-size: 1rem; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name.only-collection-name {
justify-content: center;
padding: 1rem; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name.only-collection-name h3 {
text-align: center;
font-size: 1.75rem; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-thumbnail {
height: 145px;
width: 145px;
background-size: cover;
background-position: center;
border-radius: 80px;
border: 4px solid white;
margin: 10px;
flex-shrink: 0;
position: relative;
margin-left: -155px;
left: 82px;
background-color: #dbdbdb; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-header-image {
width: auto;
min-width: 150px;
min-height: 165px;
flex-grow: 2;
background-size: cover;
background-position: center;
background-color: #dbdbdb; }
@media only screen and (max-width: 1024px) {
.wp-block-tainacan-facets-list .facets-collection-header {
flex-wrap: wrap-reverse; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name {
width: 100% !important;
min-width: 100% !important;
justify-content: center !important;
text-align: center !important;
padding: 64px 1rem 0rem 1rem; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-name h3 {
margin-bottom: 1rem; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-thumbnail {
left: calc(-50% + 78px) !important;
top: -78px !important; }
.wp-block-tainacan-facets-list .facets-collection-header .collection-header-image {
background-color: transparent; } }
.wp-block-tainacan-facets-list .facets-search-bar {
width: 100%;
display: flex;
align-items: center;
border-bottom: 1px solid #cbcbcb;
padding: 1.00rem 0.5rem 0.75rem 0.5rem; }
@media only screen and (max-width: 768px) {
.wp-block-tainacan-facets-list .facets-search-bar {
flex-wrap: wrap; }
.wp-block-tainacan-facets-list .facets-search-bar .search-button {
order: 4;
position: absolute;
margin-top: 37px; }
.wp-block-tainacan-facets-list .facets-search-bar input {
width: 100% !important;
order: 5;
margin-top: 8px;
margin-left: 0px !important;
padding-left: 4px !important;
border-color: #dbdbdb !important; } }
.wp-block-tainacan-facets-list .facets-search-bar button {
margin-right: 0.75rem;
padding: 0 0.35rem;
min-height: 28px;
z-index: 2;
border: none;
background: transparent;
cursor: pointer; }
.wp-block-tainacan-facets-list .facets-search-bar button svg {
fill: #cbcbcb;
transition: fill 0.4s ease; }
.wp-block-tainacan-facets-list .facets-search-bar button:hover svg {
fill: #545758; }
.wp-block-tainacan-facets-list .facets-search-bar button:focus, .wp-block-tainacan-facets-list .facets-search-bar button:active {
border: none;
box-shadow: none; }
.wp-block-tainacan-facets-list .facets-search-bar button.sorting-button-selected svg {
fill: #545758; }
.wp-block-tainacan-facets-list .facets-search-bar button.next-button {
margin-right: 0rem;
padding: 0; }
.wp-block-tainacan-facets-list .facets-search-bar button.next-button svg {
fill: #298596; }
.wp-block-tainacan-facets-list .facets-search-bar button.previous-button {
margin-left: auto;
margin-right: 1rem;
padding: 0; }
.wp-block-tainacan-facets-list .facets-search-bar button.previous-button svg {
fill: #298596; }
.wp-block-tainacan-facets-list .facets-search-bar button[disabled] svg {
fill: #f2f2f2;
cursor: not-allowed; }
.wp-block-tainacan-facets-list .facets-search-bar input {
height: 32px;
width: 20%;
border-radius: 0;
margin-left: -52px;
padding-left: 52px;
border: 1px solid white;
transition: border-color 0.7s ease, width 0.5s ease-in; }
.wp-block-tainacan-facets-list .facets-search-bar input:focus, .wp-block-tainacan-facets-list .facets-search-bar input:active, .wp-block-tainacan-facets-list .facets-search-bar input:hover {
width: 100%;
border: 1px solid #cbcbcb;
box-shadow: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid {
padding: 0;
display: -ms-grid;
display: grid;
grid-template-columns: repeat(auto-fill, 220px);
grid-gap: 0px;
justify-content: space-evenly;
list-style-type: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item {
position: relative;
display: block;
margin: 12px;
width: 185px; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item a {
color: #454647;
font-weight: bold;
line-height: normal; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item img {
height: auto;
width: 185px;
min-width: 185px;
padding: 0px;
margin-bottom: 0.5rem; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item span.facet-item-count,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item span.facet-item-count {
color: #cbcbcb; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item.facet-without-image img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item.facet-without-image img {
display: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item:hover a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item:hover a {
color: #454647;
text-decoration: none; }
.wp-block-tainacan-facets-list ul.facets-list-edit li.facet-list-item {
display: flex;
align-items: flex-start; }
.wp-block-tainacan-facets-list ul.facets-list-edit li.facet-list-item button {
position: absolute !important;
background-color: rgba(255, 255, 255, 0.75);
color: #454647;
padding: 2px;
margin-left: 5px;
min-width: 14px;
visibility: hidden;
position: relative;
opacity: 0;
right: -14px;
top: 0px;
justify-content: center;
z-index: 999; }
.wp-block-tainacan-facets-list ul.facets-list-edit li.facet-list-item:hover button {
visibility: visible;
background-color: white !important;
opacity: 1;
right: -8px;
top: -8px;
border: 1px solid #cbcbcb;
border-radius: 12px;
transition: opacity linear 0.15s, right linear 0.15s; }
.wp-block-tainacan-facets-list ul.facets-list-edit li.facet-list-item:hover button:hover {
background-color: white !important;
border: 1px solid #cbcbcb !important; }
@media only screen and (max-width: 498px) {
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid {
grid-template-columns: repeat(auto-fill, 100%); }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item {
width: 100%; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-grid li.facet-list-item img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-grid li.facet-list-item img {
width: 100%; } }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list {
padding: 0;
display: block;
list-style-type: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item {
position: relative;
display: inline-block;
margin: 12px;
min-height: 24px;
min-width: 22%;
width: 22%; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item a {
color: #454647;
display: flex;
align-items: center;
height: 54px; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item img {
height: auto;
width: 54px;
min-width: 54px;
padding: 0px;
margin-right: 20px; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item.facet-without-image,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item.facet-without-image {
min-height: 0.875rem; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item.facet-without-image a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item.facet-without-image a {
height: 0.875rem; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item.facet-without-image img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item.facet-without-image img {
display: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item span.facet-item-count,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item span.facet-item-count {
color: #cbcbcb; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-list li.facet-list-item:hover a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-list li.facet-list-item:hover a {
color: #454647;
text-decoration: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud {
padding: 0;
display: block;
list-style-type: none;
text-align: center; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item {
position: relative;
display: inline-block;
margin: 5px 12px;
line-height: normal;
vertical-align: middle; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item a {
color: #454647;
display: flex;
align-items: center;
height: 54px; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item img {
height: auto;
width: 54px;
min-width: 54px;
padding: 0px;
margin-right: 20px; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item.facet-without-image img,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item.facet-without-image img {
display: none; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item span.facet-item-count,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item span.facet-item-count {
color: #cbcbcb; }
.wp-block-tainacan-facets-list ul.facets-list.facets-layout-cloud li.facet-list-item:hover a,
.wp-block-tainacan-facets-list ul.facets-list-edit.facets-layout-cloud li.facet-list-item:hover a {
color: #298596;
text-decoration: none; }
.wp-block-tainacan-facets-list .show-more-button {
margin: 12px auto;
padding: 0.25rem;
display: block;
background: #298596;
border: none;
height: 24px;
width: 24px;
cursor: pointer; }
.wp-block-tainacan-facets-list .show-more-button[disabled] {
background-color: #cbcbcb; }
.wp-block-tainacan-facets-list .show-more-button i > svg {
fill: white; }
/*# sourceMappingURL=tainacan-gutenberg-block-facets-list.css.map */

File diff suppressed because one or more lines are too long

View File

@ -72,6 +72,9 @@
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0;

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV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EAAE,OAAO;QACd,eAAe,EAAE,IAAI",
"sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-items/items-list/items-list.scss"],
"names": [],
"file": "tainacan-gutenberg-block-items-list.css"

View File

@ -72,6 +72,9 @@
width: 95%; } }
.wp-block-tainacan-modal .modal-search-area .components-base-control label {
text-align: center; }
.wp-block-tainacan-modal .modal-radio-area-label {
font-weight: bold;
margin-left: 1.75rem; }
.wp-block-tainacan-modal .modal-checkbox-list,
.wp-block-tainacan-modal .modal-radio-list .components-base-control__field {
padding: 0;

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,cAAe;EACX,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,iBAAiB;EACxB,UAAU,EAAE,OAAO;EAEnB,gBAAE;IACE,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,OAAO;IAEb,oBAAI;MACA,GAAG,EAAE,GAAG;MACR,YAAY,EAAE,OAAO;MACrB,QAAQ,EAAE,QAAQ;MAClB,IAAI,EAAE,OAAO;;AAIzB,mCAAoC;EAChC,SAAS,EAAE,mBAAmB;EAC9B,UAAU,EAAE,IAAI;EAChB,IAAI,EAAE,OAAO;EAEb,uCAAI;IACA,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,GAAG;IACR,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,OAAO;;AAKrB,wBAAyB;EACrB,KAAK,EAAE,GAAG;EAEV,0CAA2C;IAH/C,wBAAyB;MAGyB,KAAK,EAAE,GAAG;EACxD,yCAA0C;IAJ9C,wBAAyB;MAIuB,KAAK,EAAE,IAAI;EAGvD,sCAAgB;IACZ,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Id,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,IAAI;MAGhB;8FAAI;QACA,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,GAAG;QACZ,YAAY,EAAE,IAAI;MAGtB;mHAAyB;QACrB,OAAO,EAAE,IAAI;MAGjB;kGAAU;QACN,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,IAAI;EAKjC,0CAA2C;IACvC;wFACwD;MACpD,SAAS,EAAE,GAAG;MACd,KAAK,EAAE,GAAG;EAIlB,0CAA2C;IACvC;wFACwD;MACpD,SAAS,EAAE,GAAG;MACd,KAAK,EAAE,GAAG;EAIlB,yCAA0C;IACtC;wFACuD;MACnD,SAAS,EAAE,IAAI;MACf,KAAK,EAAE,IAAI",
"sources": ["../../gutenberg-blocks/gutenberg-blocks-style.scss","../../gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss"],
"names": [],
"file": "tainacan-gutenberg-block-terms-list.css"

View File

@ -167,11 +167,10 @@ class Media {
* @return blob bitstream of the image in jpg format
*/
public function get_pdf_cover($filepath) {
$blob = apply_filters('tainacan-extract-pdf-cover', null, $filepath);
if ($blob) {
return $blob;
}
if ($blob) {
return $blob;
}
if (!class_exists('\Imagick')) {
return null;
@ -180,13 +179,31 @@ class Media {
if ( mime_content_type($filepath) != 'application/pdf') {
return null;
}
if ( !is_readable( realpath($filepath) ) ) {
return null;
}
$imagick = new \Imagick();
$imagick->setResolution(72,72);
$imagick->readImage($filepath . '[0]');
//$imagick->setIteratorIndex(0);
$imagick->setImageFormat('jpg');
return $imagick->getImageBlob();
try {
register_shutdown_function(array($this, 'shutdown_function'));
$this->THROW_EXCPTION_ON_FATAL_ERROR = true;
$imagick = new \Imagick();
$imagick->setResolution(72,72);
$imagick->readImage($filepath . '[0]');
//$imagick->setIteratorIndex(0);
$imagick->setImageFormat('jpg');
$this->THROW_EXCPTION_ON_FATAL_ERROR = false;
return $imagick->getImageBlob();
} catch(\Exception $e) {
return null;
} catch (\Error $ex) {
return null;
}
}
private $THROW_EXCPTION_ON_FATAL_ERROR = false;
public function shutdown_function() {
if( $this->THROW_EXCPTION_ON_FATAL_ERROR )
throw new \Exception("fatal error");
}
}

View File

@ -16,6 +16,7 @@ class Filter extends Entity {
$order,
$color,
$metadatum,
$metadatum_id,
$max_options,
$filter_type,
$filter_type_options;
@ -40,17 +41,21 @@ class Filter extends Entity {
*/
public function _toArray(){
$filter_array = parent::_toArray();
$metadatum_id = $filter_array['metadatum'];
$metadatum_id = $filter_array['metadatum_id'];
$metadatum = $this->get_metadatum();
$filter_array['metadatum'] = [];
$filter_array['metadatum']['metadatum_id'] = $metadatum_id;
$filter_array['metadatum']['metadatum_name'] = $metadatum->get_name();
$meta_object = $metadatum->get_metadata_type_object();
if (is_object($meta_object)) {
$filter_array['metadatum']['metadata_type_object'] = $meta_object->_toArray();
if ($metadatum instanceof Metadatum) {
$filter_array['metadatum']['metadatum_name'] = $metadatum->get_name();
$meta_object = $metadatum->get_metadata_type_object();
if (is_object($meta_object)) {
$filter_array['metadatum']['metadata_type_object'] = $meta_object->_toArray();
}
}
return apply_filters('tainacan-filter-to-array', $filter_array, $this);
}
@ -106,14 +111,32 @@ class Filter extends Entity {
}
/**
* Return the metadatum
* Return the metadatum ID
*
* @return Metadatum
* @return integer Metadatum ID
*/
function get_metadatum_id() {
return $this->get_mapped_property('metadatum_id');
}
/**
* Return the metadatum object
*
* @return Metadatum | null
* @throws \Exception
*/
function get_metadatum() {
$id = $this->get_mapped_property('metadatum');
return new Metadatum( $id );
if (isset($this->metadatum)) {
return $this->metadatum;
}
$id = $this->get_metadatum_id();
$metadatum = \Tainacan\Repositories\Metadata::get_instance()->fetch((int) $id);
if ($metadatum instanceof Metadatum) {
$this->metadatum = $metadatum;
return $metadatum;
} else {
return null;
}
}
/**
@ -124,12 +147,12 @@ class Filter extends Entity {
function get_filter_type_object(){
$class_name = $this->get_filter_type();
if( !class_exists( $class_name ) ){
return false;
}
if( !class_exists( $class_name ) ){
return null;
}
$object_type = new $class_name();
$object_type->set_options( $this->get_filter_options() );
$object_type->set_options( $this->get_filter_type_options() );
return $object_type;
}
@ -147,7 +170,7 @@ class Filter extends Entity {
*
* @return array Configurations for the filter type object
*/
function get_filter_options(){
function get_filter_type_options(){
return $this->get_mapped_property('filter_type_options');
}
@ -192,15 +215,27 @@ class Filter extends Entity {
}
/**
* Define the filter metadatum
* Define the filter metadatum passing an object
*
* @param \Tainacan\Entities\Metadatum
* @return void
*/
function set_metadatum( $value ){
$id = ( $value instanceof Metadatum ) ? $value->get_id() : $value;
function set_metadatum( \Tainacan\Entities\Metadatum $value ){
$id = $value->get_id();
$this->set_mapped_property('metadatum', $id);
$this->set_metadatum_id($id);
$this->metadatum = $value;
}
/**
* Define the filter metadatum passing an ID
*
* @param int $value the metadatum ID
* @return void
*/
function set_metadatum_id( $value ){
unset($this->metadatum);
$this->set_mapped_property('metadatum_id', $value);
}
/**
@ -258,6 +293,18 @@ class Filter extends Entity {
$this->add_error($metadatum, $message);
}
$this->add_error('filter_type_options', $is_valid);
return false;
}
/**
* Set Filter type options
*
* @param [string || integer] $value
* @return void
*/
function set_filter_type_options( $value ){
$this->set_mapped_property('filter_type_options', $value);
}
}

View File

@ -172,9 +172,11 @@ class Metadatum extends Entity {
*/
function get_metadata_type_object(){
$class_name = $this->get_metadata_type();
if (empty($class_name)) {
if( !class_exists( $class_name ) ){
return null;
}
}
$object_type = new $class_name();
$object_type->set_options( $this->get_metadata_type_options() );
return $object_type;

View File

@ -8,12 +8,10 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
*/
class Autocomplete extends Filter_Type {
//protected $default_max_options = -1;
protected $use_max_options = false;
function __construct(){
$this->set_supported_types(['string','long_string','item']);
$this->set_component('tainacan-filter-autocomplete');
$this->set_use_max_options(false);
$this->set_preview_template('
<div>
<div class="taginput control is-expanded has-selected">
@ -50,7 +48,6 @@ class Autocomplete extends Filter_Type {
public function render( $filter ){
return '<tainacan-filter-autocomplete name="'.$filter->get_name().'"
collection_id="'.$filter->get_collection_id().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-autocomplete>';
}
}

View File

@ -64,8 +64,7 @@ class Checkbox extends Filter_Type {
public function render( $filter ){
return '<tainacan-filter-checkbox name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-selectbox>';
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-selectbox>';
}
}

View File

@ -9,7 +9,19 @@
size="is-small"
@focus="isTouched = true"
@input="validate_values()"
icon="calendar-today"/>
editable
:date-formatter="(date) => dateFormatter(date)"
:date-parser="(date) => dateParser(date)"
icon="calendar-today"
:day-names="[
$i18n.get('datepicker_short_sunday'),
$i18n.get('datepicker_short_monday'),
$i18n.get('datepicker_short_tuesday'),
$i18n.get('datepicker_short_wednesday'),
$i18n.get('datepicker_short_thursday'),
$i18n.get('datepicker_short_friday'),
$i18n.get('datepicker_short_saturday'),
]"/>
<p class="is-size-7 has-text-centered is-marginless">{{ $i18n.get('label_until') }}</p>
<b-datepicker
:aria-labelledby="labelId"
@ -18,26 +30,34 @@
size="is-small"
@input="validate_values()"
@focus="isTouched = true"
icon="calendar-today"/>
editable
:date-formatter="(date) => dateFormatter(date)"
:date-parser="(date) => dateParser(date)"
icon="calendar-today"
:day-names="[
$i18n.get('datepicker_short_sunday'),
$i18n.get('datepicker_short_monday'),
$i18n.get('datepicker_short_tuesday'),
$i18n.get('datepicker_short_wednesday'),
$i18n.get('datepicker_short_thursday'),
$i18n.get('datepicker_short_friday'),
$i18n.get('datepicker_short_saturday'),
]"/>
</div>
<!-- Numeric -->
<div v-else>
<b-input
<b-numberinput
:aria-labelledby="labelId"
size="is-small"
type="number"
step="any"
autocomplete="off"
@input="validate_values()"
v-model="value_init"/>
<p class="is-size-7 has-text-centered is-marginless">{{ $i18n.get('label_until') }}</p>
<b-input
<b-numberinput
:aria-labelledby="labelId"
size="is-small"
type="number"
step="any"
autocomplete="off"
@input="validate_values()"
@focus="isTouched = true"
v-model="value_end"/>
@ -47,12 +67,12 @@
<script>
import { tainacan as axios } from '../../../js/axios/axios';
import { wpAjax } from "../../../admin/js/mixins";
import { wpAjax, dateInter } from "../../../admin/js/mixins";
import moment from 'moment';
export default {
mixins: [ wpAjax ],
created(){
const vm = this;
mixins: [ wpAjax, dateInter ],
created() {
this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id;
this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : this.filter.metadatum.metadatum_id;
@ -66,9 +86,9 @@
.then( res => {
let result = res.data;
if( result && result.metadata_type ){
vm.metadatum_object = result;
vm.type = ( result.metadata_type === 'Tainacan\\Metadata_Types\\Date') ? 'date' : 'numeric';
vm.selectedValues();
this.metadatum_object = result;
this.type = ( result.metadata_type === 'Tainacan\\Metadata_Types\\Date') ? 'date' : 'numeric';
this.selectedValues();
}
})
.catch(error => {
@ -89,7 +109,7 @@
type: 'numeric',
collection: '',
metadatum: '',
metadatum_object: {},
metadatum_object: {}
}
},
props: {
@ -140,7 +160,7 @@
return;
}
}
this.emit( this );
this.emit();
}, 1000),
// message for error
error_message(){
@ -148,11 +168,17 @@
this.$toast.open({
duration: 3000,
message: `First value should be lower than second value`,
message: this.$i18n.get('info_error_first_value_greater'),
position: 'is-bottom',
type: 'is-danger'
})
},
dateFormatter(dateObject) {
return moment(dateObject, moment.ISO_8601).format(this.dateFormat);
},
dateParser(dateString) {
return moment(dateString, this.dateFormat).toDate();
},
selectedValues(){
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
return false;
@ -174,7 +200,7 @@
if (metadata.value[0] != undefined && metadata.value[1] != undefined) {
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: metadata.value[0] + ' - ' + metadata.value[1]
value: this.parseDateToNavigatorLanguage(metadata.value[0]) + ' - ' + this.parseDateToNavigatorLanguage(metadata.value[1])
});
}
@ -222,69 +248,68 @@
this.isTouched = false;
}
},
// emit the operation for listeners
emit: ( vm ) => {
emit() {
let values = [];
let type = '';
if( vm.type === 'date' ){
if( this.type === 'date' ){
if( vm.date_init === null && vm.date_end === null ){
if( this.date_init === null && this.date_end === null ){
values = [];
type = 'DATE';
vm.isValid = false;
vm.clear = true;
this.isValid = false;
this.clear = true;
} else {
let date_init = vm.date_init.getUTCFullYear() + '-' +
('00' + (vm.date_init.getUTCMonth() + 1)).slice(-2) + '-' +
('00' + vm.date_init.getUTCDate()).slice(-2);
let date_end = vm.date_end.getUTCFullYear() + '-' +
('00' + (vm.date_end.getUTCMonth() + 1)).slice(-2) + '-' +
('00' + vm.date_end.getUTCDate()).slice(-2);
let date_init = this.date_init.getUTCFullYear() + '-' +
('00' + (this.date_init.getUTCMonth() + 1)).slice(-2) + '-' +
('00' + this.date_init.getUTCDate()).slice(-2);
let date_end = this.date_end.getUTCFullYear() + '-' +
('00' + (this.date_end.getUTCMonth() + 1)).slice(-2) + '-' +
('00' + this.date_end.getUTCDate()).slice(-2);
values = [ date_init, date_end ];
type = 'DATE';
vm.isValid = true;
vm.clear = false;
this.isValid = true;
this.clear = false;
}
} else {
if( vm.value_init === null || vm.value_end === null
|| vm.value_init === '' || vm.value_end === ''){
if( this.value_init === null || this.value_end === null
|| this.value_init === '' || this.value_end === ''){
return;
} else {
values = [ vm.value_init, vm.value_end ];
values = [ this.value_init, this.value_end ];
if(vm.value_init !== vm.value_end && (vm.value_init % 1 !== 0 && vm.value_end % 1 == 0)) {
if(this.value_init !== this.value_end && (this.value_init % 1 !== 0 && this.value_end % 1 == 0)) {
type = 'DECIMAL';
} else if(vm.value_init !== vm.value_end &&
vm.value_init % 1 !== 0 &&
vm.value_end % 1 !== 0) {
} else if(this.value_init !== this.value_end &&
this.value_init % 1 !== 0 &&
this.value_end % 1 !== 0) {
type = '';
} else if(vm.value_init !== vm.value_end &&
!(vm.value_init % 1 == 0 && vm.value_end % 1 !== 0)){
} else if(this.value_init !== this.value_end &&
!(this.value_init % 1 == 0 && this.value_end % 1 !== 0)){
type = 'DECIMAL';
} else {
type = '';
}
//vm.isValid = true;
//vm.clear = false;
//this.isValid = true;
//this.clear = false;
}
}
vm.$emit('input', {
this.$emit('input', {
filter: 'range',
type: type,
compare: 'BETWEEN',
metadatum_id: vm.metadatum,
collection_id: ( vm.collection_id ) ? vm.collection_id : vm.filter.collection_id,
metadatum_id: this.metadatum,
collection_id: ( this.collection_id ) ? this.collection_id : this.filter.collection_id,
value: values
});
if (values[0] != undefined && values[1] != undefined) {
vm.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: vm.filter.id,
value: values[0] + ' - ' + values[1]
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: this.parseDateToNavigatorLanguage(values[0]) + ' - ' + this.parseDateToNavigatorLanguage(values[1])
});
}
}
@ -294,3 +319,12 @@
}
}
</script>
<style scoped>
.field {
margin-bottom: 0.125rem !important;
}
p.is-size-7 {
margin-bottom: 0.125rem !important;
}
</style>

View File

@ -12,14 +12,47 @@ class Custom_Interval extends Filter_Type {
function __construct(){
$this->set_supported_types(['float','date']);
$this->set_component('tainacan-filter-custom-interval');
$this->set_use_max_options(false);
$this->set_preview_template('
<div>
<div class="control is-small is-clearfix">
<input type="number" step="any" value="6" class="input is-small">
</div>
<div class="b-numberinput field is-grouped">
<p class="control">
<button type="button" class="button is-primary is-small">
<span class="icon is-small">
<i class="mdi mdi-minus"></i>
</span>
</button>
</p>
<div class="control is-small is-clearfix">
<input type="number" step="0.01" class="input is-small" value="6">
</div>
<p class="control">
<button type="button" class="button is-primary is-small">
<span class="icon is-small">
<i class="mdi mdi-plus"></i>
</span>
</button>
</p>
</div>
<p class="is-size-7 has-text-centered is-marginless">until</p>
<div class="control is-small is-clearfix">
<input type="number" step="any" value="10" class="input is-small">
<div class="b-numberinput field is-grouped">
<p class="control">
<button type="button" class="button is-primary is-small">
<span class="icon is-small">
<i class="mdi mdi-minus"></i>
</span>
</button>
</p>
<div class="control is-small is-clearfix">
<input type="number" step="0.01" class="input is-small" value="10">
</div>
<p class="control">
<button type="button" class="button is-primary is-small">
<span class="icon is-small">
<i class="mdi mdi-plus"></i>
</span>
</button>
</p>
</div>
</div>
');
@ -34,7 +67,6 @@ class Custom_Interval extends Filter_Type {
$type = ( $filter->get_metadatum()->get_metadata_type() === 'Tainacan\Metadata_Types\Date' ) ? 'date' : 'numeric';
return '<tainacan-filter-custom-interval
name="'.$filter->get_name().'"
typeRange="'.$type.'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-custom-interval>';
}

View File

@ -0,0 +1,270 @@
<template>
<div class="date-filter-container">
<b-dropdown
:mobile-modal="true"
@input="onChangeComparator($event)"
aria-role="list">
<button
:aria-label="$i18n.get('label_comparator')"
class="button is-white"
slot="trigger">
<span class="icon is-small">
<i v-html="comparatorSymbol" />
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '=' }"
:value="'='"
aria-role="listitem">
&#61;&nbsp; {{ $i18n.get('is_equal_to') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '!=' }"
:value="'!='"
aria-role="listitem">
&#8800;&nbsp; {{ $i18n.get('is_not_equal_to') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '>' }"
:value="'>'"
aria-role="listitem">
&#62;&nbsp; {{ $i18n.get('after') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '>=' }"
:value="'>='"
aria-role="listitem">
&#8805;&nbsp; {{ $i18n.get('after_or_on_day') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '<' }"
:value="'<'"
aria-role="listitem">
&#60;&nbsp; {{ $i18n.get('before') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '<=' }"
:value="'<='"
aria-role="listitem">
&#8804;&nbsp; {{ $i18n.get('before_or_on_day') }}
</b-dropdown-item>
</b-dropdown>
<b-datepicker
position="is-bottom-left"
:aria-labelledby="labelId"
:placeholder="$i18n.get('instruction_select_a_date')"
v-model="value"
@input="emit()"
editable
:date-formatter="(date) => dateFormatter(date)"
:date-parser="(date) => dateParser(date)"
size="is-small"
icon="calendar-today"
:day-names="[
$i18n.get('datepicker_short_sunday'),
$i18n.get('datepicker_short_monday'),
$i18n.get('datepicker_short_tuesday'),
$i18n.get('datepicker_short_wednesday'),
$i18n.get('datepicker_short_thursday'),
$i18n.get('datepicker_short_friday'),
$i18n.get('datepicker_short_saturday'),
]"/>
</div>
</template>
<script>
import { tainacan as axios } from '../../../js/axios/axios';
import { wpAjax, dateInter } from "../../../admin/js/mixins";
import moment from 'moment';
export default {
mixins: [ wpAjax, dateInter ],
created() {
this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id;
this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : (typeof this.filter.metadatum.metadatum_id == 'object' ? this.filter.metadatum.metadatum_id.metadatum_id : this.filter.metadatum.metadatum_id);
// this.options = this.filter.filter_type_options;
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
if (this.isRepositoryLevel || this.collection == 'filter_in_repository')
in_route = '/metadata/'+ this.metadatum;
axios.get(in_route)
.then( res => {
let result = res.data;
if ( result && result.metadata_type ){
this.metadatum_object = result;
this.selectedValues();
}
})
.catch(error => {
this.$console.log(error);
});
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTags);
},
mounted() {
this.selectedValues();
},
data(){
return {
value: null,
clear: false,
options: [],
collection: '',
metadatum: '',
metadatum_object: {},
comparator: '=', // =, !=, >, >=, <, <=
}
},
props: {
filter: {
type: Object // concentrate all attributes metadatum id and type
},
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set
labelId: '',
query: Object,
isRepositoryLevel: Boolean,
},
computed: {
comparatorSymbol() {
switch(this.comparator) {
case '=': return '&#61;';
case '!=': return '&#8800;';
case '>': return '&#62;';
case '>=': return '&#8805;';
case '<': return '&#60;';
case '<=': return '&#8804;';
default: return '';
}
}
},
methods: {
selectedValues(){
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
return false;
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key === this.metadatum );
if ( index >= 0){
let metadata = this.query.metaquery[ index ];
if ( metadata.value && metadata.value.length > 0)
this.value = Array.isArray(metadata.value) ? new Date(metadata.value[0]) : new Date(metadata.value);
if ( metadata.compare)
this.comparator = metadata.compare;
if (this.value != undefined) {
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: this.comparator + ' ' + this.parseDateToNavigatorLanguage(Array.isArray(metadata.value) ? metadata.value[0] : metadata.value)
});
}
} else {
return false;
}
},
cleanSearchFromTags(filterTag) {
if (filterTag.filterId == this.filter.id)
this.clearSearch();
},
clearSearch(){
this.clear = true;
this.$emit('input', {
filter: 'date',
type: 'DATE',
compare: this.comparator,
metadatum_id: this.metadatum,
collection_id: ( this.collection_id ) ? this.collection_id : this.filter.collection_id,
value: ''
});
this.value = null;
},
dateFormatter(dateObject) {
return moment(dateObject, moment.ISO_8601).format(this.dateFormat);
},
dateParser(dateString) {
return moment(dateString, this.dateFormat).toDate();
},
// emit the operation for listeners
emit() {
if ( this.value == undefined || this.value == null || this.value === '')
this.value = new Date();
let valueQuery = this.value.getUTCFullYear() + '-' +
('00' + (this.value.getUTCMonth() + 1)).slice(-2) + '-' +
('00' + this.value.getUTCDate()).slice(-2);
this.$emit('input', {
filter: 'date',
type: 'DATE',
compare: this.comparator,
metadatum_id: this.metadatum,
collection_id: ( this.collection_id ) ? this.collection_id : this.filter.collection_id,
value: valueQuery
});
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: this.comparator + ' ' + this.parseDateToNavigatorLanguage(valueQuery)
});
},
onChangeComparator(newComparator) {
this.comparator = newComparator;
this.emit();
}
},
beforeDestroy() {
this.$eventBusSearch.$off('removeFromFilterTag', this.cleanSearchFromTags);
}
}
</script>
<style lang="scss" scoped>
.date-filter-container {
display: flex;
height: 30px;
@media screen and (min-width: 769px) and (max-width: 1500px) {
flex-wrap: wrap;
height: 60px;
}
.dropdown {
width: auto;
flex-grow: 2;
.dropdown-trigger button {
padding: 0 0.5rem !important;
height: 30px !important;
i:not(.tainacan-icon-arrowdown) {
margin-top: -3px;
font-size: 1.25rem;
font-style: normal;
color: #555758;
}
}
}
}
</style>

View File

@ -0,0 +1,71 @@
<?php
namespace Tainacan\Filter_Types;
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/**
* Class TainacanFilterType
*/
class Date extends Filter_Type {
function __construct(){
$this->set_supported_types(['date']);
$this->set_component('tainacan-filter-date');
$this->set_use_max_options(false);
$this->set_preview_template('
<div>
<div>
<div class="date-filter-container">
<div class="dropdown is-active">
<div role="button" class="dropdown-trigger">
<button class="button is-white">
<span class="icon is-small">
<i>=</i>
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
</span>
</button>
</div>
<div class="background" style="display: none;"></div>
<div class="dropdown-menu" style="display: none;">
<div role="list" class="dropdown-content">
<a class="dropdown-item is-active">=&nbsp; ' . __('Equal', 'tainacan') .'</a>
<a class="dropdown-item">&nbsp; '. __('Not equal', 'tainacan') .'</a>
<a class="dropdown-item">&gt;&nbsp; '. __('After', 'tainacan') .'</a>
<a class="dropdown-item">&nbsp; '. __('After (inclusive)', 'tainacan') .'</a>
<a class="dropdown-item">&lt;&nbsp; '. __('Before', 'tainacan') .'</a>
<a class="dropdown-item">&nbsp; '. __('Before (inclusive)', 'tainacan') .'</a>
</div>
</div>
</div>
<div class="datepicker control is-small">
<div class="dropdown is-bottom-left is-mobile-modal">
<div role="button" class="dropdown-trigger">
<div class="control has-icons-left is-small is-clearfix">
<input type="text" autocomplete="off" placeholder=" '. __('Select a date', 'tainacan') .'" class="input is-small">
<span class="icon is-left is-small"><i class="mdi mdi-calendar-today"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
');
}
/**
* @param $filter
* @return string
* @internal param $metadatum
*/
public function render( $filter ){
return '<tainacan-filter-date
name="'.$filter->get_name().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-date>';
}
}

View File

@ -5,11 +5,41 @@ use Tainacan\Metadata_Types;
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/**
* Class TainacanFilterType
*/
abstract class Filter_Type {
private $supported_types = [];
/**
* Array of options specific to this filter type. Stored in filter_type_options property of the Filter object
* @var array
*/
private $options = [];
/**
* The default values for the filter type options array
* @var array
*/
private $default_options = [];
/**
* The name of the web component used by this filter type
* @var string
*/
private $component;
/**
* The name of the web component used by the Form
* @var bool | string
*/
private $form_component = false;
/**
* The html template featuring a preview of how this metadata type componenet
* @var string
*/
private $preview_template = '';
protected $use_max_options = true;
@ -72,11 +102,13 @@ abstract class Filter_Type {
public function _toArray(){
$attributes = [];
$attributes['className'] = get_class($this);
$attributes['component'] = $this->get_component();
$attributes['supported_types'] = $this->get_supported_types();
$attributes['className'] = get_class($this);
$attributes['component'] = $this->get_component();
$attributes['options'] = $this->get_options();
$attributes['supported_types'] = $this->get_supported_types();
$attributes['preview_template'] = $this->get_preview_template();
$attributes['use_max_options'] = $this->get_use_max_options();
$attributes['use_max_options'] = $this->get_use_max_options();
$attributes['form_component'] = $this->get_form_component();
return $attributes;
}
@ -88,6 +120,10 @@ abstract class Filter_Type {
$this->options = ( is_array( $options ) ) ? $options : (!is_array(unserialize( $options )) ? [] : unserialize( $options ));
}
public function set_default_options(Array $options) {
$this->default_options = $options;
}
/**
* Validates the options Array
*
@ -121,11 +157,13 @@ abstract class Filter_Type {
$this->component = $component;
}
/**
* @return mixed
*/
public function get_options() {
return $this->options;
/**
* Gets the options for this filter types including default values for options
* that were not set yet.
* @return array Filter type options
*/
public function get_options() {
return array_merge($this->default_options, $this->options);
}
public function set_use_max_options($use_max_options) {
@ -135,4 +173,38 @@ abstract class Filter_Type {
public function get_use_max_options() {
return $this->use_max_options;
}
/**
* Gets one option from the options array.
*
* Checks if option exist or if it have a default value. Otherwise return an empty string
*
* @param string $key the desired option
* @return mixed the option value, the default value or an empty string
*/
public function get_option($key) {
$options = $this->get_options();
return isset($options[$key]) ? $options[$key] : '';
}
/**
* allow i18n from messages
*/
public function get_form_labels(){
return [];
}
/**
* @return string
*/
public function get_form_component() {
return $this->form_component;
}
/**
* @param $form_component The web component that will render the filter options form
*/
public function set_form_component($form_component){
$this->form_component = $form_component;
}
}

View File

@ -1,7 +1,6 @@
import qs from 'qs';
import axios from '../../js/axios/axios';
import { mapGetters } from 'vuex';
import { resolve } from 'bluebird';
export const filter_type_mixin = {
data () {
@ -18,7 +17,6 @@ export const filter_type_mixin = {
},
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set
filter_type: [String], // not required, but overrides the filter metadatum type if is set
id: '',
query: {}
},
@ -26,9 +24,6 @@ export const filter_type_mixin = {
// We listen to event, but reload event if hasFiltered is negative, as
// an empty query also demands filters reloading.
this.$eventBusSearch.$on('hasFiltered', this.reloadOptionsDueToFiltering);
},
mounted() {
},
computed: {
facetsFromItemSearch() {

View File

@ -0,0 +1,99 @@
<template>
<div>
<b-field :addons="false">
<label class="label is-inline">
{{ $i18n.getHelperTitle('tainacan-filter-numeric', 'step') }}<span>&nbsp;*&nbsp;</span>
<help-button
:title="$i18n.getHelperTitle('tainacan-filter-numeric', 'step')"
:message="$i18n.getHelperMessage('tainacan-filter-numeric', 'step')"/>
</label>
<div
v-if="!showEditStepOptions"
class="is-flex">
<b-select
name="step_options"
v-model="step"
@input="onUpdateStep">
<option value="0.001">0.001</option>
<option value="0.01">0.01</option>
<option value="0.1">0.1</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="100">100</option>
<option value="1000">1000</option>
<option
v-if="step && ![0.001,0.01,0.1,1,2,5,10,100,1000].find( (element) => element == step )"
:value="step">
{{ step }}</option>
</b-select>
<button
class="button is-white is-pulled-right"
:aria-label="$i18n.get('edit')"
@click.prevent="showEditStepOptions = true">
<span
v-tooltip="{
content: $i18n.get('edit'),
autoHide: true,
placement: 'bottom'
}"
class="icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-edit has-text-secondary"/>
</span>
</button>
</div>
<div
v-if="showEditStepOptions"
class="is-flex">
<b-input
name="max_options"
v-model="step"
@input="onUpdateStep"
type="number"
step="1" />
<button
@click.prevent="showEditStepOptions = false"
class="button is-white is-pulled-right">
<span
v-tooltip="{
content: $i18n.get('close'),
autoHide: true,
placement: 'bottom'
}"
class="icon">
<i class="tainacan-icon tainacan-icon-18px tainacan-icon-close has-text-secondary"/>
</span>
</button>
</div>
</b-field>
</div>
</template>
<script>
export default {
props: {
filter: {
type: Object
},
value: [String, Number, Array],
id: '',
disabled: false,
},
data() {
return {
step: [Number, String],
showEditStepOptions: false
}
},
methods: {
onUpdateStep(value) {
this.$emit('input', { step: value });
},
},
created() {
this.step = this.value && this.value.step ? this.value.step : 1;
}
}
</script>

View File

@ -0,0 +1,247 @@
<template>
<div class="numeric-filter-container">
<b-dropdown
:mobile-modal="true"
@input="onChangeComparator($event)"
aria-role="list">
<button
:aria-label="$i18n.get('label_comparator')"
class="button is-white"
slot="trigger">
<span class="icon is-small">
<i v-html="comparatorSymbol" />
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown" />
</span>
</button>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '=' }"
:value="'='"
aria-role="listitem">
&#61;&nbsp; {{ $i18n.get('is_equal_to') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '!=' }"
:value="'!='"
aria-role="listitem">
&#8800;&nbsp; {{ $i18n.get('is_not_equal_to') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '>' }"
:value="'>'"
aria-role="listitem">
&#62;&nbsp; {{ $i18n.get('greater_than') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '>=' }"
:value="'>='"
aria-role="listitem">
&#8805;&nbsp; {{ $i18n.get('greater_than_or_equal_to') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '<' }"
:value="'<'"
aria-role="listitem">
&#60;&nbsp; {{ $i18n.get('less_than') }}
</b-dropdown-item>
<b-dropdown-item
role="button"
:class="{ 'is-active': comparator == '<=' }"
:value="'<='"
aria-role="listitem">
&#8804;&nbsp; {{ $i18n.get('less_than_or_equal_to') }}
</b-dropdown-item>
</b-dropdown>
<b-numberinput
:aria-labelledby="labelId"
size="is-small"
:step="Number(options.step)"
@input="emit()"
v-model="value"/>
</div>
</template>
<script>
import { tainacan as axios } from '../../../js/axios/axios';
import { wpAjax } from "../../../admin/js/mixins";
export default {
mixins: [ wpAjax ],
created() {
this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id;
this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : (typeof this.filter.metadatum.metadatum_id == 'object' ? this.filter.metadatum.metadatum_id.metadatum_id : this.filter.metadatum.metadatum_id);
this.options = this.filter.filter_type_options;
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
if (this.isRepositoryLevel || this.collection == 'filter_in_repository')
in_route = '/metadata/'+ this.metadatum;
axios.get(in_route)
.then( res => {
let result = res.data;
if ( result && result.metadata_type ){
this.metadatum_object = result;
this.selectedValues();
}
})
.catch(error => {
this.$console.log(error);
});
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTags);
},
mounted() {
this.selectedValues();
},
data(){
return {
value: null,
clear: false,
options: [],
collection: '',
metadatum: '',
metadatum_object: {},
comparator: '=' // =, !=, >, >=, <, <=
}
},
props: {
filter: {
type: Object // concentrate all attributes metadatum id and type
},
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set
labelId: '',
query: Object,
isRepositoryLevel: Boolean,
},
computed: {
comparatorSymbol() {
switch(this.comparator) {
case '=': return '&#61;';
case '!=': return '&#8800;';
case '>': return '&#62;';
case '>=': return '&#8805;';
case '<': return '&#60;';
case '<=': return '&#8804;';
default: return '';
}
}
},
methods: {
selectedValues(){
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
return false;
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key === this.metadatum );
if ( index >= 0){
let metadata = this.query.metaquery[ index ];
if ( metadata.value && metadata.value.length > 0)
this.value = Array.isArray(metadata.value) ? Number(metadata.value[0]) : Number(metadata.value);
if ( metadata.compare)
this.comparator = metadata.compare;
if (this.value != undefined) {
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: this.comparator + ' ' + this.value
});
}
} else {
return false;
}
},
cleanSearchFromTags(filterTag) {
if (filterTag.filterId == this.filter.id)
this.clearSearch();
},
clearSearch(){
this.clear = true;
this.$emit('input', {
filter: 'numeric',
compare: this.comparator,
metadatum_id: this.metadatum,
collection_id: ( this.collection_id ) ? this.collection_id : this.filter.collection_id,
value: ''
});
this.value = null;
},
// emit the operation for listeners
emit() {
if ( this.value === null || this.value === '')
return;
this.$emit('input', {
filter: 'numeric',
compare: this.comparator,
metadatum_id: this.metadatum,
collection_id: ( this.collection_id ) ? this.collection_id : this.filter.collection_id,
value: this.value
});
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: this.comparator + ' ' + this.value
});
},
onChangeComparator(newComparator) {
this.comparator = newComparator;
this.emit();
}
},
beforeDestroy() {
this.$eventBusSearch.$off('removeFromFilterTag', this.cleanSearchFromTags);
}
}
</script>
<style lang="scss" scoped>
.numeric-filter-container {
display: flex;
height: 30px;
@media screen and (min-width: 769px) and (max-width: 1500px) {
flex-wrap: wrap;
height: 60px;
}
.dropdown {
width: auto;
flex-grow: 2;
.dropdown-trigger button {
padding: 0 0.5rem !important;
height: 30px !important;
i:not(.tainacan-icon-arrowdown) {
margin-top: -3px;
font-size: 1.25rem;
font-style: normal;
color: #555758;
}
}
}
.b-numberinput.is-grouped {
flex-grow: 1;
}
}
</style>

View File

@ -0,0 +1,112 @@
<?php
namespace Tainacan\Filter_Types;
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/**
* Class TainacanMetadatumType
*/
class Numeric extends Filter_Type {
function __construct(){
$this->set_supported_types(['float']);
$this->set_component('tainacan-filter-numeric');
$this->set_form_component('tainacan-filter-form-numeric');
$this->set_use_max_options(false);
$this->set_default_options([
'step' => 1
]);
$this->set_preview_template('
<div>
<div>
<div class="numeric-filter-container">
<div class="dropdown is-active">
<div role="button" class="dropdown-trigger">
<button class="button is-white">
<span class="icon is-small">
<i>=</i>
</span>
<span class="icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-arrowdown"></i>
</span>
</button>
</div>
<div class="background" style="display: none;"></div>
<div class="dropdown-menu" style="display: none;">
<div role="list" class="dropdown-content">
<a class="dropdown-item is-active">=&nbsp; ' . __('Equal', 'tainacan') .'</a>
<a class="dropdown-item">&nbsp; '. __('Not equal', 'tainacan') .'</a>
<a class="dropdown-item">&gt;&nbsp; '. __('Greater than', 'tainacan') .'</a>
<a class="dropdown-item">&nbsp; '. __('Greater than or equal to', 'tainacan') .'</a>
<a class="dropdown-item">&lt;&nbsp; '. __('Less than', 'tainacan') .'</a>
<a class="dropdown-item">&nbsp; '. __('Less than or equal to', 'tainacan') .'</a>
</div>
</div>
</div>
<div class="b-numberinput field is-grouped">
<p class="control">
<button type="button" class="button is-primary is-small">
<span class="icon is-small">
<i class="mdi mdi-minus"></i>
</span>
</button>
</p>
<div class="control is-small is-clearfix">
<input type="number" step="0.01" class="input is-small" value="1.5">
</div>
<p class="control">
<button type="button" class="button is-primary is-small">
<span class="icon is-small">
<i class="mdi mdi-plus"></i>
</span>
</button>
</p>
</div>
</div>
</div>
');
}
/**
* @inheritdoc
*/
public function get_form_labels(){
return [
'step' => [
'title' => __( 'Step', 'tainacan' ),
'description' => __( 'The amount to be increased or decreased when clicking on filter control buttons.', 'tainacan' ),
]
];
}
/**
* @param $filter
* @return string
* @internal param $metadatum
*/
public function render( $filter ){
return '<tainacan-filter-numeric
step="' . $this->get_option('step') . '"
name="'.$filter->get_name().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-numeric>';
}
/**
* @param \Tainacan\Entities\Filter $filter
* @return array|bool true if is validate or array if has error
*/
public function validate_options(\Tainacan\Entities\Filter $filter) {
if ( !in_array($filter->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
return true;
if ( empty($this->get_option('step')) ) {
return [
'step' => __('"Step" value is required','tainacan')
];
}
return true;
}
}

View File

@ -8,10 +8,10 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
*/
class Selectbox extends Filter_Type {
protected $use_max_options = false;
function __construct(){
$this->set_supported_types(['string', 'long_string']);
$this->set_component('tainacan-filter-selectbox');
$this->set_use_max_options(false);
$this->set_preview_template('
<div>
<div class="control is-expanded">
@ -32,8 +32,7 @@ class Selectbox extends Filter_Type {
public function render( $filter ){
return '<tainacan-filter-selectbox name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-selectbox>';
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-selectbox>';
}
}

View File

@ -11,6 +11,7 @@ class Taginput extends Filter_Type {
function __construct(){
$this->set_supported_types(['string','long_string','item']);
$this->set_component('tainacan-filter-taginput');
$this->set_use_max_options(false);
$this->set_preview_template('
<div>
<p class="has-text-gray">'. __('Selected values') . ': </p>
@ -61,8 +62,7 @@ class Taginput extends Filter_Type {
public function render( $filter ){
return '<tainacan-filter-taginput name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taginput>';
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-taginput>';
}
}

View File

@ -99,52 +99,137 @@
.filter-item-forms {
.datepicker {
width: 100%;
.datepicker-content {
height: auto;
input {
height: 30px;
}
}
.dropdown-item {
background-color: white !important;
.dropdown-menu {
background: transparent;
border: none;
.dropdown-item {
background-color: white !important;
}
}
.datepicker-header {
.pagination {
a>span>i:before {
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: inherit;
text-rendering: auto;
vertical-align: middle;
line-height: inherit;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: $secondary;
}
.pagination-previous {
border: none;
flex-grow: 0;
&>span>i:before {
content: 'previous';
font-size: 20px;
}
}
.pagination-next {
border: none;
flex-grow: 0;
&>span>i:before {
content: 'next';
font-size: 20px;
}
}
}
}
.datepicker-table {
margin-bottom: 0px;
.datepicker-cell {
border: none !important;
padding: 0.5rem 0.75rem !important;
}
.datepicker-cell.is-today,
.datepicker-cell.is-today:hover {
color: $gray4 !important;
background-color: $turquoise1;
}
.datepicker-cell.is-selected,
.datepicker-cell.is-selected:hover {
color: white !important;
background-color: $turquoise5 !important;
}
}
@media screen and (min-width: 1024px) {
.datepicker-header {
.pagination-list {
.field.has-addons {
display: table-cell !important;
width: 78px !important;
margin-bottom: 0.5rem;
padding-top: 0.15rem;
padding-bottom: 0.5rem;
.pagination {
flex-wrap: wrap;
.pagination-list {
margin-bottom: 0.5rem;
.control {
height: 24px !important;
width: 74px !important;
.field.has-addons {
width: 100% !important;
select {
padding-left: 1px !important;
.control {
height: 24px !important;
width: 74px !important;
.select {
min-width: 100% !important;
select {
padding-left: 1px !important;
font-size: 0.75rem !important;
height: 24px !important;
min-width: 100% !important;
&:not(.is-loading)::after {
margin-top: -13px !important;
}
}
}
}
}
}
}
.pagination-previous {
margin: 0;
height: 24px;
padding: 0;
font-size: 0.75rem;
}
.pagination-previous {
margin: 0;
height: 24px;
padding: 0;
font-size: 0.75rem;
order: 3;
}
.pagination-next {
margin: 0;
height: 24px;
padding: 0;
font-size: 0.75rem;
.pagination-next {
margin: 0;
height: 24px;
padding: 0;
font-size: 0.75rem;
}
}
}
.dropdown-item {
padding: 0.8em;
padding: 0.8rem !important;
}
.dropdown-menu {
@ -157,7 +242,7 @@
margin-bottom: 0px;
.datepicker-cell {
padding: 0.2rem 0.1rem !important;
padding: 0.15rem 0.175rem !important;
}
}
@ -174,6 +259,7 @@
max-width: 165px !important;
border-radius: 2px !important;
padding: 0px;
max-height: inherit !important;
}
}
}
@ -257,6 +343,7 @@
display: unset;
white-space: nowrap;
text-overflow: ellipsis;
height: 30px;
}
.control:not(.taginput) {

View File

@ -55,7 +55,7 @@
created(){
this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id;
this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : this.filter.metadatum.metadatum_id ;
this.type = ( this.filter_type ) ? this.filter_type : this.filter.metadatum.metadata_type;
this.type = this.filter.metadatum.metadata_type;
this.loadOptions();
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTag);
@ -91,7 +91,6 @@
},
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set
filter_type: [String], // not required, but overrides the filter metadatum type if is set
labelId: '',
query: {
type: Object // concentrate all attributes metadatum id and type

View File

@ -42,7 +42,7 @@
created(){
this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id;
this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : this.filter.metadatum.metadatum_id ;
this.type = ( this.filter_type ) ? this.filter_type : this.filter.metadatum.metadata_type;
this.type = this.filter.metadatum.metadata_type;
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
@ -77,7 +77,6 @@
},
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set
filter_type: [String], // not required, but overrides the filter metadatum type if is set
labelId: '',
query: {
type: Object // concentrate all attributes metadatum id and type

View File

@ -64,8 +64,7 @@ class TaxonomyCheckbox extends Filter_Type {
public function render( $filter ){
return '<tainacan-filter-taxonomy-checkbox name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taxonomy-checkbox>';
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-taxonomy-checkbox>';
}
}

View File

@ -11,6 +11,7 @@ class TaxonomyTaginput extends Filter_Type {
function __construct(){
$this->set_supported_types(['term']);
$this->set_component('tainacan-filter-taxonomy-taginput');
$this->set_use_max_options(false);
$this->set_preview_template('
<div>
<p class="has-text-gray">'. __('Selected values') . ': </p>
@ -61,8 +62,7 @@ class TaxonomyTaginput extends Filter_Type {
public function render( $filter ){
return '<tainacan-filter-taxonomy-taginput name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taxonomy-taginput>';
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-taxonomy-taginput>';
}
}

View File

@ -46,22 +46,12 @@
export default {
mixins: [ dateInter ],
created(){
let locale = navigator.language;
moment.locale(locale);
let localeData = moment.localeData();
this.dateFormat = localeData.longDateFormat('L');
if( this.value ){
if (this.value)
this.dateValue = this.parseDateToNavigatorLanguage(this.value);
}
},
data() {
return {
dateValue: '',
dateMask: this.getDateLocaleMask(),
dateFormat: '',
isInvalidDate: false,
}
},
@ -80,7 +70,7 @@
onInput: _.debounce(function ($event) {
let dateISO = '';
if($event && $event instanceof Date) {
if ($event && $event instanceof Date) {
dateISO = moment(this.dateValue, this.dateFormat).toISOString() ? moment(this.dateValue, this.dateFormat).toISOString().split('T')[0] : false;
} else if($event.target.value && $event.target.value.length === this.dateMask.length) {
dateISO = moment(this.dateValue, this.dateFormat).toISOString() ? moment($event.target.value, this.dateFormat).toISOString().split('T')[0] : false;
@ -95,12 +85,7 @@
this.$emit('input', dateISO);
this.$emit('blur');
}, 300),
parseDateToNavigatorLanguage(date){
date = new Date(date.replace(/-/g, '/'));
return moment(date, moment.ISO_8601).format(this.dateFormat);
}
}, 300)
}
}
</script>

View File

@ -23,6 +23,16 @@ abstract class Metadata_Type {
*/
private $primitive_type;
/**
* When primitive type points to an entity, such as item or term, this indidicates which repository to use
* to fetch that entity
*
* default is false: no repository
*
* @var bool | \Tainacan\Repositories\Repository
*/
private $repository = false;
/**
* Array of options specific to this metadatum type. Stored in metadata_type_options property of the Metadatum object
* @var array
@ -245,6 +255,14 @@ abstract class Metadata_Type {
public function set_core($core){
$this->core = $core;
}
public function get_repository() {
return $this->repository;
}
public function set_repository($repository){
$this->repository = $repository;
}
/**
* Gets a slug based on the class name to represent the metadata type

View File

@ -3,6 +3,7 @@
:disabled="disabled"
:class="{'has-content': inputValue !== undefined && inputValue !== ''}"
:id="id"
lang="en"
type="number"
:value="inputValue"
step="0.01"

View File

@ -179,8 +179,8 @@
if( metadata.length > 0 ){
this.metadata = [];
for( let metadatum of metadata ){
if( metadatum.metadata_type !== "Tainacan\\Metadata_Types\\Relationship"){
for (let metadatum of metadata) {
if (metadatum.metadata_type !== "Tainacan\\Metadata_Types\\Relationship" && metadatum.metadata_type !== "Tainacan\\Metadata_Types\\Taxonomy") {
this.metadata.push( metadatum );
this.hasMetadata = true;
this.checkMetadata()

View File

@ -13,6 +13,7 @@ class Relationship extends Metadata_Type {
// call metadatum type constructor
parent::__construct();
$this->set_primitive_type('item');
$this->set_repository( \Tainacan\Repositories\Items::get_instance() );
$this->set_component('tainacan-relationship');
$this->set_form_component('tainacan-form-relationship');
$this->set_name( __('Relationship', 'tainacan') );

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