updating profile
This commit is contained in:
parent
59f1cf28c3
commit
f2a747c61a
Binary file not shown.
Binary file not shown.
@ -164,6 +164,10 @@ STATICFILES_DIRS = [
|
|||||||
BASE_DIR / 'node_modules',
|
BASE_DIR / 'node_modules',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Media files
|
||||||
|
MEDIA_URL = '/media/'
|
||||||
|
MEDIA_ROOT = BASE_DIR / 'media'
|
||||||
|
|
||||||
# Email
|
# Email
|
||||||
EMAIL_BACKEND = os.getenv(
|
EMAIL_BACKEND = os.getenv(
|
||||||
"EMAIL_BACKEND",
|
"EMAIL_BACKEND",
|
||||||
@ -207,4 +211,4 @@ WHATSAPP_ENABLED = os.getenv("WHATSAPP_ENABLED", "false").lower() == "true"
|
|||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
LOGIN_REDIRECT_URL = 'dashboard'
|
LOGIN_REDIRECT_URL = 'dashboard'
|
||||||
LOGOUT_REDIRECT_URL = 'index'
|
LOGOUT_REDIRECT_URL = 'index'
|
||||||
@ -16,4 +16,5 @@ urlpatterns += i18n_patterns(
|
|||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||||
urlpatterns += static("/assets/", document_root=settings.BASE_DIR / "assets")
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
urlpatterns += static("/assets/", document_root=settings.BASE_DIR / "assets")
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from .models import Profile
|
from .models import Profile, PlatformProfile
|
||||||
|
|
||||||
def project_context(request):
|
def project_context(request):
|
||||||
"""
|
"""
|
||||||
@ -12,6 +12,8 @@ def project_context(request):
|
|||||||
profile = request.user.profile
|
profile = request.user.profile
|
||||||
except:
|
except:
|
||||||
profile, created = Profile.objects.get_or_create(user=request.user)
|
profile, created = Profile.objects.get_or_create(user=request.user)
|
||||||
|
|
||||||
|
platform_profile = PlatformProfile.objects.first()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
|
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
|
||||||
@ -19,4 +21,5 @@ def project_context(request):
|
|||||||
# Used for cache-busting static assets
|
# Used for cache-busting static assets
|
||||||
"deployment_timestamp": int(time.time()),
|
"deployment_timestamp": int(time.time()),
|
||||||
"user_profile": profile,
|
"user_profile": profile,
|
||||||
|
"platform_profile": platform_profile,
|
||||||
}
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 5.2.7 on 2026-01-25 11:00
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('core', '0007_platformprofile'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='platformprofile',
|
||||||
|
name='privacy_policy',
|
||||||
|
field=models.TextField(blank=True, verbose_name='Privacy Policy'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='platformprofile',
|
||||||
|
name='terms_conditions',
|
||||||
|
field=models.TextField(blank=True, verbose_name='Terms and Conditions'),
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
@ -154,10 +154,12 @@ class PlatformProfile(models.Model):
|
|||||||
phone_number = models.CharField(_('Phone Number'), max_length=50, blank=True)
|
phone_number = models.CharField(_('Phone Number'), max_length=50, blank=True)
|
||||||
registration_number = models.CharField(_('Registration Number'), max_length=100, blank=True)
|
registration_number = models.CharField(_('Registration Number'), max_length=100, blank=True)
|
||||||
vat_number = models.CharField(_('VAT 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)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('Platform Profile')
|
verbose_name = _('Platform Profile')
|
||||||
verbose_name_plural = _('Platform Profile')
|
verbose_name_plural = _('Platform Profile')
|
||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
{% block head %}{% endblock %}
|
{% block head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body class="d-flex flex-column min-vh-100">
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark w-100" style="z-index: 1000;">
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark w-100" style="z-index: 1000;">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -126,13 +126,62 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<main>
|
<main class="flex-grow-1">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="py-5 bg-white border-top">
|
<footer class="bg-dark text-white pt-5 pb-3 mt-5">
|
||||||
<div class="container text-center">
|
<div class="container">
|
||||||
<p class="text-muted mb-0">© 2026 masarX. {% trans "All rights reserved." %}</p>
|
<div class="row">
|
||||||
|
<div class="col-md-4 mb-4">
|
||||||
|
{% if platform_profile and platform_profile.logo %}
|
||||||
|
<img src="{{ platform_profile.logo.url }}" alt="{{ platform_profile.name }}" height="40" class="mb-3">
|
||||||
|
{% else %}
|
||||||
|
<h5 class="fw-bold text-white">masar<span style="color: var(--accent-orange)">X</span></h5>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if platform_profile.slogan %}
|
||||||
|
<p class="text-white-50">{{ platform_profile.slogan }}</p>
|
||||||
|
{% else %}
|
||||||
|
<p class="text-white-50">{% trans "Small Shipments, Smart Delivery" %}</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4 mb-4">
|
||||||
|
<h5 class="text-white mb-3">{% trans "Contact Us" %}</h5>
|
||||||
|
<ul class="list-unstyled text-white-50">
|
||||||
|
{% if platform_profile.address %}
|
||||||
|
<li class="mb-2"><i class="bi bi-geo-alt me-2"></i>{{ platform_profile.address }}</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if platform_profile.phone_number %}
|
||||||
|
<li class="mb-2"><i class="bi bi-telephone me-2"></i>{{ platform_profile.phone_number }}</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if platform_profile.registration_number %}
|
||||||
|
<li class="mb-2">{% trans "Reg No:" %} {{ platform_profile.registration_number }}</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if platform_profile.vat_number %}
|
||||||
|
<li class="mb-2">{% trans "VAT No:" %} {{ platform_profile.vat_number }}</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if not platform_profile.address and not platform_profile.phone_number %}
|
||||||
|
<li class="mb-2">{% trans "Contact information pending." %}</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4 mb-4">
|
||||||
|
<h5 class="text-white mb-3">{% trans "Legal" %}</h5>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<li class="mb-2"><a href="{% url 'privacy_policy' %}" class="text-white-50 text-decoration-none">{% trans "Privacy Policy" %}</a></li>
|
||||||
|
<li class="mb-2"><a href="{% url 'terms_conditions' %}" class="text-white-50 text-decoration-none">{% trans "Terms & Conditions" %}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="border-secondary my-4">
|
||||||
|
|
||||||
|
<div class="text-center text-white-50">
|
||||||
|
<p class="mb-0">© {% now "Y" %} {{ platform_profile.name|default:"masarX" }}. {% trans "All rights reserved." %}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
15
core/templates/core/privacy_policy.html
Normal file
15
core/templates/core/privacy_policy.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container py-5">
|
||||||
|
<h1>{% trans "Privacy Policy" %}</h1>
|
||||||
|
<div class="mt-4">
|
||||||
|
{% if platform_profile and platform_profile.privacy_policy %}
|
||||||
|
{{ platform_profile.privacy_policy|linebreaks }}
|
||||||
|
{% else %}
|
||||||
|
<p>{% trans "Privacy Policy not available yet." %}</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
15
core/templates/core/terms_conditions.html
Normal file
15
core/templates/core/terms_conditions.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container py-5">
|
||||||
|
<h1>{% trans "Terms and Conditions" %}</h1>
|
||||||
|
<div class="mt-4">
|
||||||
|
{% if platform_profile and platform_profile.terms_conditions %}
|
||||||
|
{{ platform_profile.terms_conditions|linebreaks }}
|
||||||
|
{% else %}
|
||||||
|
<p>{% trans "Terms and Conditions not available yet." %}</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@ -21,4 +21,8 @@ urlpatterns = [
|
|||||||
path('payment/initiate/<int:parcel_id>/', views.initiate_payment, name='initiate_payment'),
|
path('payment/initiate/<int:parcel_id>/', views.initiate_payment, name='initiate_payment'),
|
||||||
path('payment/success/', views.payment_success, name='payment_success'),
|
path('payment/success/', views.payment_success, name='payment_success'),
|
||||||
path('payment/cancel/', views.payment_cancel, name='payment_cancel'),
|
path('payment/cancel/', views.payment_cancel, name='payment_cancel'),
|
||||||
|
|
||||||
|
# Static pages
|
||||||
|
path('privacy-policy/', views.privacy_policy, name='privacy_policy'),
|
||||||
|
path('terms-conditions/', views.terms_conditions, name='terms_conditions'),
|
||||||
]
|
]
|
||||||
@ -182,3 +182,9 @@ def get_cities(request):
|
|||||||
cities = City.objects.filter(governate_id=governate_id).order_by(field_name)
|
cities = City.objects.filter(governate_id=governate_id).order_by(field_name)
|
||||||
data = [{'id': c.id, 'name': getattr(c, field_name)} for c in cities]
|
data = [{'id': c.id, 'name': getattr(c, field_name)} for c in cities]
|
||||||
return JsonResponse(data, safe=False)
|
return JsonResponse(data, safe=False)
|
||||||
|
|
||||||
|
def privacy_policy(request):
|
||||||
|
return render(request, 'core/privacy_policy.html')
|
||||||
|
|
||||||
|
def terms_conditions(request):
|
||||||
|
return render(request, 'core/terms_conditions.html')
|
||||||
BIN
platform_logos/masarlogo.jpg
Normal file
BIN
platform_logos/masarlogo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Loading…
x
Reference in New Issue
Block a user