mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 22:23:23 +00:00
32 lines
758 B
Django/Jinja
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 %}
|
|
|
|
|
|
|