WIP: Move to Jinja2

This commit is contained in:
Skia
2016-02-01 17:35:55 +01:00
parent abb8dc0c5e
commit 03bc0973fe
38 changed files with 261 additions and 217 deletions

View File

@@ -0,0 +1,31 @@
{% extends "core/page.jinja" %}
{% block head %}
{{ super() }}
<script>
function make_preview() {
$.ajax({
url: "{{ url('core:api_markdown') }}",
method: "GET",
data: { text: $("#id_content").val() }
}).done(function (msg) {
$("#preview").html(msg);
});
}
</script>
{% endblock %}
{% 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() }}
<p><input type="button" value="Preview" onclick="javascript:make_preview();" /></p>
<p><input type="submit" value="Save!" /></p>
</form>
<div id="preview">
</div>
{% endblock %}