mirror of
https://github.com/ae-utbm/sith.git
synced 2025-10-20 19:58:31 +00:00
WIP: Move to Jinja2
This commit is contained in:
31
core/templates/core/pagerev_edit.jinja
Normal file
31
core/templates/core/pagerev_edit.jinja
Normal 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 %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user