mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-24 18:14:22 +00:00
wiki: remove old markdown preview
This commit is contained in:
parent
bae45bcd38
commit
f6ab993b8d
@ -1,10 +1,5 @@
|
|||||||
{% extends "core/base.jinja" %}
|
{% extends "core/base.jinja" %}
|
||||||
{% from 'core/macros_pages.jinja' import markdown_preview_script, page_edit_form %}
|
{% from 'core/macros_pages.jinja' import page_edit_form %}
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
{{ super() }}
|
|
||||||
{{ markdown_preview_script(csrf_token) }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ page_edit_form(page, form, url('club:club_edit_page', club_id=page.club.id), csrf_token) }}
|
{{ page_edit_form(page, form, url('club:club_edit_page', club_id=page.club.id), csrf_token) }}
|
||||||
|
@ -22,29 +22,6 @@
|
|||||||
<form action="{{ url }}" method="post">
|
<form action="{{ url }}" method="post">
|
||||||
<input type="hidden" name="csrfmiddlewaretoken" value="{{ token }}">
|
<input type="hidden" name="csrfmiddlewaretoken" value="{{ token }}">
|
||||||
{{ form.as_p() }}
|
{{ form.as_p() }}
|
||||||
{{ markdown_preview_button() }}
|
|
||||||
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
|
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
|
||||||
</form>
|
</form>
|
||||||
<div id="preview" class="page_content">
|
|
||||||
</div>
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
{% macro markdown_preview_script(token) %}
|
|
||||||
<script>
|
|
||||||
function make_preview() {
|
|
||||||
text = $("#id_content").val();
|
|
||||||
console.log("Rendering text: " + text);
|
|
||||||
$.ajax({
|
|
||||||
url: "{{ url('api:api_markdown') }}",
|
|
||||||
method: "POST",
|
|
||||||
data: { text: text, csrfmiddlewaretoken: "{{ token }}"}
|
|
||||||
}).done(function (msg) {
|
|
||||||
$("#preview").html(msg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
{% macro markdown_preview_button() %}
|
|
||||||
<p><input type="button" value="{% trans %}Preview{% endtrans %}" onclick="javascript:make_preview();" /></p>
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
@ -1,10 +1,5 @@
|
|||||||
{% extends "core/page.jinja" %}
|
{% extends "core/page.jinja" %}
|
||||||
{% from 'core/macros_pages.jinja' import markdown_preview_script, page_edit_form %}
|
{% from 'core/macros_pages.jinja' import page_edit_form %}
|
||||||
|
|
||||||
{% block head %}
|
|
||||||
{{ super() }}
|
|
||||||
{{ markdown_preview_script(csrf_token) }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block page %}
|
{% block page %}
|
||||||
{{ page_edit_form(page, form, url('core:page_edit', page_name=page.get_full_name()), csrf_token) }}
|
{{ page_edit_form(page, form, url('core:page_edit', page_name=page.get_full_name()), csrf_token) }}
|
||||||
|
Loading…
Reference in New Issue
Block a user