Add registration and login templates plus UI stuff, moderation
This commit is contained in:
@ -6,15 +6,15 @@ from leaflet.forms.widgets import LeafletWidget
|
||||
from .models import CaseStudy
|
||||
|
||||
|
||||
class CaseStudyForm(forms.ModelForm):
|
||||
class BaseCaseStudyForm(forms.ModelForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CaseStudyForm, self).__init__(*args, **kwargs)
|
||||
super(BaseCaseStudyForm, self).__init__(*args, **kwargs)
|
||||
self.helper = FormHelper()
|
||||
self.helper.form_id = 'case-study-form'
|
||||
self.helper.form_class = 'form-horizontal'
|
||||
self.helper.form_method = 'post'
|
||||
self.helper.form_action = 'submit'
|
||||
self.helper.form_action = 'add'
|
||||
self.helper.label_class = 'col-lg-2'
|
||||
self.helper.field_class = 'col-lg-8'
|
||||
self.helper.add_input(Submit('submit', 'Submit'))
|
||||
@ -22,4 +22,33 @@ class CaseStudyForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = CaseStudy
|
||||
fields = '__all__'
|
||||
widgets = {'location': LeafletWidget()}
|
||||
widgets = {'location': LeafletWidget(attrs={})}
|
||||
|
||||
|
||||
class ShortCaseStudyForm(BaseCaseStudyForm):
|
||||
class Meta(BaseCaseStudyForm.Meta):
|
||||
fields = [
|
||||
'entry_name',
|
||||
'location',
|
||||
'sector_of_economy',
|
||||
'positive_or_negative',
|
||||
'country',
|
||||
'area_of_land',
|
||||
'land_ownership',
|
||||
'land_ownership_details',
|
||||
'location_context',
|
||||
'type_of_ecosystem',
|
||||
'describe_ecosystem',
|
||||
'affects_indigenous',
|
||||
'affects_indigenous_detail',
|
||||
'project_status',
|
||||
'synopsis',
|
||||
'full_description',
|
||||
'image',
|
||||
'community_voices'
|
||||
]
|
||||
|
||||
|
||||
class LongCaseStudyForm(BaseCaseStudyForm):
|
||||
class Meta(BaseCaseStudyForm.Meta):
|
||||
fields = '__all__'
|
||||
|
Reference in New Issue
Block a user