абхазия
All checks were successful
Deploy hotel / deploy-kdo (push) Successful in 57s

This commit is contained in:
2026-07-26 18:18:48 +05:00
parent 26f24d31af
commit 5cceec5c40
2 changed files with 6 additions and 41 deletions

6
public/data/cities/AB.js Normal file
View File

@@ -0,0 +1,6 @@
const CITIES_AB = [
"Сухум", "Гагра", "Гудаута", "Пицунда", "Новый Афон",
"Очамчыра", "Ткуарчал", "Гал", "Мгудзырхуа", "Цандрыпш",
"Гюльрыпш", "Бзыбь", "Лдзаа", "Алахадзы", "Эшера",
"Агудзера", "Приморское", "Дурипш", "Лыхны", "Отхара"
];

View File

@@ -152,47 +152,6 @@ function populateCountrySelect() {
select.appendChild(opt);
});
const popularCodes = popularCountriesCache.map(c => c.country_code);
const popularCountries = [];
const otherCountries = [];
countriesCache.forEach(country => {
if (PINNED_CODES.includes(country.code)) return;
if (popularCodes.includes(country.code)) {
popularCountries.push(country);
} else {
otherCountries.push(country);
}
});
otherCountries.sort((a, b) => {
const nameA = I18n.currentLang === 'ru' ? a.nameRu : a.name;
const nameB = I18n.currentLang === 'ru' ? b.nameRu : b.name;
return nameA.localeCompare(nameB);
});
if (popularCountries.length > 0) {
const popularGroup = document.createElement('optgroup');
popularGroup.label = I18n.t('select.popular');
popularCountries.forEach(country => {
const opt = document.createElement('option');
opt.value = country.code;
opt.textContent = I18n.currentLang === 'ru' ? country.nameRu : country.name;
popularGroup.appendChild(opt);
});
select.appendChild(popularGroup);
}
const otherGroup = document.createElement('optgroup');
otherGroup.label = I18n.t('select.alphabetical');
otherCountries.forEach(country => {
const opt = document.createElement('option');
opt.value = country.code;
opt.textContent = I18n.currentLang === 'ru' ? country.nameRu : country.name;
otherGroup.appendChild(opt);
});
select.appendChild(otherGroup);
const otherCountryOpt = document.createElement('option');
otherCountryOpt.value = '__other__';
otherCountryOpt.textContent = I18n.t('form.another_country');