Foro: editor CKEditor 5 en los mensajes y moderación por POST+CSRF
- forum/forms.py: TopicForm/ReplyForm/EditPostForm con CKEditor5Widget (rich text) - vistas crear/responder/editar pasan el form; el HTML del editor se sanea con nh3 - acciones de moderación (bloquear, fijar, mover, borrar/restaurar temas y posts) ahora exigen POST y van con CSRF; las plantillas usan formularios en vez de enlaces GET - docs/FORO.md actualizado Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,12 +14,13 @@
|
||||
<div class="forum-wrap forum-form">
|
||||
<form action="{% url 'forum_update_post' post_id=post.id %}" method="POST">
|
||||
{% csrf_token %}
|
||||
<textarea name="text" required>{{ post.text|safe }}</textarea>
|
||||
{{ form.text }}
|
||||
<div class="forum-actions">
|
||||
<button type="submit" class="forum-btn">Guardar cambios</button>
|
||||
<a class="forum-btn" href="{% url 'forum_topic_p1' topic_id=post.topic_id %}">Cancelar</a>
|
||||
</div>
|
||||
</form>
|
||||
{{ form.media }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user