diff --git a/photologue_custom/admin.py b/photologue_custom/admin.py index 909117d..895d534 100644 --- a/photologue_custom/admin.py +++ b/photologue_custom/admin.py @@ -1,4 +1,5 @@ from django.contrib import admin +from django.utils.translation import gettext_lazy as _ from photologue.admin import GalleryAdmin as GalleryAdminDefault from photologue.admin import PhotoAdmin as PhotoAdminDefault from photologue.models import Gallery, Photo, PhotoEffect, PhotoSize, Watermark @@ -32,7 +33,16 @@ class PhotoAdmin(PhotoAdminDefault): model. """ inlines = [PhotoExtendedInline, ] + list_display = ('title', 'date_taken', 'date_added', + 'is_public', 'view_count', 'admin_thumbnail', 'get_owner') + list_filter = ['date_added', 'is_public', 'extended__owner'] + def get_owner(self, obj): + if not hasattr(obj, 'extended'): + return "No owner" + return obj.extended.owner.username + get_owner.admin_order_field = 'owner' + get_owner.short_description = _('owner') admin.site.unregister(Gallery) admin.site.unregister(Photo) diff --git a/photologue_custom/templates/admin/photologue/photo/change_list.html b/photologue_custom/templates/admin/photologue/photo/change_list.html new file mode 100644 index 0000000..22a98d1 --- /dev/null +++ b/photologue_custom/templates/admin/photologue/photo/change_list.html @@ -0,0 +1,3 @@ +{% extends "admin/change_list.html" %} +{% load i18n %} +{# Hide upload as zip #} \ No newline at end of file