New files
templates/app/layouts/base_form.html
{% extends "app/base.html" %}
{% block content %}
{% endblock content %}
{% block page_js %}
<script>
const contentMarkdown = new EasyMDE({
element: document.getElementById("id_content"),
spellChecker: false,
status: false,
toolbar: false,
forceSync: true
});
</script>
{% endblock page_js %}
Modified files
templates/app/article_update.html
---
+++
@@ -1,4 +1,4 @@
-{% extends "app/base.html" %}
+{% extends "app/layouts/base_form.html" %}
{% block content %}
<h1>Edit Article</h1>
@@ -12,16 +12,4 @@
<a href="{% url 'home' %}">Back to list</a>
<a href="{% url 'delete_article' article.id %}">Delete article</a>
-{% endblock content %}
-
-{% block page_js %}
-<script>
-const contentMarkdown = new EasyMDE({
- element: document.getElementById("id_content"),
- spellChecker: false,
- status: false,
- toolbar: false,
- forceSync: true
-});
-</script>
-{% endblock page_js %}+{% endblock content %}
templates/app/article_create.html
---
+++
@@ -1,4 +1,4 @@
-{% extends "app/base.html" %}
+{% extends "app/layouts/base_form.html" %}
{% block content %}
<h1>Create Article</h1>
@@ -9,16 +9,4 @@
</form>
<a href="{% url 'home' %}">Back to list</a>
-{% endblock content %}
-
-{% block page_js %}
-<script>
-const contentMarkdown = new EasyMDE({
- element: document.getElementById("id_content"),
- spellChecker: false,
- status: false,
- toolbar: false,
- forceSync: true
-});
-</script>
-{% endblock page_js %}+{% endblock content %}