From 79810a785ecd31185629750b4f272c30698aa2dd Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 26 Apr 2018 13:27:46 +0200 Subject: Operations: add ishtar images panel (refs #4076) --- archaeological_operations/forms.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'archaeological_operations/forms.py') diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 2309a4f4a..c780fdcd7 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -50,9 +50,9 @@ from ishtar_common import widgets from ishtar_common.forms import FinalForm, FormSet, get_now, \ reverse_lazy, get_form_selection, TableSelect, get_data_from_formset, \ - ManageOldType, IshtarForm, CustomForm, FieldType + ManageOldType, IshtarForm, CustomForm, FieldType, FormSetWithDeleteSwitches from ishtar_common.forms_common import TownFormSet, SourceForm, SourceSelect, \ - get_town_field, TownForm, get_image_help + get_town_field, TownForm, get_image_help, BaseImageForm from archaeological_operations.utils import parse_parcels @@ -1025,6 +1025,14 @@ class CollaboratorForm(CustomForm, IshtarForm): self.fields['collaborator'].widget.attrs['full-width'] = True +ImagesFormset = formset_factory(BaseImageForm, can_delete=True, + formset=FormSet) +ImagesFormset.file_upload = True +ImagesFormset.form_label = _(u"Images") +ImagesFormset.form_admin_name = _(u"Operation - 025 - Images") +ImagesFormset.form_slug = "operation-025-images" + + class OperationFormPreventive(CustomForm, IshtarForm): form_label = _(u"Preventive informations - excavation") form_admin_name = _(u"Operation - 033 - Preventive - Excavation") -- cgit v1.2.3