mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 21:44:21 +00:00
68 lines
No EOL
2.5 KiB
HTML
68 lines
No EOL
2.5 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block prehead %}
|
|
{% if wiki_page %}
|
|
<meta name="author" content="{{ wiki_log.editor.username }}">
|
|
<meta name="description" content="{{ wiki_page.content[:97] }}...">
|
|
{% endif %}
|
|
<script>
|
|
let edits = false;
|
|
|
|
function newEdit() {
|
|
edits = true;
|
|
}
|
|
|
|
function onEnter() {
|
|
edits = false;
|
|
}
|
|
|
|
function onExit() {
|
|
edits = true;
|
|
}
|
|
|
|
window.onbeforeunload = function() {
|
|
return edits ? "Modifiche non salvate" : null;
|
|
}
|
|
</script>
|
|
{% endblock %}
|
|
|
|
{% block pagetitle %}
|
|
{{ key }}
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
<div class="wiki">
|
|
<h1>
|
|
{{ key }}
|
|
</h1>
|
|
{% if wiki_page %}
|
|
<div class="wiki-content">
|
|
{{ converted_md }}
|
|
</div>
|
|
<div class="wiki-log">
|
|
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>
|
|
{% endif %}
|
|
{% if wiki_page is none or not wiki_page.locked %}
|
|
{% if g.user %}
|
|
<div class="wiki-edit">
|
|
<h4>Modifica</h4>
|
|
<form action="{{ url_for('page_wiki_edit', key=key) }}" method="POST">
|
|
<textarea oninput="newEdit()" class="content" name="content" placeholder="Inserisci il Markdown per la pagina qui.">{% if wiki_page %}{{ wiki_page.content }}{% endif %}</textarea><br>
|
|
<input class="reason" name="reason" type="text" placeholder="Motivo per la modifica"><br>
|
|
<input class="submit" type="submit" onmouseenter="onEnter()" onmouseleave="onExit()" value="Invia">
|
|
</form>
|
|
</div>
|
|
{% endif %}
|
|
{% else %}
|
|
<div class="wiki-locked">
|
|
<span>🔒 Pagina bloccata: non possono essere effettuate ulteriori modifiche.</span>
|
|
</div>
|
|
{% endif %}
|
|
{% if g.user.role == "Admin" %}
|
|
<form action="{{ url_for('page_wiki_lock', key=key) }}" method="POST">
|
|
<input class="submit" type="submit" value="Blocca/Sblocca pagina">
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %} |