show deprecated warning for country states

This commit is contained in:
HB9HIL
2024-12-13 11:53:40 +01:00
parent 1150c457ac
commit a0fcb38e5b
2 changed files with 13 additions and 5 deletions

View File

@@ -51,7 +51,9 @@
var lang_qrbcalc_title = '<?= __("Compute QRB and QTF"); ?>';
var lang_qrbcalc_errmsg = '<?= __("Error in locators. Please check."); ?>';
var lang_general_refresh_list = '<?= __("Refresh List"); ?>';
var lang_general_word_please_wait = "<?= __("Please Wait ..."); ?>"
var lang_general_word_please_wait = "<?= __("Please Wait ..."); ?>";
var lang_general_states_deprecated = "<?= _pgettext("Word for country states that are deprecated but kept for legacy reasons.", "deprecated"); ?>";
</script>
<!-- General JS Files used across Wavelog -->

View File

@@ -950,10 +950,16 @@ function statesDropdown(states, set_state = null, dropdown = '#stateDropdown') {
if (states.status == 'ok') {
dropdown.prop('disabled', false);
$.each(states.data, function(index, state) {
var option = $('<option>', {
value: state.state,
text: state.subdivision + ' (' + state.state + ')'
});
var d_text = '';
if (state.deprecated == '1') {
d_text = '\u26A0\uFE0F [' + lang_general_states_deprecated + '] - ';
}
if (state.state == set_state || state.deprecated != '1') {
var option = $('<option>', {
value: state.state,
text: d_text + state.subdivision + ' (' + state.state + ')'
});
}
dropdown.append(option);
});
$(dropdown).val(set_state);