Sith/core/templates/core/pagerev_edit.jinja

35 lines
953 B
Plaintext
Raw Normal View History

2016-02-01 16:35:55 +00:00
{% extends "core/page.jinja" %}
{% block head %}
2016-02-01 16:35:55 +00:00
{{ super() }}
<script>
function make_preview() {
2017-04-12 17:19:25 +00:00
text = $("#id_content").val();
console.log("Rendering text: " + text);
$.ajax({
2016-08-10 03:48:06 +00:00
url: "{{ url('api:api_markdown') }}",
2017-04-12 17:19:25 +00:00
method: "POST",
data: { text: text, csrfmiddlewaretoken: "{{ csrf_token }}"}
}).done(function (msg) {
$("#preview").html(msg);
});
}
</script>
{% endblock %}
{% block page %}
2016-07-19 17:03:16 +00:00
<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>
<a href="{{ url('core:page_delete', page_id=page.id)}}">{% trans %}Delete{% endtrans %}</a>
2016-07-19 17:03:16 +00:00
<div id="preview">
</div>
{% endblock %}