From 5cceec5c405985c527a8f2dc162bdc9fcbbf6f43 Mon Sep 17 00:00:00 2001 From: kalugin66 Date: Sun, 26 Jul 2026 18:18:48 +0500 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=B1=D1=85=D0=B0=D0=B7=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/data/cities/AB.js | 6 ++++++ public/js/reviews.js | 41 ---------------------------------------- 2 files changed, 6 insertions(+), 41 deletions(-) create mode 100644 public/data/cities/AB.js diff --git a/public/data/cities/AB.js b/public/data/cities/AB.js new file mode 100644 index 0000000..0c7ba42 --- /dev/null +++ b/public/data/cities/AB.js @@ -0,0 +1,6 @@ +const CITIES_AB = [ + "Сухум", "Гагра", "Гудаута", "Пицунда", "Новый Афон", + "Очамчыра", "Ткуарчал", "Гал", "Мгудзырхуа", "Цандрыпш", + "Гюльрыпш", "Бзыбь", "Лдзаа", "Алахадзы", "Эшера", + "Агудзера", "Приморское", "Дурипш", "Лыхны", "Отхара" +]; diff --git a/public/js/reviews.js b/public/js/reviews.js index 776088d..c636cbd 100644 --- a/public/js/reviews.js +++ b/public/js/reviews.js @@ -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');