diff --git a/src/documents/admin.py b/src/documents/admin.py index 055069bce..39a18a4a2 100644 --- a/src/documents/admin.py +++ b/src/documents/admin.py @@ -1,5 +1,6 @@ from django.conf import settings from django.contrib import admin +from django.templatetags.static import static from .models import Document @@ -7,10 +8,15 @@ from .models import Document class DocumentAdmin(admin.ModelAdmin): search_fields = ("sender", "title", "content",) - list_display = ("created", "sender", "title", "thumbnail", "pdf") + list_display = ("edit", "created", "sender", "title", "thumbnail", "pdf") list_filter = ("created", "sender") save_on_top = True + def edit(self, obj): + return 'Edit icon'.format( + static("documents/img/edit.png")) + edit.allow_tags = True + def thumbnail(self, obj): return '' \ '' \ @@ -18,8 +24,13 @@ class DocumentAdmin(admin.ModelAdmin): thumbnail.allow_tags = True def pdf(self, obj): - return 'Download'.format( - settings.MEDIA_URL, obj.pk) + return '' \ + 'PDF icon' \ + ''.format( + settings.MEDIA_URL, + obj.pk, + static("documents/img/application-pdf.png") + ) pdf.allow_tags = True admin.site.register(Document, DocumentAdmin) diff --git a/src/documents/static/documents/img/application-pdf.png b/src/documents/static/documents/img/application-pdf.png new file mode 100644 index 000000000..6fdfae993 Binary files /dev/null and b/src/documents/static/documents/img/application-pdf.png differ diff --git a/src/documents/static/documents/img/edit.png b/src/documents/static/documents/img/edit.png new file mode 100644 index 000000000..58903ae5e Binary files /dev/null and b/src/documents/static/documents/img/edit.png differ diff --git a/src/paperless/urls.py b/src/paperless/urls.py index 42e9c16af..967eb65a4 100644 --- a/src/paperless/urls.py +++ b/src/paperless/urls.py @@ -19,5 +19,5 @@ from django.conf.urls import url, static from django.contrib import admin urlpatterns = [ - url(r'^admin/', admin.site.urls), + url(r'', admin.site.urls), ] + static.static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)