Sith/core/templates/core/pagerev_edit.jinja
2016-08-10 05:48:06 +02:00

32 lines
758 B
Django/Jinja

{% extends "core/page.jinja" %}
{% block head %}
{{ super() }}
<script>
function make_preview() {
$.ajax({
url: "{{ url('api:api_markdown') }}",
method: "GET",
data: { text: $("#id_content").val() }
}).done(function (msg) {
$("#preview").html(msg);
});
}
</script>
{% endblock %}
{% block page %}
<h2>{% trans %}Edit page{% endtrans %}</h2>
<form action="{{ url('core:page_edit', page_name=page.get_full_name()) }}" method="post">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="button" value="{% trans %}Preview{% endtrans %}" onclick="javascript:make_preview();" /></p>
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
<div id="preview">
</div>
{% endblock %}