|
|
@@ -209,6 +209,7 @@ class ProductForm(forms.ModelForm, GeneralFields):
|
|
|
|
|
|
class Meta:
|
|
|
model = Product
|
|
|
+ type = 'BASE'
|
|
|
fields = ( 'terms', 'name','claim','beschreibung','learning','gruendungsjahr','betriebgenommen','status',
|
|
|
'adresse', 'adresse_zusatz', 'plz', 'website','email','frei','kfrei','ort','rechtsform','orga','mitmachen',
|
|
|
'edit','public','type', )
|
|
|
@@ -231,8 +232,9 @@ class ProductForm(forms.ModelForm, GeneralFields):
|
|
|
self.fields['orga'].help_text = extend_help_text (self.fields['orga'].help_text, Product.ORGANIZATION)
|
|
|
self.fields['rechtsform'].help_text = extend_help_text (self.fields['rechtsform'].help_text, Product.RECHTSFORM)
|
|
|
|
|
|
- self.helper = FormHelper()
|
|
|
- self.helper.form_tag = False
|
|
|
+ self.helper = FormHelper( )
|
|
|
+ self.helper.attrs = {'id': 'upload_mab', 'enctype': 'multipart/form-dat' }
|
|
|
+ # self.helper.form_tag = True
|
|
|
|
|
|
self.product_layout = Layout(
|
|
|
Fieldset(
|
|
|
@@ -264,13 +266,53 @@ class ProductForm(forms.ModelForm, GeneralFields):
|
|
|
'edit','public', 'mitmachen', 'type',
|
|
|
),
|
|
|
)
|
|
|
- self.helper.layout = self.product_layout
|
|
|
+
|
|
|
+ self.submit_layout = Layout(
|
|
|
+ 'terms',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ HTML("<br>"),
|
|
|
+
|
|
|
+ Div(
|
|
|
+ Div(
|
|
|
+ ButtonHolder(
|
|
|
+ Submit('submit', 'Speichern',
|
|
|
+ onclick='this.form.action="./";',
|
|
|
+ css_class='border-thin mybtn')
|
|
|
+ ),
|
|
|
+ css_class='col-sm-4 col-4'),
|
|
|
+ Div(
|
|
|
+ ButtonHolder(
|
|
|
+ Submit('submit', 'Speichern & Bilder hochladen',
|
|
|
+ onclick='this.form.action="{}";'.format( reverse_lazy( 'neues-projekt-submit-pics', kwargs= { 'type': self.Meta.type } ) ),
|
|
|
+ css_class='border-thin mybtn')
|
|
|
+ ),
|
|
|
+ css_class='col-sm-4 col-4'),
|
|
|
+ Div(
|
|
|
+ ButtonHolder(
|
|
|
+ Submit('submit', 'Speichern und Freischaltung Anfragen',
|
|
|
+ onclick='this.form.action="{}";'.format( reverse_lazy( 'neues-projekt-publish', kwargs= { 'type': self.Meta.type } ) ),
|
|
|
+ css_class='border-thin mybtn'
|
|
|
+ ),
|
|
|
+ HTML("<br><p>Dein Projekt ist noch nicht für jede Person sichtbar, damit wir dein Projekt freischalten, klicke auf diesen Button.</p>")
|
|
|
+ ),
|
|
|
+ css_class='col-sm-4 col-4'),
|
|
|
+ css_class='form-row row'),
|
|
|
+ )
|
|
|
+
|
|
|
+
|
|
|
+ self.helper.layout = Layout(
|
|
|
+ self.product_layout,
|
|
|
+ self.submit_layout,
|
|
|
+ )
|
|
|
|
|
|
|
|
|
class MobilitaetsForm(ProductForm):
|
|
|
|
|
|
class Meta():
|
|
|
model = MobilitaetsProjekt
|
|
|
+ type = 'MOBI'
|
|
|
fields = ProductForm.Meta.fields + ( )
|
|
|
|
|
|
def __init__(self,*args, **kwargs):
|
|
|
@@ -282,6 +324,7 @@ class ErnaehrungsForm(ProductForm):
|
|
|
|
|
|
class Meta():
|
|
|
model = ErnaehrungsProjekt
|
|
|
+ type = 'ERNA'
|
|
|
fields = ProductForm.Meta.fields + ( )
|
|
|
|
|
|
def __init__(self,*args, **kwargs):
|
|
|
@@ -292,6 +335,7 @@ class EnergyForm(ProductForm):
|
|
|
|
|
|
class Meta():
|
|
|
model = EnergyProjekt
|
|
|
+ type = 'ENER'
|
|
|
fields = ProductForm.Meta.fields + ( )
|
|
|
|
|
|
def __init__(self,*args, **kwargs):
|
|
|
@@ -303,6 +347,7 @@ class WohnprojektForm(ProductForm):
|
|
|
|
|
|
class Meta:
|
|
|
model = Wohnprojekt
|
|
|
+ type = 'WOHN'
|
|
|
fields = ProductForm.Meta.fields + (
|
|
|
'eigentum', 'inseratstext', 'altneu', 'schwerpunkt', 'wohnbaufoerderung', 'artmodell', 'bautraeger', 'architektur', 'aerwachsene', 'akinder', 'awohnungen', 'wohnflaeche', 'gewerbeflaechen', 'gemeinschaftsflaeche', 'sonstige_flaechen', 'flaeche', 'kflaechen', 'gemeinschaftr', 'kgemeinschaftr', 'gewerbe', 'sonderwohnformen', 'raumangebot', 'kraumangebot', 'parbeiten', 'karbeiten', 'bauweise', 'zielgruppen', 'gprojekte', 'oekologie', 'freiraumangebote', 'gaestwohnungen', 'urbanem',
|
|
|
)
|
|
|
@@ -318,7 +363,7 @@ class WohnprojektForm(ProductForm):
|
|
|
self.fields['zielgruppen'].widget = ListTextWidget(data_list=Wohnprojekt.ZIELGRUPPEN, name='zielgruppen_list')
|
|
|
self.fields['gprojekte'].widget = ListTextWidget(data_list=Wohnprojekt.GPROJEKTE, name='gprojekte_list')
|
|
|
self.fields['freiraumangebote'].widget = ListTextWidget(data_list=Wohnprojekt.FREIANGEBOT, name='freiraumangebote_list')
|
|
|
- self.fields['gewerbe'].widget = ListTextWidget(data_list=Wohnprojekt.GEWERBE, name='gewerbe_list')
|
|
|
+ # self.fields['gewerbe'].widget = ListTextWidget(data_list=Wohnprojekt.GEWERBE, name='gewerbe_list')
|
|
|
#
|
|
|
#
|
|
|
self.fields['bauweise'].help_text = extend_help_text (self.fields['bauweise'].help_text, Wohnprojekt.BAUWEISE)
|
|
|
@@ -331,9 +376,9 @@ class WohnprojektForm(ProductForm):
|
|
|
#
|
|
|
#
|
|
|
self.fields['type'].initial = 'WOHN'
|
|
|
-
|
|
|
- self.helper = FormHelper()
|
|
|
- self.helper.form_tag = False
|
|
|
+ #
|
|
|
+ # self.helper = FormHelper()
|
|
|
+ # self.helper.form_tag = False
|
|
|
self.helper.layout = Layout(
|
|
|
self.product_layout,
|
|
|
|
|
|
@@ -380,7 +425,8 @@ class WohnprojektForm(ProductForm):
|
|
|
|
|
|
'bauweise', 'zielgruppen', 'gprojekte', 'oekologie', 'freiraumangebote', 'urbanem',
|
|
|
|
|
|
- )
|
|
|
+ ),
|
|
|
+ self.submit_layout,
|
|
|
)
|
|
|
|
|
|
|