Skip to content

Commit

Permalink
Adjustments to metadata by value alert. Ref. #278.
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuswetah committed Jul 18, 2019
1 parent 12b917a commit e1fee7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/admin/pages/lists/items-page.vue
Expand Up @@ -708,7 +708,13 @@
!showLoading &&
((openAdvancedSearch && advancedSearchResults) || !openAdvancedSearch)"
class="metadata-alert">
<p class="text">{{ $i18n.getWithVariables('info_sorting_by_metadata_value_%s', [orderByName]) }}</p>
<p class="text">
{{
totalItems > 0 ?
$i18n.getWithVariables('info_sorting_by_metadata_value_%s', [orderByName]) :
$i18n.getWithVariables('info_sorting_by_metadata_value_%s_empty_list', [orderByName])
}}
</p>
<div>
<button
@click="openMetatadaSortingWarningDialog({ offerCheckbox: false })"
Expand Down Expand Up @@ -916,7 +922,7 @@
},
computed: {
isSortingByCustomMetadata() {
return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'date');
return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'date');
},
repositoryTotalItems(){
let collections = this.getCollections();
Expand Down Expand Up @@ -1019,6 +1025,10 @@
} else {
this.$eventBusSearch.clearAllFilters();
}
},
orderBy() {
if (this.isSortingByCustomMetadata)
this.hasAnOpenAlert = true;
}
},
methods: {
Expand Down
1 change: 1 addition & 0 deletions src/admin/tainacan-admin-i18n.php
Expand Up @@ -626,6 +626,7 @@
'info_tainacan_api' => __('Tainacan API on JSON format.', 'tainacan'),
'info_items_hidden_due_sorting' => __('When ordering by metadata value, items that have no value for the chosen metadata will not be listed. This list may have less elements than the total existing for current search criteria.', 'tainacan'),
'info_sorting_by_metadata_value_%s' => __('Showing only items that have value for metadata %s.'),
'info_sorting_by_metadata_value_%s_empty_list' => __('No item found, but only items with values for metadata %s are shown. Try sorting by other metatada.'),

// Tainacan Metadatum Types
'tainacan-text' => __( 'Text', 'tainacan' ),
Expand Down

0 comments on commit e1fee7c

Please sign in to comment.