mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 00:36:10 +01:00
Add user notification preferences and related API endpoints
- Introduced a new model `UserNotificationPreferences` to store user-specific notification dismissal settings. - Added context processor to include notification preferences in templates. - Implemented API endpoints to dismiss backup and AI scanner notifications permanently. - Updated front-end logic to handle notification dismissal via server-side checks and API calls. - Enhanced documentation to include a new Custom CSS Guide for theme customization.
This commit is contained in:
32
baseTemplate/migrations/0002_usernotificationpreferences.py
Normal file
32
baseTemplate/migrations/0002_usernotificationpreferences.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.29 on 2024-01-01 00:00
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('baseTemplate', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='UserNotificationPreferences',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('backup_notification_dismissed', models.BooleanField(default=False, help_text='Whether user has dismissed the backup notification')),
|
||||
('ai_scanner_notification_dismissed', models.BooleanField(default=False, help_text='Whether user has dismissed the AI scanner notification')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='notification_preferences', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'User Notification Preferences',
|
||||
'verbose_name_plural': 'User Notification Preferences',
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user