From c2bd9dc53c2621a7e5084d410265be240cf2a51f Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 2 Feb 2026 03:53:32 +0000 Subject: [PATCH] more modifications --- config/__pycache__/settings.cpython-311.pyc | Bin 9904 -> 10025 bytes config/settings.py | 2 + core/__pycache__/admin.cpython-311.pyc | Bin 25707 -> 26037 bytes core/admin.py | 5 ++ core/templates/core/profile.html | 75 ++++++++++---------- static/css/admin_platform_profile.css | 44 ++++++++++++ static/js/admin_platform_profile.js | 51 +++++++++++++ staticfiles/css/admin_platform_profile.css | 44 ++++++++++++ staticfiles/js/admin_platform_profile.js | 51 +++++++++++++ 9 files changed, 235 insertions(+), 37 deletions(-) create mode 100644 static/css/admin_platform_profile.css create mode 100644 static/js/admin_platform_profile.js create mode 100644 staticfiles/css/admin_platform_profile.css create mode 100644 staticfiles/js/admin_platform_profile.js diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 01499dd7f7c353ee5987d2ae38eb2bf9bbacb0e6..02973526ad3fb8221dbd163eb3b47ba5dc2f19f7 100644 GIT binary patch delta 563 zcmZXQ%}*0S7>8#lgLS3tcDsfmiYAmG1`5)e7%wL3MX8#|tImtYE=J$Ra=J4kJt@vInrZ9OnhgPkD zv-NnIfBiBx5?z7E@WkTaHI-dnylye5L&4{;7Sa#79&#h(Q+Ot;4cL@?9wskBHbcG) z`3f{y-GY|n>o9o(+tPO+BDo81VGrKHKD>tyF!-_A=kwwX_yh;=dA`Tu#aW2VvGK!p zH@cd**i9_hj{8WmE4K4+$+0U|)$GO|nT~6f|2B;){@rvv zTV600=S^xW5e&CG^j}o6<)mYQS!@4J9|+}#{39-JO>J)vZ;6$h-qYz-18oc=Qh)U( zy~`-1VILDoZwil)N10H)VLVE%P@ctO*eG$zPZS@7<)W&?d1lN4x7 zXkH#u{B> r*{HNC!Kq2Skn^vO7S41A&vi1FzTFN+3TSd_V*d~@6(6*BM*I06kAA+Q delta 458 zcmXwz%T59@6oy-%IH2InI4Bw~3xmX{Tol(P>PA5qy2H3IIl-{@0q_ZQaJ--*;1w@u zBs_#WGfS4nCpeE_PZOK;%h&&JPW!U?xe;!LLO~|iH!l@y@p3rIKict0tyI+>d48?P z;0SUKhhs%sv8;Ha=)kFL&){70LM0W&OT{b2YcOS7g&WD5O6t&%ehXg7JGh4jc!Vct z!ZW;7{SMEsgYgP)(AxJDc|Hr?Z8rVh`PB~lJ=2<1_#J3CMzQQ==BWwaVYJq#AcVNoux6WI7gmf zVx*G6BzcOSGBHg)Pm||yfjq;+Xr<67xMOp;n0DH+Tm<(xHS8ZQ)3MMQo9g3#kV=lm diff --git a/config/settings.py b/config/settings.py index 14def59..3918fce 100644 --- a/config/settings.py +++ b/config/settings.py @@ -296,6 +296,8 @@ JAZZMIN_SETTINGS = { "use_google_fonts_cdn": True, "show_ui_builder": False, "language_chooser": True, + "changeform_format": "horizontal_tabs", + "changeform_format_overrides": {"core.platformprofile": "vertical_tabs"} } JAZZMIN_UI_TWEAKS = { diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index 365dd75019159e9717ebe5925e3aa98ecc16099a..6c075178b107166b59b8a357d2b0ae5d954bad6e 100644 GIT binary patch delta 1592 zcmZ`&OKcle6n%GQY~pd8pOcg(Y3(>p8Y`c+LTQ@F1nM>o`L#|=TxAlRx_LHoaXuP1 zZKwpvB2u$}P4A+BQUR*eE?gF9gv0{D4n?98AXuOX304(S1#(dqB^!A6xlQOmXEew6 z-E+@*_ucV4*o4o%0nZ(eM`z;tuzodj?^Dm*3q$vTv1{xGOECjDGZcjlFb->sE4LNK z^5Q98hN`fX#?{-RJ};i)#Wn88Kw79$8g{tqlNv9vRk);1w`JWMN>Rm2ZH!0Om)Wwr z_4tv$W<}$b&*FKNjqysqYFl>KkJs23jn_Uo5#MLyo|j(xS8Qo%mM$?I>nshtZmq;{ z@@5$~thtQmWOP7eOZdSxX1KUdpw9gQ-O{k}X}^?vrgV3}0k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*ueX?#bWxvS$}ZFo%bL|BWr~IsrtCt4tYw*$m7?Be$}ZJsn-od2 zFK#Yp*d*o(vsI?7FzZiMlg3y-Xsbt4)nu(i#A`>>R7FI2Je#7e8)a&$md}}{6>wUF zpW}bOK1(8f{-`}nE9AqB#iK7$t@GB!+&XiNod$J9J99f{?D*VgH_mK~B`cZyss>$r zoP(e0ZSdKE20uUsHa8xJ@5Y11T1ooFj4!?#8DG@rp|9BnNk*jkZW3hUpB6W)GRn7K zlOPu-cl1LQx?2;9gIn&C@p0IWw_3-c2))4oIB_`Wf+m~@_IR`OGQLRNMJOk<5CQ~R zjy^@vae|G8*#rmrLJsbd2)S&n5@SC{*uwiJ&0W@ooGW1o?j2 z=JsORhNN$yQa|Q**H}~v2{$p`?E%%e(48*ji0czqC2l|*RRAXvg^HL(#py&o95X&7 gW~GgT0BgRm<$2ZnGSBl>h~NG#IV~H%dml=F0W>ffPyhe` diff --git a/core/admin.py b/core/admin.py index 9c171e2..e81d087 100644 --- a/core/admin.py +++ b/core/admin.py @@ -201,6 +201,11 @@ class ParcelAdmin(admin.ModelAdmin): export_pdf.short_description = _("Download Selected as PDF") class PlatformProfileAdmin(admin.ModelAdmin): + class Media: + js = ("js/admin_platform_profile.js",) + css = { + "all": ("css/admin_platform_profile.css",) + } fieldsets = ( (_('General Info'), { 'fields': ('name', 'logo', 'favicon', 'admin_panel_logo', 'slogan', 'address', 'phone_number', 'registration_number', 'vat_number') diff --git a/core/templates/core/profile.html b/core/templates/core/profile.html index ee3fd9c..8e1afec 100644 --- a/core/templates/core/profile.html +++ b/core/templates/core/profile.html @@ -84,46 +84,47 @@

