diff --git a/xmrnodes/app.py b/xmrnodes/app.py index 9e02bb6..96915d4 100644 --- a/xmrnodes/app.py +++ b/xmrnodes/app.py @@ -27,7 +27,7 @@ app.secret_key = app.config["SECRET_KEY"] @app.route("/", methods=["GET", "POST"]) def index(): form = SubmitNode() - itp = 20 + itp = 10 page = request.args.get("page", 1) try: page = int(page) @@ -52,7 +52,7 @@ def index(): nodes = nodes.where(Node.is_tor==True) paginated = nodes.paginate(page, itp) - total_pages = nodes.count() / itp + total_pages = int(nodes.count() / itp) + 1 return render_template( "index.html", nodes=paginated, diff --git a/xmrnodes/static/css/style.css b/xmrnodes/static/css/style.css index 7cedb56..ccfa420 100644 --- a/xmrnodes/static/css/style.css +++ b/xmrnodes/static/css/style.css @@ -61,3 +61,11 @@ input[type="text"] { .container2 { padding: 4em; } + +.page-btn { + text-align: center; +} + +.current-page-btn { + background-color: #b8b8b8; +} diff --git a/xmrnodes/templates/index.html b/xmrnodes/templates/index.html index a2e7dfa..0323b7e 100644 --- a/xmrnodes/templates/index.html +++ b/xmrnodes/templates/index.html @@ -57,7 +57,7 @@ {{ node.last_height }} {{ node.datetime_checked | humanize }} {% for hc in node.healthchecks %} - {% if loop.index > loop.length - 11 %} + {% if loop.index > loop.length - 6 %} {% endif %} {% endfor %} @@ -66,12 +66,11 @@ {% endfor %} - {% if page > 1 %} - Back - {% endif %} - {% if page < total_pages and total_pages > 0 %} - Next - {% endif %} +
+ {% for p in range(1, total_pages + 1) %} + {{ p }} + {% endfor %} +
{% else %}

No nodes in the database yet...

{% endif %}