From cfc53453ba9f861204e82b03ac1aef01e2fe1619 Mon Sep 17 00:00:00 2001
From: mateuswetah '
+ * @type string $after_term_description String to be added after each term description
+ * Default ' ',
+ 'after_term_description' => '' . __( 'Document', 'tainacan' ) . '
';
+ $content .= $this->get_tainacan_item_gallery(array(
+ 'layoutElements' => array( 'main' => true, 'thumbnails' => false ),
+ 'mediaSources' => array( 'document' => true, 'attachments' => false, 'metadata' => false),
+ ));
+ $content .= '' . __( 'Attachments', 'tainacan' ) . '
';
+ $content .= $this->get_tainacan_item_gallery(array(
+ 'layoutElements' => array( 'main' => false, 'thumbnails' => true ),
+ 'mediaSources' => array( 'document' => false, 'attachments' => true, 'metadata' => false),
+ ));
+ $content .= '' . __( 'Document', 'tainacan' ) . '
';
- $content .= $this->get_tainacan_item_gallery(array(
- 'layoutElements' => array( 'main' => true, 'thumbnails' => false ),
- 'mediaSources' => array( 'document' => true, 'attachments' => false, 'metadata' => false),
- ));
- $content .= '' . __( 'Attachments', 'tainacan' ) . '
';
- $content .= $this->get_tainacan_item_gallery(array(
- 'layoutElements' => array( 'main' => false, 'thumbnails' => true ),
- 'mediaSources' => array( 'document' => false, 'attachments' => true, 'metadata' => false),
- ));
- $content .= ''
+ * @type string $after_term_name String to be added after each term name
+ * Default '
'
+ * @type string $before_term_description String to be added before each term description
+ * Default '',
+ 'after_term_name' => '
',
+ 'before_term_description' => '
' . + paginate_links(array( + 'format' => '?paged=%#%', + 'total' => ceil( $total_terms / $current_args['perpage'] ), + 'add_args' => array( + 'order' => $current_args['order'], + 'orderby' => $current_args['orderby'], + 'perpage' => $current_args['perpage'] + ) + )) . + '
'; } \ No newline at end of file From fc308b84d39281bbc22c8b4bdb1a607ce069c9b8 Mon Sep 17 00:00:00 2001 From: mateuswetah' .
paginate_links(array(
- 'format' => '?paged=%#%',
+ 'format' => '?termspaged=%#%',
'total' => ceil( $total_terms / $current_args['perpage'] ),
+ 'current' => max( 1, get_query_var('termspaged') ),
'add_args' => array(
'order' => $current_args['order'],
'orderby' => $current_args['orderby'],
From 8a01249afd463b57fa9ad8246fe2eacebb94a91b Mon Sep 17 00:00:00 2001
From: mateuswetah '
* @type string $after_term_description String to be added after each term description
* Default ' ',
'after_term_description' => ' ' . __('Showing terms children of: ', 'tainacan') . ' ' . get_term_parents_list($current_args['termsparent'], 'tnc_tax_' . $post->ID, [ 'format' => 'name', 'separator' => $separator, 'link' => true, 'inclusive' => true ]) . ' ' . __('No term was found.', 'tainacan') . ' ',
+ 'after_pagination' => ' ' .
- paginate_links(array(
- 'format' => '?termspaged=%#%',
- 'total' => ceil( $total_terms / $current_args['perpage'] ),
- 'current' => max( 1, get_query_var('termspaged') ),
- 'add_args' => array(
- 'order' => $current_args['order'],
- 'orderby' => $current_args['orderby'],
- 'perpage' => $current_args['perpage'],
- 'search' => $current_args['search'],
- 'termsparent' => $current_args['termsparent'],
- )
- )) .
- ' '
- * @type string $after_term_description String to be added after each term description
- * Default ' '
+ * @type string $after_term_description String to be added after each term description
+ * Default ' '
* @type string $after_term_description String to be added after each term description
* Default ' ',
'after_term_description' => '
- {{ formErrorMessage }}
-
- {{ ($i18n.get('info_updated_at') + ' ' + updatedAt) }}
-
-
-
-
- {{ $i18n.get('info_can_not_edit_taxonomy') }}
+
+
+
+ {{ $i18n.get('info_can_not_edit_taxonomy') }}
+ v-show="isTermInsertionFlow != true && showCheckboxesWarning == true">
{{ $i18n.get('info_warning_changing_parent_term') }}
- {{ column.name ? column.name : $i18n.get('label_root_terms') }}
-
-
-
-
-
-
- {{ column.id ? $i18n.get('label_new_child') : $i18n.get('label_new_term') }}
-
-
-
-
-
- {{ $i18n.getWithVariables('info_no_child_term_of_%s_found', [ column.name ]) }}
-
-
-
- {{ $i18n.get('info_no_terms_found') }}
+ {{ column.name ? $i18n.getWithVariables('info_children_of_%s', [ column.name ]) : $i18n.get('label_root_terms') }}
+
+
+
+
+ {{ $i18n.getWithVariables('info_no_child_term_of_%s_found', [ column.name ]) }}
-
+
{{ searchQuery != '' ? $i18n.get('info_no_terms_found') : $i18n.get('info_no_terms_created_on_taxonomy') }} {{ $i18n.get('info_no_terms_found') }} {{ $i18n.getWithVariables('info_no_child_term_of_%s_found', [ column.name ]) }} {{ column.name ? $i18n.getWithVariables('info_no_child_term_of_%s_found', [ column.name ]) : $i18n.get('info_no_terms_found') }}
- {{ $i18n.get('label_new_term') }}
+ {{ $i18n.get('label_create_term') }}
{{ $i18n.get('info_no_terms_found') }}
+
+
+
+
+ {{ $i18n.get('label_create_term') }}
+
+
- {{ column.name ? $i18n.getWithVariables('info_children_of_%s', [ column.name ]) : $i18n.get('label_root_terms') }}
-
- ',
- 'after_value' => ''
* @type string $after_term_name String to be added after each term name
@@ -1234,6 +1243,14 @@ function tainacan_the_metadata_sections($args = array()) {
* Default '
',
'after_term_name' => '
',
'before_term_description' => ''
- * @type string $after_terms_list String to be added after the taxonomy terms list
- * Default '
'
- * @type string $before_term String to be added before each term inside the loop
- * Default ''
- * @type string $after_term_name String to be added after each term name
- * Default '
'
- * @type string $before_term_description String to be added before each term description
- * Default ''
+ * @type string $after_terms_list String to be added after the taxonomy terms list
+ * Default '
'
+ * @type string $before_term String to be added before each term inside the loop
+ * Default ''
+ * @type string $after_term_name String to be added after each term name
+ * Default '
'
+ * @type string $before_term_description String to be added before each term description
+ * Default '',
@@ -1347,8 +1348,6 @@ function tainacan_get_single_taxonomy_content($post, $args = []) {
foreach ( $terms as $term ) {
$tainacan_term = new Entities\Term( $term );
- $total_children = get_term_children( $tainacan_term->get_id(), 'tnc_tax_' . $post->ID );
- $total_children = is_array($total_children) && count($total_children) ? count($total_children) : 0;
ob_start();
@@ -1378,12 +1377,21 @@ function tainacan_get_single_taxonomy_content($post, $args = []) {
if ( !$args['hide_term_name'] )
echo $args['before_term_name'] . $tainacan_term->get_name() . $args['after_term_name'];
- if ( !$args['hide_term_description'] )
- echo $args['before_term_description'] . $tainacan_term->get_description() . $args['after_term_description'];
+ $term_description = $tainacan_term->get_description();
+ if ( !$args['hide_term_description'] && $term_description ) {
+ if ($args['trim_description_words'] > -1)
+ $term_description = wp_trim_words( $term_description, $args['trim_description_words'], '[...]' );
+ echo $args['before_term_description'] . $term_description . $args['after_term_description'];
+ }
+
+ if ( !$args['hide_term_children_link'] ) {
+ $total_children = get_term_children( $tainacan_term->get_id(), 'tnc_tax_' . $post->ID );
+ $total_children = is_array($total_children) && count($total_children) ? count($total_children) : 0;
+
+ if ( $total_children)
+ echo $args['before_term_children_link'] . '' . __('Children', 'tainacan') . (!$args['hide_term_children_count'] ? ' (' . $total_children . ')' : '') . '' . $args['after_term_children_link'] . ' ';
+ }
- if ( !$args['hide_term_children_link'] && $total_children )
- echo $args['before_term_children_link'] . '' . __('Children', 'tainacan') . (!$args['hide_term_children_count'] ? ' (' . $total_children . ')' : '') . '' . $args['after_term_children_link'] . ' ';
-
if ( !$args['hide_term_items_link'] && !$args['hide_term_children_link'] && $term->count )
echo $args['before_term_items_link'] . '' . __('Itens', 'tainacan') . (!$args['hide_term_items_count'] ? ' (' . $term->count . ')' : '') . '' . $args['after_term_items_link'];
?>
From f314b444f2c99d2e9946b11f1fbd8e7e2e2b6039 Mon Sep 17 00:00:00 2001
From: mateuswetah
',
@@ -1392,9 +1406,18 @@ function tainacan_get_single_taxonomy_content($post, $args = []) {
echo $thumbnail ? ($args['before_term_thumbnail'] . $thumbnail . $args['after_term_thumbnail'] ) : '';
}
- if ( !$args['hide_term_hierarchy_path'] )
- echo $args['before_term_hierarchy_path'] . get_term_parents_list($tainacan_term->get_id(), 'tnc_tax_' . $post->ID, [ 'format' => 'name', 'separator' => $separator, 'link' => false, 'inclusive' => false ]) . $args['after_term_hierarchy_path'];
-
+ echo $args['before_term_information'];
+
+ if ( !$args['hide_term_hierarchy_path'] ) {
+ $term_hierarchy_path = get_term_parents_list($tainacan_term->get_id(), 'tnc_tax_' . $post->ID, [ 'format' => 'name', 'separator' => $separator, 'link' => false, 'inclusive' => false ]);
+
+
+ if ( $tainacan_term->get_parent() )
+ echo $args['before_term_hierarchy_path'] . $term_hierarchy_path . $args['after_term_hierarchy_path'];
+ else if ( $tainacan_term->get_parent() && !$args['hide_term_empty_hierarchy_path'] )
+ echo $args['before_term_hierarchy_path'] . $args['term_empty_hierarchy_path_message'] . $args['after_term_hierarchy_path'];
+ }
+
if ( !$args['hide_term_name'] ) {
$term_name = $tainacan_term->get_name();
@@ -1423,22 +1446,42 @@ function tainacan_get_single_taxonomy_content($post, $args = []) {
$total_children = get_term_children( $tainacan_term->get_id(), 'tnc_tax_' . $post->ID );
$total_children = is_array($total_children) && count($total_children) ? count($total_children) : 0;
- if ( $total_children )
- echo $args['before_term_children_link'] . '' . __('Children', 'tainacan') . (!$args['hide_term_children_count'] ? ' (' . $total_children . ')' : '') . '' . $args['after_term_children_link'] . ' ';
- else if ( !$total_children && !$args['hide_term_empty_children_link'] )
+ if ( $total_children ) {
+ echo $args['before_term_children_link'] . '';
+
+ if ( !$args['hide_term_children_count'] && $args['term_children_count_position'] === 'before' )
+ echo '' . $total_children . ' ';
+ echo ($total_children == 1 || $total_children == '1') ? __('Child', 'tainacan') : __('Children', 'tainacan');
+ if ( !$args['hide_term_children_count'] && $args['term_children_count_position'] !== 'before' )
+ echo ' (' . $total_children . ')';
+
+ echo '' . $args['after_term_children_link'] . ' ';
+
+ } else if ( !$total_children && !$args['hide_term_empty_children_link'] )
echo $args['before_term_children_link'] . $args['term_empty_children_link_message'] . $args['after_term_children_link'] . ' ';
}
if ( !$args['hide_term_items_link'] && !$args['hide_term_children_link'] ) {
- if ( $term->count )
- echo $args['before_term_items_link'] . '' . __('Itens', 'tainacan') . (!$args['hide_term_items_count'] ? ' (' . $term->count . ')' : '') . '' . $args['after_term_items_link'];
- else if ( !$term->count && !$args['hide_term_empty_items_link'] )
+ if ( $term->count ) {
+ echo $args['before_term_items_link'] . '';
+
+ if ( !$args['hide_term_items_count'] && $args['term_items_count_position'] === 'before' )
+ echo '' . $term->count . ' ';
+ echo ($term->count == 1 || $term->count == '1') ? __('Item', 'tainacan') : __('Itens', 'tainacan');
+ if ( !$args['hide_term_items_count'] && $args['term_items_count_position'] !== 'before' )
+ echo ' (' . $term->count . ')';
+
+ echo '' . $args['after_term_items_link'];
+
+ } else if ( !$term->count && !$args['hide_term_empty_items_link'] )
echo $args['before_term_items_link'] . $args['term_empty_items_link_message'] . $args['after_term_items_link'];
}
echo $args['after_term_links'];
+ echo $args['after_term_information'];
+
if ( !$args['hide_term_items_link'] && $args['hide_term_children_link'] )
echo '';
@@ -1467,7 +1510,15 @@ function tainacan_get_single_taxonomy_content($post, $args = []) {
return apply_filters('tainacan_get_single_taxonomy_content', ['content' => $content, 'total_terms' => $total_terms] , $post);
}
-function tainacan_get_taxonomies_orderby() {
+function tainacan_get_taxonomies_orderby($args = []) {
+
+ $args = array_merge(array(
+ 'hide_orderby_label' => false,
+ 'hide_order_label' => false,
+ 'hide_orderby' => false,
+ 'hide_order' => false,
+ ), $args);
+
$current_args = \Tainacan\Theme_Helper::get_instance()->get_taxonomies_query_args();
ob_start();
@@ -1476,35 +1527,43 @@ function tainacan_get_taxonomies_orderby() {
{{ form & form.id && form.id != 'new' ? $i18n.get("title_term_edit") : $i18n.get("title_term_creation") }}
+ {{ form & form.id && form.id != 'new' ? $i18n.get("title_term_edit") : $i18n.get("title_term_creation") }}
-
-
-
+ {{ $i18n.get('label_warning') }}
+
+
+ {{ $i18n.get('label_update_parent') }}
+
+ {{ form & form.id && form.id != 'new' ? $i18n.get("title_term_edit") : $i18n.get("title_term_creation") }}
-
+
-
+
+
+
0) ? renderListOfCollections(taxonomy.collections, taxonomy.metadata_by_collection) : $i18n.get('label_no_collections_using_taxonomy'),
autoHide: false,
+ html: true,
popperClass: ['tainacan-tooltip', 'tooltip', 'tainacan-repository-tooltip'],
placement: 'auto-start'
}"
v-html="(taxonomy.collections != undefined && taxonomy.collections.length != undefined && taxonomy.collections.length > 0) ? renderListOfCollections(taxonomy.collections, taxonomy.metadata_by_collection) : $i18n.get('label_no_collections_using_taxonomy')" />
+
+
+
+
' + this.$i18n.get('label_root_terms') + ': ' + total_terms['root'] + '
' + this.$i18n.get('label_used_by_items') + ': ' + total_terms['not_empty'];
+ },
deleteOneTaxonomy(taxonomyId) {
this.$buefy.modal.open({
parent: this,
@@ -401,6 +430,10 @@
}
}
+ .total-terms-header {
+ text-align: right;
+ }
+
diff --git a/src/views/admin/components/navigation/tainacan-repository-subheader.vue b/src/views/admin/components/navigation/tainacan-repository-subheader.vue
index 389735a5a..440119c2c 100644
--- a/src/views/admin/components/navigation/tainacan-repository-subheader.vue
+++ b/src/views/admin/components/navigation/tainacan-repository-subheader.vue
@@ -77,6 +77,19 @@
{{ $i18n.get('label_view_collection_on_website') }}
+
-
-
-
-
-
-
+
+
+
+
+
+
+
',
'after_title' => '
',
'before_value' => '