diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-06-11 17:57:00 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:21 +0100 |
commit | dc9d77a2c32be8d0e53fdf39f9b13616e8adad53 (patch) | |
tree | a80266247002ba5b6c2e4095bea6aad33ae727df /ishtar_common/forms_common.py | |
parent | 86a34f66b09d211cddc6f9516da948d9abd75ead (diff) | |
download | Ishtar-dc9d77a2c32be8d0e53fdf39f9b13616e8adad53.tar.bz2 Ishtar-dc9d77a2c32be8d0e53fdf39f9b13616e8adad53.zip |
Documents sheet: new fields - better layout
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r-- | ishtar_common/forms_common.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index f389ab84d..4dd55c38a 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -1261,7 +1261,8 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): form_admin_name = _("Document - General") form_slug = "document-general" file_upload = True - extra_form_modals = ["author", "person", "organization", "documenttag"] + extra_form_modals = ["author", "person", "organization", "documenttag", + "container"] associated_models = {'source_type': models.SourceType, 'support_type': models.SupportType, 'publisher': models.Organization, @@ -1271,7 +1272,7 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): title = forms.CharField(label=_("Title"), required=False, validators=[validators.MaxLengthValidator(200)]) source_type = widgets.ModelChoiceField( - model=models.SourceType, label=_("Source type"), choices=[], + model=models.SourceType, label=_("Type"), choices=[], required=False) support_type = widgets.ModelChoiceField( model=models.SupportType, label=_("Support"), choices=[], @@ -1320,7 +1321,7 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): label=_("Source"), model=models.Document, required=False) source_free_input = forms.CharField( - label=_("Source free input"), + label=_("Source - free input"), validators=[validators.MaxLengthValidator(500)], required=False) associated_url = forms.URLField( max_length=1000, required=False, @@ -1376,8 +1377,8 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): 'authors', 'receipt_date', 'receipt_date_in_documentation', 'creation_date', 'publisher', 'language', 'isbn', 'issn', 'licenses', - 'container', "container_ref", 'source', 'source_free_input', + 'container', "container_ref", 'comment', 'description', 'additional_information', 'duplicate' ] @@ -1388,6 +1389,7 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): 'authors': FormHeader(_("Authors")), 'receipt_date': FormHeader(_("Dates")), 'publisher': FormHeader(_("Publishing"), collapse=True), + 'source': FormHeader(_("Source"), collapse=True), 'container': FormHeader(_("Container"), collapse=True), 'comment': FormHeader(_("Advanced"), collapse=True), 'finds': FormHeader(_("Related items")), @@ -1397,6 +1399,10 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): ("tags", ("ishtar_common.add_documenttag",), {"new": True}), ("authors", ("ishtar_common.add_author",), {"new": True}), ("publisher", ("ishtar_common.add_organization",), {"new": True}), + ("container", ("archaeological_warehouse.add_container",), + {"new": True}), + ("container_ref", ("archaeological_warehouse.add_container",), + {"new": True}), ] def __init__(self, *args, **kwargs): |