adding arabic plicy
This commit is contained in:
parent
920999ccb0
commit
a982102796
Binary file not shown.
Binary file not shown.
@ -124,7 +124,7 @@ class PlatformProfileAdmin(admin.ModelAdmin):
|
||||
'fields': ('name', 'logo', 'slogan', 'address', 'phone_number', 'registration_number', 'vat_number')
|
||||
}),
|
||||
(_('Policies'), {
|
||||
'fields': ('privacy_policy', 'terms_conditions')
|
||||
'fields': ('privacy_policy_en', 'privacy_policy_ar', 'terms_conditions_en', 'terms_conditions_ar')
|
||||
}),
|
||||
(_('Payment Configuration'), {
|
||||
'fields': ('enable_payment',)
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
# Generated by Django 5.2.7 on 2026-01-28 00:58
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0020_profile_is_approved'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='platformprofile',
|
||||
name='privacy_policy',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='platformprofile',
|
||||
name='terms_conditions',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='platformprofile',
|
||||
name='privacy_policy_ar',
|
||||
field=models.TextField(blank=True, verbose_name='Privacy Policy (Arabic)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='platformprofile',
|
||||
name='privacy_policy_en',
|
||||
field=models.TextField(blank=True, verbose_name='Privacy Policy (English)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='platformprofile',
|
||||
name='terms_conditions_ar',
|
||||
field=models.TextField(blank=True, verbose_name='Terms and Conditions (Arabic)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='platformprofile',
|
||||
name='terms_conditions_en',
|
||||
field=models.TextField(blank=True, verbose_name='Terms and Conditions (English)'),
|
||||
),
|
||||
]
|
||||
Binary file not shown.
@ -180,8 +180,12 @@ class PlatformProfile(models.Model):
|
||||
phone_number = models.CharField(_('Phone Number'), max_length=50, blank=True)
|
||||
registration_number = models.CharField(_('Registration Number'), max_length=100, blank=True)
|
||||
vat_number = models.CharField(_('VAT Number'), max_length=100, blank=True)
|
||||
privacy_policy = models.TextField(_('Privacy Policy'), blank=True)
|
||||
terms_conditions = models.TextField(_('Terms and Conditions'), blank=True)
|
||||
|
||||
# Bilingual Policies
|
||||
privacy_policy_en = models.TextField(_('Privacy Policy (English)'), blank=True)
|
||||
privacy_policy_ar = models.TextField(_('Privacy Policy (Arabic)'), blank=True)
|
||||
terms_conditions_en = models.TextField(_('Terms and Conditions (English)'), blank=True)
|
||||
terms_conditions_ar = models.TextField(_('Terms and Conditions (Arabic)'), blank=True)
|
||||
|
||||
# WhatsApp Configuration (Wablas Gateway)
|
||||
whatsapp_access_token = models.TextField(_('Wablas API Token'), blank=True, help_text=_("Your Wablas API Token."))
|
||||
@ -191,6 +195,18 @@ class PlatformProfile(models.Model):
|
||||
# Payment Configuration
|
||||
enable_payment = models.BooleanField(_('Enable Payment'), default=True, help_text=_("Toggle to enable or disable payments on the platform."))
|
||||
|
||||
@property
|
||||
def privacy_policy(self):
|
||||
if get_language() == 'ar':
|
||||
return self.privacy_policy_ar
|
||||
return self.privacy_policy_en
|
||||
|
||||
@property
|
||||
def terms_conditions(self):
|
||||
if get_language() == 'ar':
|
||||
return self.terms_conditions_ar
|
||||
return self.terms_conditions_en
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
# Auto-clean whitespace from credentials
|
||||
if self.whatsapp_access_token:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user