mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Add support for locked wiki pages
This commit is contained in:
parent
5e507fbb5e
commit
eb08b51e59
3 changed files with 15 additions and 20 deletions
11
db.py
11
db.py
|
@ -1015,17 +1015,6 @@ class WikiLog(Base):
|
||||||
return f"<WikiLog {self.edit_id}>"
|
return f"<WikiLog {self.edit_id}>"
|
||||||
|
|
||||||
|
|
||||||
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):
|
class Event(Base):
|
||||||
__tablename__ = "events"
|
__tablename__ = "events"
|
||||||
|
|
||||||
|
|
|
@ -870,7 +870,7 @@ img {
|
||||||
|
|
||||||
.wiki {
|
.wiki {
|
||||||
|
|
||||||
.wiki-log {
|
.wiki-log, .wiki-locked {
|
||||||
font-family: "Consolas", "Source Code Pro", monospace;
|
font-family: "Consolas", "Source Code Pro", monospace;
|
||||||
font-size: small;
|
font-size: small;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
Ultima modifica di <span class="last-author"><a href="/profile/{{ wiki_log.editor.username }}">{{ wiki_log.editor.username }}</a></span> alle <span class="last-timestamp">{{ wiki_log.timestamp.strftime('%Y-%m-%d %H:%M:%S %Z') }}</span>{% if wiki_log.reason %}, motivo: <span class="last-reason">{{ wiki_log.reason }}</span>{% endif %}
|
Ultima modifica di <span class="last-author"><a href="/profile/{{ wiki_log.editor.username }}">{{ wiki_log.editor.username }}</a></span> alle <span class="last-timestamp">{{ wiki_log.timestamp.strftime('%Y-%m-%d %H:%M:%S %Z') }}</span>{% if wiki_log.reason %}, motivo: <span class="last-reason">{{ wiki_log.reason }}</span>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if g.user and not wiki_page.locked %}
|
{% if not wiki_page.locked %}
|
||||||
|
{% if g.user %}
|
||||||
<div class="wiki-edit">
|
<div class="wiki-edit">
|
||||||
<h4>Modifica</h4>
|
<h4>Modifica</h4>
|
||||||
<form action="{{ url_for('page_wiki', key=key) }}" method="POST">
|
<form action="{{ url_for('page_wiki', key=key) }}" method="POST">
|
||||||
|
@ -53,5 +54,10 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<div class="wiki-locked">
|
||||||
|
<span>🔒 Pagina bloccata: non possono essere effettuate ulteriori modifiche.</span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in a new issue