Merge branch 'main' into nl/3176-page-titles

This commit is contained in:
CuriousX 2025-02-27 18:30:29 -07:00 committed by GitHub
commit d66bd5df67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 167 additions and 88 deletions

View file

@ -2274,11 +2274,12 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
@admin.display(description=_("Requested Domain"))
def custom_requested_domain(self, obj):
# Example: Show different icons based on `status`
url = reverse("admin:registrar_domainrequest_changelist") + f"{obj.id}"
text = obj.requested_domain
if obj.portfolio:
return format_html('<a href="{}"><img src="/public/admin/img/icon-yes.svg"> {}</a>', url, text)
return format_html('<a href="{}">{}</a>', url, text)
return format_html(
f'<img class="padding-right-05" src="/public/admin/img/icon-yes.svg" aria-hidden="true">{escape(text)}'
)
return text
custom_requested_domain.admin_order_field = "requested_domain__name" # type: ignore