Fix countries order in dropdown controls

This commit is contained in:
Claude Brisson
2024-04-13 23:28:06 +02:00
parent 7837daf973
commit 02c6730336
3 changed files with 4 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ class CountriesTool {
}
}
public fun getCountries() = countries.entries
public fun getCountries() = countries.entries.sortedBy { it.value }
companion object {
private val langHeaderParser = Regex("(?:\\b(\\*|[a-z]{2})(?:(?:_|-)([a-z]{2}))?)(?:;q=([0-9.]+))?", RegexOption.IGNORE_CASE)

View File

@@ -197,3 +197,4 @@ or ou
on our discord channel sur notre canal discord
standalone installer for Windows with Java included installateur Windows avec Java inclus
(please ensure that your Windows user has administrative rights). (svp assurez-vous que l'utilisateur a les droits d'administration Windows).
AGA rules Règles AGA

View File

@@ -25,9 +25,9 @@
<span class="info"></span>
<select name="country" placeholder="country">
<option></option>
#set($defaultCountry = $translate.defaultCountry[$request.lang])
#set($defaultCountry = $countries.country.first)
#foreach($country in $countries.countries)
<option value="$country.key" #if($tour && $country.key == $tour.country.toLowerCase() || !$tour && $country.key == $defaultCountry) selected #end>$country.value</option>
<option value="$country.key" #if($tour && $country.key.toLowerCase() == $tour.country.toLowerCase() || !$tour && $country.key.toLowerCase() == $defaultCountry.toLowerCase()) selected #end>$country.value</option>
#end
</select>
</div>