From 950259450e2e193b3da18686d6d9b2c6e6fb9117 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Sun, 11 Jun 2023 01:58:02 -0700 Subject: [PATCH] here lies david saint evans --- xmrnodes/routes/meta.py | 12 +++++++++--- xmrnodes/static/css/main.css | 8 ++++++++ xmrnodes/templates/index.html | 22 +++++++++++++--------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/xmrnodes/routes/meta.py b/xmrnodes/routes/meta.py index e78b392..08ecbfc 100644 --- a/xmrnodes/routes/meta.py +++ b/xmrnodes/routes/meta.py @@ -26,6 +26,7 @@ def index(): crypto = request.args.get("chain", "monero") onion = request.args.get("onion", False) i2p = request.args.get("i2p", False) + country = request.args.get('country') show_all = "true" == request.args.get("all", "false") web_compatible = request.args.get("cors", False) highest_block = get_highest_block(nettype, crypto) @@ -52,9 +53,6 @@ def index(): if i2p: nodes = nodes.where(Node.is_i2p == True) - nodes = [n for n in nodes] - shuffle(nodes) - countries = {} for node in nodes: c = node.country_code @@ -63,6 +61,14 @@ def index(): if c not in countries: countries[c] = 0 countries[c] += 1 + + if country: + if country == '??': + country = None + nodes = nodes.where(Node.country_code == country) + + nodes = [n for n in nodes] + shuffle(nodes) return render_template( "index.html", diff --git a/xmrnodes/static/css/main.css b/xmrnodes/static/css/main.css index 24f979b..0a25981 100644 --- a/xmrnodes/static/css/main.css +++ b/xmrnodes/static/css/main.css @@ -5,6 +5,14 @@ body { font-size: 14px; } +.top-section { + padding: 3rem 1.5rem 0 1.5rem; +} + +.bottom-section { + padding: 1rem 1.5rem; +} + .checkbox:hover, .radio:hover { color: #f9f9f9; } diff --git a/xmrnodes/templates/index.html b/xmrnodes/templates/index.html index 2d59fd2..307686c 100644 --- a/xmrnodes/templates/index.html +++ b/xmrnodes/templates/index.html @@ -4,8 +4,7 @@
- -
+

Add A Node

@@ -70,8 +69,7 @@
- -
+
{% if (nodes | length) == 0 %}

No nodes in the database yet...

@@ -100,11 +98,17 @@

{% for country in countries %} - - - {{ country }} - ({{ countries[country] }}) - + {% if 'country' in request.args %} + + {% else %} + + {% endif %} + + + {{ country }} + ({{ countries[country] }}) + + {% endfor %}