diff --git a/static/nryg.less b/static/nryg.less index b0d0ec92..8b739974 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -18,10 +18,12 @@ h1, h2, h3, h4, h5, h6 { a { color: @link-color; + text-decoration: none; } -a:active { +a:hover, a:active { color: @link-color; + text-decoration: underline; } a:visited { @@ -32,14 +34,13 @@ blockquote { border-left: 3px solid @quote-color; color: @quote-color; background-color: rgba(red(@quote-color), green(@quote-color), blue(@quote-color), 0.1); - padding-left: 8px; + padding: 2px 4px 2px 8px; margin-left: 8px; } blockquote p { - padding-top: 4px; - padding-bottom: 2px; - margin: 6px 0; + padding-top: 2px; + margin: 4px 0; } blockquote.spoiler { @@ -171,13 +172,13 @@ nav { } @media (min-width:600px) { - .desktop-only { + .mobile-only { display: none; } } @media (max-width:600px) { - .mobile-only { + .desktop-only { display: none; } } @@ -570,6 +571,28 @@ nav { } } +.diario blockquote { + display: grid; + + .left { + grid-column: 1; + } + + .right { + grid-column: 2; + text-align: right; + margin-top: auto; + } + + cite { + font-size: smaller; + } + + .entry-id { + text-align: right; + } +} + #edit-css { font-size: medium; } \ No newline at end of file diff --git a/templates/components/diarioentry.html b/templates/components/diarioentry.html new file mode 100644 index 00000000..5b3e999b --- /dev/null +++ b/templates/components/diarioentry.html @@ -0,0 +1,13 @@ +
+
+

+ {{ entry.text }} +

+

+ — {% if entry.author is not none %}{{ entry.author.royal.username }}{% else %}Anonimo{% endif %}, {{ entry.timestamp.strftime('%Y-%m-%d %H:%M:%S %Z') }} {% if entry.saver is not none and entry.saver != entry.author %}(salvato da {{ entry.saver.royal.username }}){% endif %} +

+
+
+ #{{ entry.id }} +
+
\ No newline at end of file diff --git a/templates/diario.html b/templates/diario.html new file mode 100644 index 00000000..353dfed8 --- /dev/null +++ b/templates/diario.html @@ -0,0 +1,16 @@ +{% extends 'base.html' %} + +{% block pagetitle %} + Diario +{% endblock %} + +{% block body %} +

+ Diario +

+
+ {% for entry in entries %} + {% include "components/diarioentry.html" %} + {% endfor %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/main.html b/templates/main.html index 49c85983..e8a66b20 100644 --- a/templates/main.html +++ b/templates/main.html @@ -33,4 +33,8 @@
  • {{ page.key }}
  • {% endfor %} +

    Diario

    + {% endblock %} \ No newline at end of file diff --git a/webserver.py b/webserver.py index b743b54a..00974ae3 100644 --- a/webserver.py +++ b/webserver.py @@ -236,6 +236,14 @@ def page_wiki(key: str): return redirect(url_for("page_wiki", key=key)) +@app.route("/diario") +def page_diario(): + db_session = db.Session() + diario_entries = db_session.query(db.Diario).all() + db_session.close() + return render_template("diario.html", config=config, entries=diario_entries) + + if __name__ == "__main__": try: app.run(host="0.0.0.0", port=1235, debug=__debug__)