mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 07:46:35 +01:00
- 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.
30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
|
|
from django.db import models
|
|
from django.contrib.auth.models import User
|
|
|
|
# Create your models here.
|
|
|
|
|
|
class version(models.Model):
|
|
currentVersion = models.CharField(max_length=50)
|
|
build = models.IntegerField()
|
|
|
|
class CyberPanelCosmetic(models.Model):
|
|
MainDashboardCSS = models.TextField(default='')
|
|
|
|
class UserNotificationPreferences(models.Model):
|
|
"""Model to store user notification dismissal preferences"""
|
|
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='notification_preferences')
|
|
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)
|
|
|
|
class Meta:
|
|
verbose_name = "User Notification Preferences"
|
|
verbose_name_plural = "User Notification Preferences"
|
|
|
|
def __str__(self):
|
|
return f"Notification Preferences for {self.user.username}" |