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:
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Formularios del foro con el editor enriquecido CKEditor 5 (el mismo que usa el
|
||||
resto de NovaWoW). El HTML resultante se sanea con nh3 al guardar (ver views).
|
||||
"""
|
||||
|
||||
from django import forms
|
||||
from django_ckeditor_5.widgets import CKEditor5Widget
|
||||
|
||||
|
||||
class TopicForm(forms.Form):
|
||||
name = forms.CharField(
|
||||
max_length=45,
|
||||
widget=forms.TextInput(attrs={'placeholder': 'Título del tema', 'maxlength': 45}),
|
||||
)
|
||||
text = forms.CharField(widget=CKEditor5Widget(config_name='default'))
|
||||
|
||||
|
||||
class ReplyForm(forms.Form):
|
||||
text = forms.CharField(widget=CKEditor5Widget(config_name='default'))
|
||||
|
||||
|
||||
class EditPostForm(forms.Form):
|
||||
text = forms.CharField(widget=CKEditor5Widget(config_name='default'))
|
||||
Reference in New Issue
Block a user