Browse Source

textarea for some fields

jason 2 năm trước cách đây
mục cha
commit
a3ff4b1db3
2 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 1 2
      backstage/collections/forms.py
  2. 1 1
      backstage/templates/collections.html

+ 1 - 2
backstage/collections/forms.py

@@ -18,13 +18,12 @@ class CollectionCreateForm(FlaskForm):
     bednum = SelectField('格局', choices=['1房', '2房', '3房', '4房以上',],validators=[DataRequired()])
     housetype = SelectField('屋型', choices=['大樓', '透天'], validators=[DataRequired()])
     designer = StringField('設計師', validators=[DataRequired()])
-    space = StringField('設計空間', validators=[DataRequired()])
+    space = TextAreaField('設計空間', validators=[DataRequired()])
     loc = SelectField('地區', choices=['台北','新北','基隆','桃園','新竹','苗栗','台中','南投','彰化','雲林','嘉義','台南','高雄','屏東','宜蘭','花蓮','台東','澎湖','金門','馬祖','其他'], validators=[DataRequired()])
     budget = StringField('總預算', validators=[DataRequired()])
     construction = StringField('建案名稱', validators=[DataRequired()])
     collectiondesc = TextAreaField('作品集描述', validators=[DataRequired()])
     # collectionslider = MultipleFileField('作品集圖片集', validators=[FileRequired(), FileAllowed(['jpg', 'png', 'gif', 'webp'], 'Images only!')])
-    collectionslider = []
     comment = FileField('Comment', validators=[FileRequired(), FileAllowed(['jpg', 'png', 'gif', 'webp'], 'Images only!')])
 
 

+ 1 - 1
backstage/templates/collections.html

@@ -76,7 +76,7 @@
     {{ form.housetype.label(class="form-control-label modal__label mt-3 mb-1") }}
     {{ form.housetype(class="form-control form-control-lg") }}
 
-    {{ form.space.label(class="form-control-label modal__label mt-3 mb-1") }}
+    {{ form.space.label(class="form-control-label modal__label mt-3 mb-1").content(rows='2') }}
     {{ form.space(class="form-control form-control-lg") }}
 
     {{ form.loc.label(class="form-control-label modal__label mt-3 mb-1") }}