From eb08b51e593edf2affa06c65c53316fa9dca4b37 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 3 Feb 2019 17:57:46 +0100 Subject: [PATCH] Add support for locked wiki pages --- db.py | 11 ----------- static/nryg.less | 2 +- templates/wikipage.html | 22 ++++++++++++++-------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/db.py b/db.py index a0b39aa4..a7b2da9f 100644 --- a/db.py +++ b/db.py @@ -1015,17 +1015,6 @@ class WikiLog(Base): return f"" -class WikiAuthorization(Base): - __tablename__ = "wikiauthorization" - - royal_id = Column(Integer, ForeignKey("royals.id")) - royal = relationship("Royal", backref="profile_data", uselist=False, lazy="joined") - page_key = Column(String, ForeignKey("wikientries.key"), nullable=False) - page = relationship("WikiEntry", backref="edit_logs", lazy="joined") - - __table_args__ = (PrimaryKeyConstraint("royal_id", "page_key"),) - - class Event(Base): __tablename__ = "events" diff --git a/static/nryg.less b/static/nryg.less index a20c94a7..2d80138b 100644 --- a/static/nryg.less +++ b/static/nryg.less @@ -870,7 +870,7 @@ img { .wiki { - .wiki-log { + .wiki-log, .wiki-locked { font-family: "Consolas", "Source Code Pro", monospace; font-size: small; margin-bottom: 12px; diff --git a/templates/wikipage.html b/templates/wikipage.html index 2bd39d64..1be4fb73 100644 --- a/templates/wikipage.html +++ b/templates/wikipage.html @@ -43,14 +43,20 @@ Ultima modifica di {{ wiki_log.editor.username }} alle {{ wiki_log.timestamp.strftime('%Y-%m-%d %H:%M:%S %Z') }}{% if wiki_log.reason %}, motivo: {{ wiki_log.reason }}{% endif %} {% endif %} - {% if g.user and not wiki_page.locked %} -
-

Modifica

-
-
-
- -
+ {% if not wiki_page.locked %} + {% if g.user %} +
+

Modifica

+
+
+
+ +
+
+ {% endif %} + {% else %} +
+ 🔒 Pagina bloccata: non possono essere effettuate ulteriori modifiche.
{% endif %}