-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/core/urls.py b/core/urls.py
index f04db88..4a39602 100644
--- a/core/urls.py
+++ b/core/urls.py
@@ -9,6 +9,7 @@ urlpatterns = [
path("logout/", auth_views.LogoutView.as_view(), name="logout"),
path("dashboard/", views.dashboard, name="dashboard"),
path("truck/register/", views.truck_register, name="truck_register"),
+ path("truck//edit/", views.edit_truck, name="edit_truck"),
path("truck//approve/", views.approve_truck, name="approve_truck"),
path("truck//suspend/", views.suspend_truck, name="suspend_truck"),
path("shipment/post/", views.post_shipment, name="post_shipment"),
diff --git a/core/views.py b/core/views.py
index f30c2dc..e95fd1a 100644
--- a/core/views.py
+++ b/core/views.py
@@ -86,6 +86,25 @@ def truck_register(request):
return render(request, 'core/truck_register.html', {'form': form})
+@login_required
+def edit_truck(request, truck_id):
+ truck = get_object_or_404(Truck, id=truck_id, owner=request.user)
+
+ if request.method == 'POST':
+ form = TruckForm(request.POST, request.FILES, instance=truck)
+ if form.is_valid():
+ truck = form.save(commit=False)
+ truck.is_approved = False # Reset approval status on update
+ truck.save()
+ messages.success(request, _("Truck data updated successfully! It will be reviewed by admin again."))
+ return redirect('dashboard')
+ else:
+ messages.error(request, _("There was an error updating your truck. Please check the form."))
+ else:
+ form = TruckForm(instance=truck)
+
+ return render(request, 'core/truck_register.html', {'form': form, 'edit_mode': True, 'truck': truck})
+
@login_required
def approve_truck(request, truck_id):
if not (request.user.profile.role == 'ADMIN' or request.user.is_superuser):
diff --git a/locale/ar/LC_MESSAGES/django.mo b/locale/ar/LC_MESSAGES/django.mo
index 637a85b..014effb 100644
Binary files a/locale/ar/LC_MESSAGES/django.mo and b/locale/ar/LC_MESSAGES/django.mo differ
diff --git a/locale/ar/LC_MESSAGES/django.po b/locale/ar/LC_MESSAGES/django.po
index abf656b..866b078 100644
--- a/locale/ar/LC_MESSAGES/django.po
+++ b/locale/ar/LC_MESSAGES/django.po
@@ -469,10 +469,8 @@ msgstr "محلياً ودولياً"
#: core/templates/core/index.html:15
-msgid """The most reliable platform connecting shippers with truck owners across the ""region. Transparent, fast, and secure."
-msgstr ""
-"المنصة الأكثر موثوقية لربط الشاحنين مع أسطول الشاحنات في جميع أنحاء المنطقة. "
-"شفافة، سريعة، وآمنة."
+msgid "The most reliable platform connecting shippers with truck owners across the region. Transparent, fast, and secure."
+msgstr "المنصة الأكثر موثوقية لربط الشاحنين مع أسطول الشاحنات في جميع أنحاء المنطقة. شفافة، سريعة، وآمنة."
#: core/templates/core/index.html:18
@@ -501,10 +499,8 @@ msgstr "أنا شاحن"
#: core/templates/core/index.html:45
-msgid """I need to move goods locally or abroad. Post your shipment, receive offers ""from verified drivers, and track your cargo in real-time."
-msgstr ""
-"أريد نقل بضائع محلياً أو دولياً. انشر شحنتك، واستقبل عروضاً من سائقين موثقين، "
-"وتتبع شحنتك في الوقت الفعلي."
+msgid "I need to move goods locally or abroad. Post your shipment, receive offers from verified drivers, and track your cargo in real-time."
+msgstr "أريد نقل بضائع محلياً أو دولياً. انشر شحنتك، واستقبل عروضاً من سائقين موثقين، وتتبع شحنتك في الوقت الفعلي."
#: core/templates/core/index.html:48
@@ -533,10 +529,8 @@ msgstr "أنا صاحب شاحنة"
#: core/templates/core/index.html:63
-msgid """I have trucks and want to find cargo to transport. Register your fleet, bid ""on available jobs, and grow your business."
-msgstr ""
-"لدي شاحنات وأريد العثور على بضائع لنقلها. سجل أسطولك، وقدم عروضك على الوظائف "
-"المتاحة، ونمِ عملك."
+msgid "I have trucks and want to find cargo to transport. Register your fleet, bid on available jobs, and grow your business."
+msgstr "لدي شاحنات وأريد العثور على بضائع لنقلها. سجل أسطولك، وقدم عروضك على الوظائف المتاحة، ونمِ عملك."
#: core/templates/core/index.html:66
@@ -998,3 +992,33 @@ msgstr "خطأ في تقديم العرض. يرجى التحقق من النمو
#: core/views.py:195
msgid "Bid accepted! Shipment is now in progress."
msgstr "تم قبول العرض! الشحنة قيد التنفيذ الآن."
+
+msgid "Update Truck Data"
+msgstr "تحديث بيانات الشاحنة"
+
+msgid "Update and Submit for Approval"
+msgstr "تحديث وإرسال للاعتماد"
+
+msgid "Edit Details"
+msgstr "تعديل التفاصيل"
+
+msgid "Registration Expiry Date"
+msgstr "تاريخ انتهاء التسجيل"
+
+msgid "Expiry Date"
+msgstr "تاريخ الانتهاء"
+
+msgid "Expiry Date:"
+msgstr "تاريخ الانتهاء:"
+
+msgid "التفاصيل باللغة العربية"
+msgstr "التفاصيل باللغة العربية"
+
+msgid "Edit Truck"
+msgstr "تعديل الشاحنة"
+
+msgid "Truck data updated successfully! It will be reviewed by admin again."
+msgstr "تم تحديث بيانات الشاحنة بنجاح! سيتم مراجعتها من قبل المسؤول مرة أخرى."
+
+msgid "There was an error updating your truck. Please check the form."
+msgstr "حدث خطأ أثناء تحديث شاحنتك. يرجى التحقق من النموذج."
\ No newline at end of file