{{ profile.get_language_display }}

- {% if profile.role == 'car_owner' %} -
-{% if profile.role == 'car_owner' %} -
-

{% trans "Driver Rating" %}

-
-
{{ profile.get_average_rating|default:"0.0"|floatformat:1 }}
-
-
- -
-
- {{ profile.get_rating_count }} {% trans "reviews" %} -
-
-
+
- {% if reviews %} -
- {% for review in reviews %} -
-
-
- {{ review.shipper.first_name }} - {{ review.created_at|date:"M d, Y" }} -
-
- {{ review.rating }} -
+ {% if profile.role == 'car_owner' %} +
+
+

{% trans "Driver Rating" %}

+
+
{{ profile.get_average_rating|default:"0.0"|floatformat:1 }}
+
+
+ +
+
+ {{ profile.get_rating_count }} {% trans "reviews" %}
- {% if review.comment %} -

{{ review.comment }}

- {% endif %}
- {% endfor %}
- {% else %} -

{% trans "No reviews yet." %}

- {% endif %} -
+ + {% if reviews %} +
+ {% for review in reviews %} +
+
+
+ {{ review.shipper.first_name }} + {{ review.created_at|date:"M d, Y" }} +
+
+ {{ review.rating }} +
+
+ {% if review.comment %} +

