1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +00:00
royalnet/templates/wikipage.html

49 lines
1.8 KiB
HTML
Raw Normal View History

2018-07-15 12:41:42 +00:00
{% extends 'base.html' %}
2018-07-22 15:15:29 +00:00
{% block prehead %}
2018-07-22 20:57:11 +00:00
{% if wiki_page %}
<meta name="author" content="{{ wiki_log.editor.username }}">
<meta name="description" content="{{ wiki_page.content[:97] }}...">
{% endif %}
2018-09-12 23:41:29 +00:00
<script>
var edits = false;
function newEdit() {
edits = true;
}
window.onbeforeunload = function() {
return edits ? "Modifiche non salvate" : null;
}
</script>
2018-07-22 15:15:29 +00:00
{% endblock %}
2018-07-15 12:41:42 +00:00
{% 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 %}
2018-07-15 12:41:42 +00:00
</div>
{% endif %}
{% if session.get('user_id', '') %}
<div class="wiki-edit">
2018-07-15 16:55:16 +00:00
<h4>Modifica</h4>
2018-07-15 12:41:42 +00:00
<form action="{{ url_for('page_wiki', key=key) }}" method="POST">
2018-09-12 23:41:29 +00:00
<textarea oninput="newEdit()" class="content" name="content" placeholder="Inserisci il Markdown per la pagina qui.">{% if wiki_page %}{{ wiki_page.content }}{% endif %}</textarea><br>
2018-07-15 12:41:42 +00:00
<input class="reason" name="reason" type="text" placeholder="Motivo per la modifica"><br>
<input class="submit" type="submit" value="Invia">
</form>
</div>
{% endif %}
</div>
{% endblock %}