Autosave: 20260126-061311

This commit is contained in:
Flatlogic Bot 2026-01-26 06:13:11 +00:00
parent e35fea8cf0
commit 88187c1cc8
10 changed files with 15 additions and 41 deletions

View File

@ -77,7 +77,7 @@ ROOT_URLCONF = 'config.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [BASE_DIR / 'core/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@ -223,4 +223,4 @@ if HOST_FQDN:
else:
SITE_URL = HOST_FQDN
else:
SITE_URL = "http://127.0.0.1:8000"
SITE_URL = "http://127.0.0.1:8000"

View File

@ -8,7 +8,7 @@ from django.shortcuts import render
from django.utils.html import format_html
from django.contrib import messages
from .whatsapp_utils import send_whatsapp_message_detailed
from django.core.mail import send_mail
from django.core.mail import send_html_email
from django.conf import settings
from .mail import send_html_email
import logging
@ -172,3 +172,6 @@ admin.site.register(Governate)
admin.site.register(City)
admin.site.register(PlatformProfile, PlatformProfileAdmin)
admin.site.register(Testimonial, TestimonialAdmin)
# Set custom admin index template
admin.site.index_template = 'admin/dashboard.html'

View File

@ -335,3 +335,8 @@ class DriverRatingForm(forms.ModelForm):
'rating': _('Rating'),
'comment': _('Comment'),
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Reverse choices for CSS star rating logic (5 to 1) to ensure left-to-right filling
self.fields['rating'].choices = [(i, str(i)) for i in range(5, 0, -1)]

View File

@ -25,7 +25,7 @@
{% for radio in form.rating %}
{{ radio.tag }}
<label for="{{ radio.id_for_label }}" class="star-label">
<i class="fas fa-star"></i>
<i class="bi bi-star-fill"></i>
</label>
{% endfor %}
</div>
@ -87,40 +87,5 @@
.rating-stars input[type="radio"]:checked ~ label {
color: #ffc107; /* Bootstrap warning color (yellow) */
}
/* Reverse order fix for logic but display is reversed,
so we might need to adjust logic or just use flex-direction: row-reverse
and ensure inputs are 5,4,3,2,1 order?
Django RadioSelect usually outputs in order 1,2,3,4,5.
If we reverse via flex, 1 is rightmost. That's wrong.
We need 1 on left.
Actually simpler pure CSS rating usually involves flex-reverse.
Let's check Django output.
Django outputs 1, 2, 3, 4, 5.
If we use flex-direction: row-reverse, it shows 5 4 3 2 1.
Hovering 5 highlights 5, 4, 3, 2, 1. Correct.
So visually:
[5] [4] [3] [2] [1]
If I click left-most (5), it checks 5.
Wait, users expect [1] [2] [3] [4] [5].
If I use row-reverse:
DOM: 1 2 3 4 5
Visual: 5 4 3 2 1
This is counter-intuitive for LTR.
Let's use a different technique.
Use :checked ~ label selector, but then we need the input BEFORE the label.
Django widgets renders input then label?
{{ radio.tag }} is input. <label> we write manually.
So DOM is: Input1 Label1 Input2 Label2 ...
We can style this.
*/
</style>
{% endblock %}
{% endblock %}

View File

@ -35,6 +35,7 @@ urlpatterns = [
path('shipment-request/', views.shipment_request, name='shipment_request'),
path('accept-parcel/<int:parcel_id>/', views.accept_parcel, name='accept_parcel'),
path('update-status/<int:parcel_id>/', views.update_status, name='update_status'),
path('rate-driver/<int:parcel_id>/', views.rate_driver, name='rate_driver'),
path('initiate-payment/<int:parcel_id>/', views.initiate_payment, name='initiate_payment'),
path('payment-success/', views.payment_success, name='payment_success'),
path('payment-cancel/', views.payment_cancel, name='payment_cancel'),
@ -49,4 +50,4 @@ urlpatterns = [
path('profile/', views.profile_view, name='profile'),
path('profile/edit/', views.edit_profile, name='edit_profile'),
path('profile/verify-otp/', views.verify_otp_view, name='verify_otp'),
]
]