{{ review.comment }}

+ {% endif %} +
+ {% endfor %} +
+ {% else %} +

{% trans "No reviews yet." %}

+ {% endif %} +
{% endif %}
@@ -141,4 +142,4 @@ border-radius: 8px; } -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/static/css/admin_platform_profile.css b/static/css/admin_platform_profile.css new file mode 100644 index 0000000..9e7d185 --- /dev/null +++ b/static/css/admin_platform_profile.css @@ -0,0 +1,44 @@ +/* Custom sidebar-like styling for vertical tabs in Platform Profile */ + +.col-sm-3 .nav-pills.flex-column { + background: #f8f9fa; + border-radius: 8px; + padding: 10px; + border: 1px solid #dee2e6; +} + +.col-sm-3 .nav-pills.flex-column .nav-link { + color: #495057; + margin-bottom: 5px; + border-radius: 6px; + transition: all 0.2s ease; + padding: 12px 15px; + font-weight: 500; +} + +.col-sm-3 .nav-pills.flex-column .nav-link:hover { + background-color: #e9ecef; + color: #007bff; +} + +.col-sm-3 .nav-pills.flex-column .nav-link.active { + background-color: #007bff; + color: #fff; + box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2); +} + +.col-sm-3 .nav-pills.flex-column .nav-link i { + font-size: 1.1rem; + vertical-align: middle; +} + +/* Adjust the main content area */ +.col-sm-9 { + padding-left: 20px; +} + +.card-primary.card-outline { + border-top: 3px solid #007bff; + border-radius: 8px; + box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2); +} diff --git a/static/js/admin_platform_profile.js b/static/js/admin_platform_profile.js new file mode 100644 index 0000000..903bb5f --- /dev/null +++ b/static/js/admin_platform_profile.js @@ -0,0 +1,51 @@ +document.addEventListener('DOMContentLoaded', function() { + const iconMap = { + 'General Info': 'fas fa-info-circle', + 'Financial Configuration': 'fas fa-money-bill-wave', + 'Maintenance / Availability': 'fas fa-tools', + 'Driver Warning & Rejection / Auto-Ban': 'fas fa-user-slash', + 'Testing / Development': 'fas fa-flask', + 'Integrations': 'fas fa-plug', + 'Policies': 'fas fa-file-contract', + 'WhatsApp Configuration (Wablas Gateway)': 'fab fa-whatsapp', + 'Tools': 'fas fa-wrench' + }; + + const iconMapAr = { + 'معلومات عامة': 'fas fa-info-circle', + 'التكوين المالي': 'fas fa-money-bill-wave', + 'الصيانة / التوفر': 'fas fa-tools', + 'تحذير السائق ورفضه / الحظر التلقائي': 'fas fa-user-slash', + 'الاختبار / التطوير': 'fas fa-flask', + 'التكاملات': 'fas fa-plug', + 'السياسات': 'fas fa-file-contract', + 'تكوين واتساب (بوابة وابلأس)': 'fab fa-whatsapp', + 'أدوات': 'fas fa-wrench' + }; + + const fullIconMap = {...iconMap, ...iconMapAr}; + + function applyIcons() { + const tabs = document.querySelectorAll('.nav-link'); + tabs.forEach(tab => { + // Check if icon already exists + if (tab.querySelector('i.fas, i.fab')) return; + + const text = tab.textContent.trim(); + for (const [key, icon] of Object.entries(fullIconMap)) { + if (text.includes(key)) { + const i = document.createElement('i'); + i.className = icon + ' mr-2'; + i.style.width = '20px'; + i.style.textAlign = 'center'; + tab.prepend(i); + break; + } + } + }); + } + + applyIcons(); + // Sometimes jazzmin loads tabs dynamically or with a delay + setTimeout(applyIcons, 500); +}); diff --git a/staticfiles/css/admin_platform_profile.css b/staticfiles/css/admin_platform_profile.css new file mode 100644 index 0000000..9e7d185 --- /dev/null +++ b/staticfiles/css/admin_platform_profile.css @@ -0,0 +1,44 @@ +/* Custom sidebar-like styling for vertical tabs in Platform Profile */ + +.col-sm-3 .nav-pills.flex-column { + background: #f8f9fa; + border-radius: 8px; + padding: 10px; + border: 1px solid #dee2e6; +} + +.col-sm-3 .nav-pills.flex-column .nav-link { + color: #495057; + margin-bottom: 5px; + border-radius: 6px; + transition: all 0.2s ease; + padding: 12px 15px; + font-weight: 500; +} + +.col-sm-3 .nav-pills.flex-column .nav-link:hover { + background-color: #e9ecef; + color: #007bff; +} + +.col-sm-3 .nav-pills.flex-column .nav-link.active { + background-color: #007bff; + color: #fff; + box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2); +} + +.col-sm-3 .nav-pills.flex-column .nav-link i { + font-size: 1.1rem; + vertical-align: middle; +} + +/* Adjust the main content area */ +.col-sm-9 { + padding-left: 20px; +} + +.card-primary.card-outline { + border-top: 3px solid #007bff; + border-radius: 8px; + box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2); +} diff --git a/staticfiles/js/admin_platform_profile.js b/staticfiles/js/admin_platform_profile.js new file mode 100644 index 0000000..903bb5f --- /dev/null +++ b/staticfiles/js/admin_platform_profile.js @@ -0,0 +1,51 @@ +document.addEventListener('DOMContentLoaded', function() { + const iconMap = { + 'General Info': 'fas fa-info-circle', + 'Financial Configuration': 'fas fa-money-bill-wave', + 'Maintenance / Availability': 'fas fa-tools', + 'Driver Warning & Rejection / Auto-Ban': 'fas fa-user-slash', + 'Testing / Development': 'fas fa-flask', + 'Integrations': 'fas fa-plug', + 'Policies': 'fas fa-file-contract', + 'WhatsApp Configuration (Wablas Gateway)': 'fab fa-whatsapp', + 'Tools': 'fas fa-wrench' + }; + + const iconMapAr = { + 'معلومات عامة': 'fas fa-info-circle', + 'التكوين المالي': 'fas fa-money-bill-wave', + 'الصيانة / التوفر': 'fas fa-tools', + 'تحذير السائق ورفضه / الحظر التلقائي': 'fas fa-user-slash', + 'الاختبار / التطوير': 'fas fa-flask', + 'التكاملات': 'fas fa-plug', + 'السياسات': 'fas fa-file-contract', + 'تكوين واتساب (بوابة وابلأس)': 'fab fa-whatsapp', + 'أدوات': 'fas fa-wrench' + }; + + const fullIconMap = {...iconMap, ...iconMapAr}; + + function applyIcons() { + const tabs = document.querySelectorAll('.nav-link'); + tabs.forEach(tab => { + // Check if icon already exists + if (tab.querySelector('i.fas, i.fab')) return; + + const text = tab.textContent.trim(); + for (const [key, icon] of Object.entries(fullIconMap)) { + if (text.includes(key)) { + const i = document.createElement('i'); + i.className = icon + ' mr-2'; + i.style.width = '20px'; + i.style.textAlign = 'center'; + tab.prepend(i); + break; + } + } + }); + } + + applyIcons(); + // Sometimes jazzmin loads tabs dynamically or with a delay + setTimeout(applyIcons, 500); +});