For each node, display the country's flag in addition to its name.

Flag images are sourced from here:

  https://flaglog.com/country-codes

Placing the flags in a subdirectory of `./static` for good housekeeping
requires a change to the location matching of the `nginx` configuration;
otherwise they will not be found.

Change:

```
location ~ /(?![^/]*\.(?:css|js|png|html)(?:$|\?)) {
```

to:

```
location ~ /(?!([^/]*|flags/[^/]*)\.(?:css|js|png|html)(?:$|\?)) {
```
This commit is contained in:
Ian Macdonald 2022-06-30 10:01:05 +02:00
parent 3c55bb8106
commit 82a3fcae56
No known key found for this signature in database
GPG Key ID: AE4C20556BA626FA
278 changed files with 6 additions and 4 deletions

View File

@ -199,6 +199,7 @@ def get_sns(sns_future, info_future):
sn['contribution_required'] = sn['staking_requirement'] - sn['total_contributed']
sn['num_contributions'] = sum(len(x['locked_contributions']) for x in sn['contributors'] if 'locked_contributions' in x)
sn['country'] = geoip.city(sn['public_ip']).country.names['en']
sn['iso_code'] = geoip.city(sn['public_ip']).country.iso_code
if sn['active']:
active_sns.append(sn)
@ -593,6 +594,7 @@ def show_sn(pubkey, more_details=False):
# Available open contribution spots:
sn['num_open_spots'] = 0 if sn['total_reserved'] >= sn['staking_requirement'] else max(0, 4 - sn['num_contributions'] - sn['num_reserved_spots'])
sn['country'] = geoip_c.city(sn['public_ip']).country.names['en']
sn['iso_code'] = geoip_c.city(sn['public_ip']).country.iso_code
city = geoip_c.city(sn['public_ip']).city
if city.names:
sn['city'] = city.names['en']

BIN
static/flags/AC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/flags/AD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

BIN
static/flags/AE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

BIN
static/flags/AF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

BIN
static/flags/AG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
static/flags/AI-alt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

BIN
static/flags/AI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

BIN
static/flags/AL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

BIN
static/flags/AM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
static/flags/AO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
static/flags/AQ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

BIN
static/flags/AR.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

BIN
static/flags/AS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/flags/AT.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

BIN
static/flags/AU.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

BIN
static/flags/AW.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

BIN
static/flags/AX.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
static/flags/AZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

BIN
static/flags/BA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

BIN
static/flags/BB.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

BIN
static/flags/BD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
static/flags/BE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

BIN
static/flags/BF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

BIN
static/flags/BG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
static/flags/BH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

BIN
static/flags/BI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

BIN
static/flags/BJ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
static/flags/BL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/flags/BM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/flags/BN.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/flags/BO-alt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
static/flags/BO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
static/flags/BQ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

BIN
static/flags/BR.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

BIN
static/flags/BS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

BIN
static/flags/BT.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/flags/BV.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

BIN
static/flags/BW.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

BIN
static/flags/BY-alt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

BIN
static/flags/BY.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

BIN
static/flags/BZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

BIN
static/flags/CA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

BIN
static/flags/CC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

BIN
static/flags/CD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

BIN
static/flags/CF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

BIN
static/flags/CG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

BIN
static/flags/CH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

BIN
static/flags/CI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

BIN
static/flags/CK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
static/flags/CL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

BIN
static/flags/CM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

BIN
static/flags/CN.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
static/flags/CO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

BIN
static/flags/CP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
static/flags/CR.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

BIN
static/flags/CU.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

BIN
static/flags/CV.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

BIN
static/flags/CW.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

BIN
static/flags/CX.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/flags/CY.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

BIN
static/flags/CZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

BIN
static/flags/DE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
static/flags/DG-alt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

BIN
static/flags/DG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
static/flags/DJ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

BIN
static/flags/DK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

BIN
static/flags/DM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

BIN
static/flags/DO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

BIN
static/flags/DZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

BIN
static/flags/EA-alt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/flags/EA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

BIN
static/flags/EC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

BIN
static/flags/EE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
static/flags/EG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

BIN
static/flags/EH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

BIN
static/flags/ER.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/flags/ES.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

BIN
static/flags/ET.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

BIN
static/flags/EU.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

BIN
static/flags/FI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

BIN
static/flags/FJ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/flags/FK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/flags/FM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

BIN
static/flags/FO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
static/flags/FR.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

BIN
static/flags/GA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
static/flags/GB.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

BIN
static/flags/GD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

BIN
static/flags/GE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

BIN
static/flags/GF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

BIN
static/flags/GG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

BIN
static/flags/GH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

BIN
static/flags/GI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

BIN
static/flags/GL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

BIN
static/flags/GM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

BIN
static/flags/GN.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

BIN
static/flags/GP-alt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

BIN
static/flags/GP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

BIN
static/flags/GQ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Some files were not shown because too many files have changed in this diff Show More