added tinymce editor
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</p>
|
||||
<p>
|
||||
<label>Contenu<br>
|
||||
<textarea name="content" rows="6" required>{{ post.content|default('') }}</textarea>
|
||||
<textarea id="editor" name="content" rows="6" required>{{ post.content|default('') }}</textarea>
|
||||
</label>
|
||||
</p>
|
||||
<button type="submit">
|
||||
@@ -36,3 +36,26 @@
|
||||
|
||||
<p><a href="/admin">Retour à l’admin</a></p>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
{# TinyMCE #}
|
||||
<script src="/js/tinymce/tinymce.min.js" referrerpolicy="origin" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#editor', // id du textarea
|
||||
license_key: 'gpl', // self-host TinyMCE under the GPL license and agree to its terms
|
||||
height: 400,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime media table paste code help wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | formatselect | bold italic underline | ' +
|
||||
'alignleft aligncenter alignright alignjustify | ' +
|
||||
'bullist numlist outdent indent | link image media | ' +
|
||||
'removeformat | help',
|
||||
content_style: 'body {font-family:Helvetica,Arial,sans-serif;font-size:14px}'
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user