pagerev_edit.html 717 Bytes
Newer Older
1
2
{% extends "core/page.html" %}

3
4
{% block head %}
{{ block.super }}
5
6
7
8
9
10
11
12
13
14
15
<script>
function make_preview() {
    $.ajax({
        url: "{% url 'core:api_markdown' %}",
        method: "GET",
        data: { text: $("#id_content").val() }
    }).done(function (msg) {
        $("#preview").html(msg);
    });
}
</script>
16
17
{% endblock %}

18
19
20
21
22
{% block page %}
    <h2>Edit page</h2>
    <form action="{% url 'core:page_edit' page_name=page.get_full_name %}" method="post">
        {% csrf_token %}
        {{ form.as_p }}
23
        <p><input type="button" value="Preview" onclick="javascript:make_preview();" /></p>
24
25
        <p><input type="submit" value="Save!" /></p>
    </form>
26
27
    <div id="preview">
    </div>
28
29
30
31
{% endblock %}