@ -9,7 +9,7 @@ from crispy_forms.bootstrap import Tab, TabHolder, PrependedText, FormActions
|
||||
from dal import autocomplete
|
||||
from leaflet.forms.widgets import LeafletWidget
|
||||
|
||||
from apps.files.models import File
|
||||
from apps.files.models import File, ImageFile
|
||||
|
||||
from .models import CaseStudy, SpatialRefSys
|
||||
from .widgets import CommaSeparatedTextInput
|
||||
@ -71,9 +71,6 @@ class ShortCaseStudyForm(BaseCaseStudyForm):
|
||||
'project_status',
|
||||
'synopsis',
|
||||
'full_description',
|
||||
'image',
|
||||
'image_caption',
|
||||
'image_credit',
|
||||
'video',
|
||||
'media_coverage_mainstream',
|
||||
'media_coverage_independent',
|
||||
@ -88,6 +85,19 @@ class BootstrapClearableFileInput(forms.ClearableFileInput):
|
||||
class LongCaseStudyForm(BaseCaseStudyForm):
|
||||
"""Long version of the CaseStudy form."""
|
||||
|
||||
images = forms.FileField(
|
||||
widget=BootstrapClearableFileInput(attrs={
|
||||
'url': reverse_lazy('files:upload'),
|
||||
'field': 'images_files',
|
||||
}), required=False
|
||||
)
|
||||
|
||||
images_files = forms.ModelMultipleChoiceField(
|
||||
queryset=ImageFile.objects.all(),
|
||||
widget=CommaSeparatedTextInput(),
|
||||
required=True
|
||||
)
|
||||
|
||||
official_project_documents = forms.FileField(
|
||||
widget=BootstrapClearableFileInput(attrs={
|
||||
'url': reverse_lazy('files:upload'),
|
||||
@ -201,9 +211,8 @@ class LongCaseStudyForm(BaseCaseStudyForm):
|
||||
'project_status',
|
||||
'synopsis',
|
||||
'full_description',
|
||||
'image',
|
||||
'image_caption',
|
||||
'image_credit',
|
||||
'images',
|
||||
'images_files',
|
||||
'video',
|
||||
'video_caption',
|
||||
'video_credit',
|
||||
|
Reference in New Issue
Block a user