diff --git a/xmrnodes/app.py b/xmrnodes/app.py index efa4f74..9583273 100644 --- a/xmrnodes/app.py +++ b/xmrnodes/app.py @@ -5,6 +5,7 @@ import re import logging import click from os import makedirs +from random import shuffle from datetime import datetime, timedelta from flask import Flask, request, redirect from flask import render_template, flash, url_for @@ -27,18 +28,9 @@ app.secret_key = app.config["SECRET_KEY"] @app.route("/", methods=["GET", "POST"]) def index(): form = SubmitNode() - itp = 10 - page = request.args.get("page", 1) - try: - page = int(page) - except: - flash("Wow, wtf hackerman. Cool it.") - page = 1 - nettype = request.args.get("nettype", "mainnet") crypto = request.args.get("crypto", "monero") onion = request.args.get("onion", False) - nodes = Node.select().where( Node.validated==True ).where( @@ -51,13 +43,12 @@ def index(): if onion: nodes = nodes.where(Node.is_tor==True) - paginated = nodes.paginate(page, itp) - total_pages = int(nodes.count() / itp) + 1 + nodes = [n for n in nodes] + shuffle(nodes) + return render_template( "index.html", - nodes=paginated, - page=page, - total_pages=total_pages, + nodes=nodes, form=form ) diff --git a/xmrnodes/static/css/style.css b/xmrnodes/static/css/style.css index ccfa420..d965ce5 100644 --- a/xmrnodes/static/css/style.css +++ b/xmrnodes/static/css/style.css @@ -69,3 +69,13 @@ input[type="text"] { .current-page-btn { background-color: #b8b8b8; } + +.xmrnodes { + width: 95%; + margin: auto; + font-size: .83em; +} + +#nodes { + padding-top: 1em; +} diff --git a/xmrnodes/templates/base.html b/xmrnodes/templates/base.html index 86e8cf0..dc299e3 100644 --- a/xmrnodes/templates/base.html +++ b/xmrnodes/templates/base.html @@ -41,16 +41,21 @@ {% endif %} {% endwith %} +
+ {% block content %} {% endblock %}