Reviews some of the metadata options_as_html.

This commit is contained in:
mateuswetah 2021-09-02 12:17:21 -03:00
parent c468bc345d
commit d288e0e1fc
3 changed files with 16 additions and 3 deletions

View File

@ -122,10 +122,10 @@ class Taxonomy extends Metadata_Type {
unset($options['visible_options_list']); unset($options['visible_options_list']);
$form_labels = $this->get_form_labels(); $form_labels = $this->get_form_labels();
foreach($options as $option_label => $option_value) { foreach($options as $option_label => $option_value) {
if ( $option_value != '' ) { if ( $option_value != '' && $option_label != 'taxonomy' ) {
$options_as_html .= '<div class="field"><div class="label">' . ( isset($form_labels[$option_label]) && isset($form_labels[$option_label]['title']) ? $form_labels[$option_label]['title'] : $option_label ) .'</div>'; $options_as_html .= '<div class="field"><div class="label">' . ( isset($form_labels[$option_label]) && isset($form_labels[$option_label]['title']) ? $form_labels[$option_label]['title'] : $option_label ) .'</div>';
$readable_option_value = ''; $readable_option_value = '';

View File

@ -24,7 +24,16 @@
v-if="insertOptions != ''" v-if="insertOptions != ''"
class="field"> class="field">
<div class="label">{{ $i18n.get('label_insert_options') }}</div> <div class="label">{{ $i18n.get('label_insert_options') }}</div>
<div class="value">{{ insertOptions }}</div> <div class="value">
{{ insertOptions }}
<span
v-if="metadatum.multiple === 'yes' &&
metadatum.cardinality != undefined &&
metadatum.cardinality != 0 &&
metadatum.cardinality != ''">
&nbsp;({{ $i18n.getWithVariables('label_maximum_of_%s_values', [ metadatum.cardinality ]) }})
</span>
</div>
</div> </div>
<div <div
v-if="metadatum.options_as_html" v-if="metadatum.options_as_html"
@ -94,6 +103,9 @@ export default {
.value { .value {
font-size: 0.9em; font-size: 0.9em;
} }
&:only-child {
column-span: all;
}
} }
} }
</style> </style>

View File

@ -593,6 +593,7 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_back_to_related_item' => __( 'Back to related item', 'tainacan'), 'label_back_to_related_item' => __( 'Back to related item', 'tainacan'),
'label_options_of_the_%s_metadata_type' => __( 'Options of the %s metadata type', 'tainacan'), 'label_options_of_the_%s_metadata_type' => __( 'Options of the %s metadata type', 'tainacan'),
'label_advanced_metadata_options' => __( 'Advanced metadata options', 'tainacan'), 'label_advanced_metadata_options' => __( 'Advanced metadata options', 'tainacan'),
'label_maximum_of_%s_values' => __( 'maximum of %s values', 'tainacan'),
// Instructions. More complex sentences to guide user and placeholders // Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ), 'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),