feat(admin): add NSFW flag to packs, remove intensity

Re-add is_explicit toggle on pack and dare pack forms labeled as
"NSFW". Show NSFW badge on pack cards and user enabled packs.

Remove all intensity/comfort level references from admin UI including
form fields, analytics charts, review dialog columns, AI generation
prompts/scoring, cherry-pick balancing, and settings toggles. The
database columns remain unchanged.
This commit is contained in:
jjbrunton committed 2026-01-27 22:50:46 +00:00
1 parent 14b0199625
commit e380c0a31c
32 files changed
+948 -1075

No files matched your search

+61 -45
View File
@@ -97,10 +97,10 @@ export function AuditLogsPage() {
<TableHeader>
<TableRow>
<TableHead className="w-40">Time</TableHead>
<TableHead className="w-32">Admin</TableHead>
<TableHead className="w-24">Action</TableHead>
<TableHead>Table</TableHead>
<TableHead>Changes</TableHead>
<TableHead className="hidden md:table-cell w-32">Admin</TableHead>
<TableHead className="hidden md:table-cell w-24">Action</TableHead>
<TableHead className="hidden lg:table-cell">Table</TableHead>
<TableHead className="hidden lg:table-cell">Changes</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -111,47 +111,63 @@ export function AuditLogsPage() {
</TableCell>
</TableRow>
) : (
logs.map((log) => (
<TableRow key={log.id}>
<TableCell className="text-sm text-muted-foreground">
{format(new Date(log.created_at), 'MMM d, h:mm a')}
</TableCell>
<TableCell>
<div className="text-sm font-medium">{log.admin_username || 'Unknown'}</div>
<div className="text-xs text-muted-foreground capitalize">{log.admin_role?.replace('_', ' ')}</div>
</TableCell>
<TableCell>
<Badge className={`${actionColors[log.action] || 'bg-gray-500'} text-white`}>
{log.action}
</Badge>
</TableCell>
<TableCell className="font-mono text-sm">
{log.table_name}
</TableCell>
<TableCell className="max-w-md">
{log.action === 'DELETE' && log.old_values && (
<code className="text-xs bg-red-500/20 text-red-300 px-2 py-1 rounded">
Deleted: {JSON.stringify(log.old_values).substring(0, 100)}...
</code>
)}
{log.action === 'INSERT' && log.new_values && (
<code className="text-xs bg-green-500/20 text-green-300 px-2 py-1 rounded">
Created: {JSON.stringify(log.new_values).substring(0, 100)}...
</code>
)}
{log.action === 'UPDATE' && log.changed_fields && (
<code className="text-xs bg-blue-500/20 text-blue-300 px-2 py-1 rounded">
Changed: {log.changed_fields.join(', ')}
</code>
)}
{log.action === 'UPDATE' && !log.changed_fields && (
<code className="text-xs bg-blue-500/20 text-blue-300 px-2 py-1 rounded">
Updated record
</code>
)}
</TableCell>
</TableRow>
))
logs.map((log) => {
const actionBadge = (
<Badge className={`${actionColors[log.action] || 'bg-gray-500'} text-white`}>
{log.action}
</Badge>
);
const changesContent = log.action === 'DELETE' && log.old_values ? (
<code className="text-xs bg-red-500/20 text-red-300 px-2 py-1 rounded">
Deleted: {JSON.stringify(log.old_values).substring(0, 100)}...
</code>
) : log.action === 'INSERT' && log.new_values ? (
<code className="text-xs bg-green-500/20 text-green-300 px-2 py-1 rounded">
Created: {JSON.stringify(log.new_values).substring(0, 100)}...
</code>
) : log.action === 'UPDATE' && log.changed_fields ? (
<code className="text-xs bg-blue-500/20 text-blue-300 px-2 py-1 rounded">
Changed: {log.changed_fields.join(', ')}
</code>
) : log.action === 'UPDATE' ? (
<code className="text-xs bg-blue-500/20 text-blue-300 px-2 py-1 rounded">
Updated record
</code>
) : null;
return (
<TableRow key={log.id}>
<TableCell className="text-sm text-muted-foreground">
{format(new Date(log.created_at), 'MMM d, h:mm a')}
<div className="mt-2 space-y-1 text-xs text-muted-foreground md:hidden">
<div className="flex items-center gap-2">
<span className="font-medium text-foreground">{log.admin_username || 'Unknown'}</span>
<span className="capitalize">{log.admin_role?.replace('_', ' ')}</span>
</div>
<div className="flex flex-wrap items-center gap-2">
{actionBadge}
<span className="font-mono">{log.table_name}</span>
</div>
{changesContent && <div>{changesContent}</div>}
</div>
</TableCell>
<TableCell className="hidden md:table-cell">
<div className="text-sm font-medium">{log.admin_username || 'Unknown'}</div>
<div className="text-xs text-muted-foreground capitalize">{log.admin_role?.replace('_', ' ')}</div>
</TableCell>
<TableCell className="hidden md:table-cell">
{actionBadge}
</TableCell>
<TableCell className="hidden lg:table-cell font-mono text-sm">
{log.table_name}
</TableCell>
<TableCell className="hidden lg:table-cell max-w-md">
{changesContent}
</TableCell>
</TableRow>
);
})
)}
</TableBody>
</Table>