feat: Implement initial schema and add various API, service, and management command enhancements across the application.

This commit is contained in:
pacnpal
2026-01-01 15:13:01 -05:00
parent c95f99ca10
commit b243b17af7
413 changed files with 11164 additions and 17433 deletions

View File

@@ -875,12 +875,8 @@ class RideReviewAdmin(QueryOptimizationMixin, ExportActionMixin, BaseModelAdmin)
"""Display moderation status with color coding."""
if obj.moderated_by:
if obj.is_published:
return format_html(
'<span style="color: green; font-weight: bold;">Approved</span>'
)
return format_html(
'<span style="color: red; font-weight: bold;">Rejected</span>'
)
return format_html('<span style="color: green; font-weight: bold;">Approved</span>')
return format_html('<span style="color: red; font-weight: bold;">Rejected</span>')
return format_html('<span style="color: orange;">Pending</span>')
def save_model(self, request, obj, form, change):
@@ -987,9 +983,7 @@ class CompanyAdmin(
(
"Company Details",
{
"fields": (
"founded_date",
),
"fields": ("founded_date",),
"classes": ("collapse",),
"description": "Historical information about the company.",
},
@@ -1024,7 +1018,7 @@ class CompanyAdmin(
color = colors.get(role, "#6c757d")
badges.append(
f'<span style="background-color: {color}; color: white; '
f'padding: 2px 6px; border-radius: 3px; font-size: 10px; '
f"padding: 2px 6px; border-radius: 3px; font-size: 10px; "
f'margin-right: 4px;">{role}</span>'
)
return format_html("".join(badges))