mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-01-02 01:47:04 -05:00
feat: Implement initial schema and add various API, service, and management command enhancements across the application.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user