Implement Web Assets' theme system and selection, and add 'light' theme #118

Merged
Márton Lente merged 97 commits from martonlente/extensions-website:ui/theme-light into main 2024-05-08 14:20:07 +02:00
Showing only changes of commit 3d239ab426 - Show all commits

View File

@ -10,7 +10,6 @@ import django.core.mail
from emails.models import Email
from emails.util import construct_email
from common.tests.factories.notifications import construct_fake_notifications
logger = logging.getLogger(__name__)
User = get_user_model()
@ -112,13 +111,16 @@ class EmailPreviewAdmin(NoAddDeleteMixin, EmailAdmin):
def _get_emails_with_fake_context(self, request):
email_with_fake_context = {'feedback': {}}
fake_notifications = construct_fake_notifications()
for fake_notification in fake_notifications:
mail_name = fake_notification.original_template_name
email_with_fake_context[mail_name] = {
'template': fake_notification.template_name,
**fake_notification.get_template_context(),
}
if settings.DEBUG:
from common.tests.factories.notifications import construct_fake_notifications
fake_notifications = construct_fake_notifications()
for fake_notification in fake_notifications:
mail_name = fake_notification.original_template_name
email_with_fake_context[mail_name] = {
'template': fake_notification.template_name,
**fake_notification.get_template_context(),
}
return email_with_fake_context
def _get_emails_list(self, request):