Skip to content

Commit

Permalink
FEAT: add image cropping
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Delhorme committed Mar 14, 2024
1 parent 256fa14 commit e3e3729
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 187 deletions.
8 changes: 7 additions & 1 deletion filer/admin/imageadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy

from image_cropping.admin import ImageCroppingMixin

from ..settings import FILER_IMAGE_MODEL
from ..thumbnail_processors import normalize_subject_location
from ..utils.compatibility import string_concat
Expand Down Expand Up @@ -89,7 +91,7 @@ class Media:
)


class ImageAdmin(FileAdmin):
class ImageAdmin(ImageCroppingMixin, FileAdmin):
change_form_template = 'admin/filer/image/change_form.html'
form = ImageAdminForm

Expand All @@ -102,6 +104,10 @@ class ImageAdmin(FileAdmin):
ImageAdmin.fieldsets = ImageAdmin.build_fieldsets(
extra_main_fields=extra_main_fields,
extra_fieldsets=(
(_('Cropping'), {
'fields': ('cropping',),
'classes': ('collapse',),
}),
(_('Subject location'), {
'fields': ('subject_location',),
'classes': ('collapse',),
Expand Down
Binary file modified filer/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit e3e3729

Please sign in to comment.