Integrate SimpleMDE editor into the blog create and update pages to enhance the user experience with a WYSIWYG markdown editor. This change includes adding the necessary CSS and JS links to the templates and applying specific styles for both light and dark modes in the stylesheet. The SimpleMDE editor provides a more intuitive interface for users to write and format their blog posts, addressing the requirement outlined in the issue description. The changes ensure that the editor is initialized on the textarea elements for both creating and updating blog posts. Related to Issue ID: FLAS-30
20 lines
750 B
HTML
20 lines
750 B
HTML
{% extends 'base.html' %}
|
|
|
|
{% block header %}
|
|
<h1>{% block title %}New Post{% endblock %}</h1>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<form method="post">
|
|
<label for="title">Title</label>
|
|
<input name="title" id="title" value="{{ request.form['title'] }}" required>
|
|
<label for="body">Body (Markdown supported)</label>
|
|
<textarea name="body" id="body">{{ request.form['body'] }}</textarea>
|
|
<input type="submit" value="Save">
|
|
</form>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
|
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
|
<script>
|
|
var simplemde = new SimpleMDE({ element: document.getElementById("body") });
|
|
</script>
|
|
{% endblock %}
|