Files
NightSpire/forum/urls.py
T
Inna 2c30844bf7 Añade foro de comunidad integrado (app forum) con el diseño de NovaWoW
- app 'forum': portada (categorías/foros), ver foro y tema (paginado), crear tema,
  responder, editar/borrar posts y moderación (fijar, bloquear, mover, borrar/restaurar)
- lee/escribe la BD acore_web (5ª conexión, DB_NAME_WEB) por SQL directo, tablas
  forum_categories/forums/forum_topics/forum_posts/forum_reads (portado de NovaWeb-main)
- identidad = cuenta de juego en sesión; permisos simplificados por gmlevel
  (FORUM_MOD_GMLEVEL) en vez de la matriz group_level×permission del original
- saneado del HTML de posts con nh3 (evita el XSS del original); POST+CSRF en formularios
- plantillas con los partials del sitio; enlace 'FOROS' del menú apunta al foro interno
- sql/forum_schema.sql y docs/FORO.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 17:10:55 +00:00

38 lines
2.0 KiB
Python

from django.urls import path
from . import views
# Se mantienen los nombres de ruta del proyecto original para coherencia.
# El orden importa: las rutas con literales (topic/create/edit/post) van antes
# que la genérica forum/<int:forum_id>/...
urlpatterns = [
path('forum', views.index, name='app_forum'),
# Temas
path('forum/topic/<int:topic_id>/reply', views.reply_to_topic, name='forum_post_reply'),
path('forum/topic/<int:topic_id>/move', views.move_topic, name='forum_move_topic'),
path('forum/topic/<int:topic_id>/lock', views.lock_topic, name='forum_lock_topic'),
path('forum/topic/<int:topic_id>/unlock', views.unlock_topic, name='forum_unlock_topic'),
path('forum/topic/<int:topic_id>/sticky', views.toggle_sticky, name='forum_toggle_sticky'),
path('forum/topic/<int:topic_id>/restore', views.restore_topic, name='forum_restore_topic'),
path('forum/topic/delete/<int:topic_id>', views.delete_topic, name='forum_delete_topic'),
path('forum/topic/<int:topic_id>/<int:page>', views.view_topic, name='forum_topic'),
path('forum/topic/<int:topic_id>', views.view_topic, name='forum_topic_p1'),
# Posts
path('forum/post/update/<int:post_id>', views.update_post, name='forum_update_post'),
path('forum/post/delete/<int:post_id>', views.delete_post, name='forum_delete_post'),
path('forum/post/<int:post_id>/restore', views.restore_post, name='forum_restore_post'),
path('forum/edit/<int:post_id>', views.edit_post, name='forum_edit_post'),
# Crear tema
path('forum/create/<int:forum_id>/submit', views.submit_create_topic, name='forum_create_topic_submit'),
path('forum/create/<int:forum_id>', views.create_topic, name='forum_create_topic'),
# Ver foro (paginado) — genérica, al final
path('forum/<int:forum_id>/<int:page>', views.view_forum, name='forum_view'),
path('forum/<int:forum_id>', views.view_forum, name='forum_view_p1'),
# Perfil público
path('profile/<str:username>', views.profile, name='forum_profile'),
]