Refactored email sending to use a single HTML template with a base layout, removed plain text email templates, and updated all related backend logic. Introduced a new ContactMe model, serializer, Celery task, and API endpoints for handling contact form submissions, including email notifications. Renamed ShopConfiguration to SiteConfiguration throughout the backend for consistency. Updated frontend to remove unused components, add a new Services section, and adjust navigation and contact form integration.
55 lines
1.1 KiB
Python
55 lines
1.1 KiB
Python
from rest_framework import serializers
|
|
from .models import SiteConfiguration
|
|
|
|
|
|
class SiteConfigurationAdminSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = SiteConfiguration
|
|
fields = [
|
|
"id",
|
|
"name",
|
|
"logo",
|
|
"favicon",
|
|
"contact_email",
|
|
"contact_phone",
|
|
"contact_address",
|
|
"opening_hours",
|
|
"facebook_url",
|
|
"instagram_url",
|
|
"youtube_url",
|
|
"tiktok_url",
|
|
"whatsapp_number",
|
|
"zasilkovna_shipping_price",
|
|
"zasilkovna_api_key",
|
|
"zasilkovna_api_password",
|
|
"free_shipping_over",
|
|
"multiplying_coupons",
|
|
"addition_of_coupons_amount",
|
|
"currency",
|
|
]
|
|
|
|
|
|
class SiteConfigurationPublicSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = SiteConfiguration
|
|
# Expose only non-sensitive fields
|
|
fields = [
|
|
"id",
|
|
"name",
|
|
"logo",
|
|
"favicon",
|
|
"contact_email",
|
|
"contact_phone",
|
|
"contact_address",
|
|
"opening_hours",
|
|
"facebook_url",
|
|
"instagram_url",
|
|
"youtube_url",
|
|
"tiktok_url",
|
|
# Exclude API keys/passwords
|
|
"zasilkovna_shipping_price",
|
|
"free_shipping_over",
|
|
"currency",
|
|
]
|
|
|