Simplified

This commit is contained in:
julien
2026-03-09 14:27:52 +01:00
parent eff05b0971
commit 38d78d6df9
3 changed files with 260 additions and 33 deletions

View File

@@ -10,11 +10,13 @@ Créer un article
{% block content %}
{% if post is defined and post is not null and post.id > 0 %}
Éditer l'article
{% else %}
Créer un article
{% endif %}
<h2>
{% if post is defined and post is not null and post.id > 0 %}
Éditer l'article
{% else %}
Créer un article
{% endif %}
</h2>
{# Formulaire identifié pour le script JavaScript #}
<form id="articleForm" method="post" action="{{ action }}">
@@ -26,7 +28,8 @@ Créer un article
<p>
<label for="editor">Contenu<br>
<textarea id="editor" name="content" rows="6" required>{{ post.content|default('') }}</textarea>
{# <textarea id="editor" name="content" rows="6" required>{{ post.content|default('') }}</textarea> #}
<textarea id="editor" name="content" rows="6">{{ post.content|default('') }}</textarea>
</label>
</p>
@@ -52,4 +55,29 @@ Créer un article
{% endblock %}
{% block scripts %}
{% block scripts %}
<script src="/js/tinymce/tinymce.min.js" referrerpolicy="origin" crossorigin="anonymous"></script>
<script>
tinymce.init({
selector: '#editor',
base_url: '/js/tinymce', // assure le bon chemin relatif
license_key: 'gpl',
height: 400,
menubar: false,
plugins: [
'advlist', 'autolink', 'lists', 'link', 'image',
'charmap', 'preview', 'anchor', 'searchreplace',
'visualblocks', 'code', 'fullscreen',
'insertdatetime', 'media', 'table',
'help', 'wordcount'
],
toolbar: [
'undo redo | formatselect | bold italic underline |',
'alignleft aligncenter alignright alignjustify |',
'bullist numlist outdent indent | link image media |',
'removeformat | help'
].join(' '),
content_style: 'body {font-family:Helvetica,Arial,sans-serif;font-size:14px}'
});
</script>
{% endblock %}