diff --git a/src/documents/admin.py b/src/documents/admin.py index f83e23977..18fc217aa 100644 --- a/src/documents/admin.py +++ b/src/documents/admin.py @@ -41,30 +41,30 @@ class TagAdmin(admin.ModelAdmin): class DocumentAdmin(admin.ModelAdmin): search_fields = ("sender__name", "title", "content") - list_display = ("edit", "created", "sender", "title", "tags_", "document") + list_display = ("created", "sender", "title", "tags_", "document") list_filter = ("tags", "sender", MonthListFilter) list_editable = ("sender", "title") list_per_page = 25 - def edit(self, obj): - return 'Edit icon'.format( - static("documents/img/edit.png")) - edit.allow_tags = True - def document(self, obj): return '' \ - 'PDF icon' \ + '{} icon' \ ''.format( reverse("fetch", kwargs={"pk": obj.pk}), - static("documents/img/application-pdf.png") + static("documents/img/application-pdf.png"), + obj.file_type ) document.allow_tags = True def tags_(self, obj): r = "" for tag in obj.tags.all(): - r += '{}'.format( + r += '{}'.format( tag.get_colour_display(), + "{}?tags__id__exact={}".format( + reverse("admin:documents_document_changelist"), + tag.pk + ), tag.slug ) return r