here lies david saint evans

revamp-ui
lza_menace 2 years ago
parent e6733cd939
commit 950259450e

@ -26,6 +26,7 @@ def index():
crypto = request.args.get("chain", "monero") crypto = request.args.get("chain", "monero")
onion = request.args.get("onion", False) onion = request.args.get("onion", False)
i2p = request.args.get("i2p", False) i2p = request.args.get("i2p", False)
country = request.args.get('country')
show_all = "true" == request.args.get("all", "false") show_all = "true" == request.args.get("all", "false")
web_compatible = request.args.get("cors", False) web_compatible = request.args.get("cors", False)
highest_block = get_highest_block(nettype, crypto) highest_block = get_highest_block(nettype, crypto)
@ -52,9 +53,6 @@ def index():
if i2p: if i2p:
nodes = nodes.where(Node.is_i2p == True) nodes = nodes.where(Node.is_i2p == True)
nodes = [n for n in nodes]
shuffle(nodes)
countries = {} countries = {}
for node in nodes: for node in nodes:
c = node.country_code c = node.country_code
@ -64,6 +62,14 @@ def index():
countries[c] = 0 countries[c] = 0
countries[c] += 1 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( return render_template(
"index.html", "index.html",
nodes=nodes, nodes=nodes,

@ -5,6 +5,14 @@ body {
font-size: 14px; font-size: 14px;
} }
.top-section {
padding: 3rem 1.5rem 0 1.5rem;
}
.bottom-section {
padding: 1rem 1.5rem;
}
.checkbox:hover, .radio:hover { .checkbox:hover, .radio:hover {
color: #f9f9f9; color: #f9f9f9;
} }

@ -4,8 +4,7 @@
<div class="container"> <div class="container">
<div class="columns top-section">
<div class="columns section">
<div class="column"> <div class="column">
<h2 class="title is-4">Add A Node</h2> <h2 class="title is-4">Add A Node</h2>
<form method="POST" action="{{ url_for('meta.add') }}" id="addNodeForm"> <form method="POST" action="{{ url_for('meta.add') }}" id="addNodeForm">
@ -70,8 +69,7 @@
</form> </form>
</div> </div>
</div> </div>
<div id="nodes" class="bottom-section">
<div id="nodes" class="section">
{% if (nodes | length) == 0 %} {% if (nodes | length) == 0 %}
<div class="section"> <div class="section">
<h1 class="title is-5">No nodes in the database yet...</h1> <h1 class="title is-5">No nodes in the database yet...</h1>
@ -100,11 +98,17 @@
</p> </p>
{% for country in countries %} {% for country in countries %}
{% if 'country' in request.args %}
<a href="{{ request.path }}?{{ request.args | pop_arg('country') }}&country={{ country }}">
{% else %}
<a href="{% if request.args %}{{ request.url }}&{% else %}?{% endif %}country={{ country}}">
{% endif %}
<span class="tag is-dark"> <span class="tag is-dark">
<span class="fflag fflag-{{ country }} ff-md m-4" title="{{ country }}"></span> <span class="fflag fflag-{{ country }} ff-md m-4" title="{{ country }}"></span>
{{ country }} {{ country }}
({{ countries[country] }}) ({{ countries[country] }})
</span> </span>
</a>
{% endfor %} {% endfor %}
<br> <br>

Loading…
Cancel
Save