Skip to content

Commit

Permalink
Remove legacy code, update language files
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Sep 20, 2023
1 parent 02e1996 commit 1bb65f9
Show file tree
Hide file tree
Showing 37 changed files with 1,868 additions and 1,934 deletions.
1 change: 0 additions & 1 deletion filer/admin/folderadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,6 @@ def resize_images(self, request, files_queryset, folders_queryset):
"breadcrumbs_action": _("Resize images"),
"to_resize": to_resize,
"resize_form": form,
"cmsplugin_enabled": 'cmsplugin_filer_image' in django_settings.INSTALLED_APPS,
"files_queryset": files_queryset,
"folders_queryset": folders_queryset,
"perms_lacking": perms_needed,
Expand Down
28 changes: 9 additions & 19 deletions filer/admin/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django import forms
from django.conf import settings
from django.contrib.admin import widgets
from django.contrib.admin.helpers import AdminForm
from django.core.exceptions import ValidationError
Expand Down Expand Up @@ -58,23 +57,17 @@ def clean_rename_format(self):

class ResizeImagesForm(WithFieldsetMixin, forms.Form):
fieldsets = ((None, {"fields": (
"thumbnail_option",
("width", "height"),
("crop", "upscale"))}),)

if 'cmsplugin_filer_image' in settings.INSTALLED_APPS:
thumbnail_option = models.ForeignKey(
ThumbnailOption,
null=True,
blank=True,
verbose_name=_("thumbnail option"),
on_delete=models.CASCADE,
).formfield()

def get_fieldsets(self):
"""Updates the static fieldset by prepending thumbnail options"""
fieldsets = super().get_fieldsets()
fieldsets[0][1]["fields"] = ("thumbnail_option") + fieldsets[0][1]["fields"]
return fieldsets
thumbnail_option = models.ForeignKey(
ThumbnailOption,
null=True,
blank=True,
verbose_name=_("thumbnail option"),
on_delete=models.CASCADE,
).formfield()

width = models.PositiveIntegerField(_("width"), null=True, blank=True).formfield(widget=widgets.AdminIntegerFieldWidget)
height = models.PositiveIntegerField(_("height"), null=True, blank=True).formfield(widget=widgets.AdminIntegerFieldWidget)
Expand All @@ -83,8 +76,5 @@ def get_fieldsets(self):

def clean(self):
if not (self.cleaned_data.get('thumbnail_option') or ((self.cleaned_data.get('width') or 0) + (self.cleaned_data.get('height') or 0))):
if 'cmsplugin_filer_image' in settings.INSTALLED_APPS:
raise ValidationError(_('Thumbnail option or resize parameters must be choosen.'))
else:
raise ValidationError(_('Resize parameters must be choosen.'))
raise ValidationError(_('Thumbnail option or resize parameters must be choosen.'))
return self.cleaned_data
98 changes: 45 additions & 53 deletions filer/locale/ar/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: django Filer\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-31 22:21+0200\n"
"POT-Creation-Date: 2023-09-20 10:11+0200\n"
"PO-Revision-Date: 2012-07-13 15:50+0000\n"
"Last-Translator: Angelo Dini <[email protected]>\n"
"Language-Team: Arabic (http://app.transifex.com/divio/django-filer/language/"
Expand All @@ -33,21 +33,21 @@ msgstr ""
msgid "Can't use this folder, Permission Denied. Please select another folder."
msgstr ""

#: admin/fileadmin.py:47
#: admin/fileadmin.py:49
msgid "Advanced"
msgstr ""

#: admin/fileadmin.py:162
#: admin/fileadmin.py:164
msgid "canonical URL"
msgstr ""

#: admin/folderadmin.py:399 admin/folderadmin.py:570
#: admin/folderadmin.py:411 admin/folderadmin.py:582
msgid ""
"Items must be selected in order to perform actions on them. No items have "
"been changed."
msgstr ""

#: admin/folderadmin.py:422
#: admin/folderadmin.py:434
#, python-format
msgid "%(total_count)s selected"
msgid_plural "All %(total_count)s selected"
Expand All @@ -58,175 +58,171 @@ msgstr[3] ""
msgstr[4] ""
msgstr[5] ""

#: admin/folderadmin.py:448
#: admin/folderadmin.py:460
#, python-format
msgid "Directory listing for %(folder_name)s"
msgstr ""

#: admin/folderadmin.py:463
#: admin/folderadmin.py:475
#, python-format
msgid "0 of %(cnt)s selected"
msgstr ""

#: admin/folderadmin.py:600
#: admin/folderadmin.py:612
msgid "No action selected."
msgstr ""

#: admin/folderadmin.py:652
#: admin/folderadmin.py:664
#, python-format
msgid "Successfully moved %(count)d files to clipboard."
msgstr ""

#: admin/folderadmin.py:657
#: admin/folderadmin.py:669
msgid "Move selected files to clipboard"
msgstr ""

#: admin/folderadmin.py:697
#: admin/folderadmin.py:709
#, python-format
msgid "Successfully disabled permissions for %(count)d files."
msgstr ""

#: admin/folderadmin.py:699
#: admin/folderadmin.py:711
#, python-format
msgid "Successfully enabled permissions for %(count)d files."
msgstr ""

#: admin/folderadmin.py:707
#: admin/folderadmin.py:719
msgid "Enable permissions for selected files"
msgstr ""

#: admin/folderadmin.py:713
#: admin/folderadmin.py:725
msgid "Disable permissions for selected files"
msgstr ""

#: admin/folderadmin.py:777
#: admin/folderadmin.py:789
#, python-format
msgid "Successfully deleted %(count)d files and/or folders."
msgstr ""

