Fase 3 (isla): historial de baneos en React/TSX

ban_history_view construye ban_rows (baneos de cuenta + personaje combinados, con
estado Activo/Inactivo y origen Cuenta/Personaje) y los pasa por json_script a la
tabla genérica HistoryTable. Sustituye la tabla Django con doble bucle.

Verificado: check OK, render de la isla con datos, redirige a login sin sesión.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 21:54:12 +00:00
parent 230d401c75
commit ff458379b0
2 changed files with 21 additions and 67 deletions
+14 -1
View File
@@ -55,10 +55,23 @@ def ban_history_view(request):
account_bans, character_bans = get_ban_history(account_id)
def _row(b, origen):
return {
'fecha_baneo': b[0] or 'No disponible',
'fecha_desbaneo': b[1] or 'No disponible',
'motivo': b[2],
'estado': 'Activo' if b[3] == 1 else 'Inactivo',
'origen': f'{origen}: {b[4]}',
}
ban_rows = ([_row(b, 'Cuenta') for b in account_bans]
+ [_row(b, 'Personaje') for b in character_bans])
return render(request, 'account/ban_history.html', {
'account_bans': account_bans,
'character_bans': character_bans,
'now': datetime.now(),
'ban_rows': ban_rows,
'now': datetime.now(),
})
def security_history_view(request):
username = request.session.get('username')