2016-02-01 16:35:55 +00:00
|
|
|
{% extends "core/page.jinja" %}
|
2015-11-25 13:45:18 +00:00
|
|
|
|
2016-01-08 16:11:38 +00:00
|
|
|
{% block head %}
|
2016-02-01 16:35:55 +00:00
|
|
|
{{ super() }}
|
2016-01-11 08:56:42 +00:00
|
|
|
<script>
|
|
|
|
function make_preview() {
|
2017-04-12 17:19:25 +00:00
|
|
|
text = $("#id_content").val();
|
|
|
|
console.log("Rendering text: " + text);
|
2016-01-11 08:56:42 +00:00
|
|
|
$.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 }}"}
|
2016-01-11 08:56:42 +00:00
|
|
|
}).done(function (msg) {
|
|
|
|
$("#preview").html(msg);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
2016-01-08 16:11:38 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
2015-11-25 13:45:18 +00:00
|
|
|
{% 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>
|
2017-03-08 12:25:23 +00:00
|
|
|
<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>
|
2015-11-25 13:45:18 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
|