Add a visitor counter to legal page.

Signed-off-by: Ari Archer <ari@ari.lt>
This commit is contained in:
Arija A. 2024-11-26 19:15:54 +02:00
parent a94be7dffa
commit e5124505ae
4 changed files with 10 additions and 3 deletions

View file

@ -45,10 +45,13 @@ def get_status() -> t.Any:
@views.get("/guidelines", alias=True) @views.get("/guidelines", alias=True)
@views.get("/tos", alias=True) @views.get("/tos", alias=True)
@views.get("/tos.txt", alias=True) @views.get("/tos.txt", alias=True)
@views.get("/privacy/", alias=True)
@views.get("/privacy", alias=True)
@views.get("/legal/", alias=True)
@views.get("/legal") @views.get("/legal")
def legal() -> t.Any: def legal() -> t.Any:
"""Get general guidelines for ari.lt""" """Get general guidelines for ari.lt"""
return flask.render_template("legal.j2") return flask.render_template("legal.j2", visitor=models.Counter.first().inc().count)
@views.post("/status") @views.post("/status")

Binary file not shown.

View file

@ -4,7 +4,9 @@ This is the legal information of ari-web which covers topics such as logging pol
This document serves as an agreement between you and Ari-web parties, regarding the use and management of Ari-web's services. It outlines the expectations, responsibilities, and limitations for both parties. This document serves as an agreement between you and Ari-web parties, regarding the use and management of Ari-web's services. It outlines the expectations, responsibilities, and limitations for both parties.
Last updated: 2024-11-25 (YYYY-MM-DD) Visitor: 1609252
Created at: 2024-11-25 (YYYY-MM-DD)
Last updated: 2024-11-26 (YYYY-MM-DD)
OpenPGP signture of this document by the Authorative party's OpenPGP key: legal.sig (Note: Only the text content is what was signed in legal.txt) OpenPGP signture of this document by the Authorative party's OpenPGP key: legal.sig (Note: Only the text content is what was signed in legal.txt)
# Involved Parties # Involved Parties

View file

@ -60,7 +60,9 @@
</p> </p>
<ul> <ul>
<li>Last updated: 2024-11-25 (YYYY-MM-DD)</li> <li>Visitor: {{ visitor }}</li>
<li>Created at: 2024-11-25 (YYYY-MM-DD)</li>
<li>Last updated: 2024-11-26 (YYYY-MM-DD)</li>
<li> <li>
OpenPGP signture of this document by the <a href="{{ url_for("views.pgp") }}">Authorative party's OpenPGP key</a>: <a href="{{ url_for("static", filename="legal.sig") }}">legal.sig</a> OpenPGP signture of this document by the <a href="{{ url_for("views.pgp") }}">Authorative party's OpenPGP key</a>: <a href="{{ url_for("static", filename="legal.sig") }}">legal.sig</a>
(Note: Only the text content is what was signed in <a href="{{ url_for("static", filename="legal.txt") }}">legal.txt</a>) (Note: Only the text content is what was signed in <a href="{{ url_for("static", filename="legal.txt") }}">legal.txt</a>)