#: admin/folderadmin.py:782
#: admin/folderadmin.py:794
msgid "Cannot delete files and/or folders"
msgstr ""

#: admin/folderadmin.py:784
#: admin/folderadmin.py:796
msgid "Are you sure?"
msgstr ""

#: admin/folderadmin.py:790
#: admin/folderadmin.py:802
msgid "Delete files and/or folders"
msgstr ""

#: admin/folderadmin.py:811
#: admin/folderadmin.py:823
msgid "Delete selected files and/or folders"
msgstr ""

#: admin/folderadmin.py:918
#: admin/folderadmin.py:930
#, python-format
msgid "Folders with names %s already exist at the selected destination"
msgstr ""

#: admin/folderadmin.py:922
#: admin/folderadmin.py:934
#, python-format
msgid ""
"Successfully moved %(count)d files and/or folders to folder "
"'%(destination)s'."
msgstr ""

#: admin/folderadmin.py:930 admin/folderadmin.py:932
#: admin/folderadmin.py:942 admin/folderadmin.py:944
msgid "Move files and/or folders"
msgstr ""

#: admin/folderadmin.py:947
#: admin/folderadmin.py:959
msgid "Move selected files and/or folders"
msgstr ""

#: admin/folderadmin.py:1004
#: admin/folderadmin.py:1016
#, python-format
msgid "Successfully renamed %(count)d files."
msgstr ""

#: admin/folderadmin.py:1013 admin/folderadmin.py:1015
#: admin/folderadmin.py:1030
#: admin/folderadmin.py:1025 admin/folderadmin.py:1027
#: admin/folderadmin.py:1042
msgid "Rename files"
msgstr ""

#: admin/folderadmin.py:1125
#: admin/folderadmin.py:1137
#, python-format
msgid ""
"Successfully copied %(count)d files and/or folders to folder "
"'%(destination)s'."
msgstr ""

#: admin/folderadmin.py:1143 admin/folderadmin.py:1145
#: admin/folderadmin.py:1155 admin/folderadmin.py:1157
msgid "Copy files and/or folders"
msgstr ""

#: admin/folderadmin.py:1162
#: admin/folderadmin.py:1174
msgid "Copy selected files and/or folders"
msgstr ""

#: admin/folderadmin.py:1267
#: admin/folderadmin.py:1279
#, python-format
msgid "Successfully resized %(count)d images."
msgstr ""

#: admin/folderadmin.py:1274 admin/folderadmin.py:1276
#: admin/folderadmin.py:1286 admin/folderadmin.py:1288
msgid "Resize images"
msgstr ""

#: admin/folderadmin.py:1292
#: admin/folderadmin.py:1303
msgid "Resize selected images"
msgstr ""

#: admin/forms.py:24
#: admin/forms.py:25
msgid "Suffix which will be appended to filenames of copied files."
msgstr ""

#: admin/forms.py:31
#: admin/forms.py:32
#, python-format
msgid ""
"Suffix should be a valid, simple and lowercase filename part, like "
"\"%(valid)s\"."
msgstr ""

#: admin/forms.py:52
#: admin/forms.py:53
#, python-format
msgid "Unknown rename format value key \"%(key)s\"."
msgstr ""

#: admin/forms.py:54
#: admin/forms.py:55
#, python-format
msgid "Invalid rename format: %(error)s."
msgstr ""

#: admin/forms.py:64 models/thumbnailoptionmodels.py:37
#: admin/forms.py:69 models/thumbnailoptionmodels.py:37
msgid "thumbnail option"
msgstr ""

#: admin/forms.py:67 models/thumbnailoptionmodels.py:15
#: admin/forms.py:73 models/thumbnailoptionmodels.py:15
msgid "width"
msgstr ""

#: admin/forms.py:68 models/thumbnailoptionmodels.py:20
#: admin/forms.py:74 models/thumbnailoptionmodels.py:20
msgid "height"
msgstr ""

#: admin/forms.py:69 models/thumbnailoptionmodels.py:25
#: admin/forms.py:75 models/thumbnailoptionmodels.py:25
msgid "crop"
msgstr ""

#: admin/forms.py:70 models/thumbnailoptionmodels.py:30
#: admin/forms.py:76 models/thumbnailoptionmodels.py:30
msgid "upscale"
msgstr ""

#: admin/forms.py:75
#: admin/forms.py:80
msgid "Thumbnail option or resize parameters must be choosen."
msgstr ""

#: admin/forms.py:77
msgid "Resize parameters must be choosen."
msgstr ""

#: admin/imageadmin.py:18 admin/imageadmin.py:105
msgid "Subject location"
msgstr ""
Expand Down Expand Up @@ -733,21 +729,17 @@ msgstr ""
msgid "The following images will be resized:"
msgstr ""

#: templates/admin/filer/folder/choose_images_resize_options.html:33
#: templates/admin/filer/folder/choose_images_resize_options.html:32
msgid "Choose an existing thumbnail option or enter resize parameters:"
msgstr ""

#: templates/admin/filer/folder/choose_images_resize_options.html:35
msgid "Choose resize parameters:"
msgstr ""

#: templates/admin/filer/folder/choose_images_resize_options.html:38
#: templates/admin/filer/folder/choose_images_resize_options.html:36
msgid ""
"Warning: Images will be resized in-place and originals will be lost. Maybe "
"first make a copy of them to retain the originals."
msgstr ""

#: templates/admin/filer/folder/choose_images_resize_options.html:41
#: templates/admin/filer/folder/choose_images_resize_options.html:39
msgid "Resize"
msgstr ""

Expand Down
Loading

0 comments on commit 1bb65f9

Please sign in to comment.