diff --git a/app/__init__.py b/app/__init__.py index 97690884..aab9ef3f 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -353,8 +353,7 @@ def create_app(config_class=DevConfig): app.jinja_env.autoescape = select_autoescape(default_for_string=True, default=True) app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True - # previously in Flask-Bootstrap: - app.jinja_env.globals["bootstrap_is_hidden_field"] = lambda field: isinstance( + app.jinja_env.globals["is_hidden_field"] = lambda field: isinstance( field, HiddenField ) diff --git a/app/forms/main/config_logos.py b/app/forms/main/config_logos.py index 31f8bc6f..bd88618c 100644 --- a/app/forms/main/config_logos.py +++ b/app/forms/main/config_logos.py @@ -39,15 +39,13 @@ from wtforms import ValidationError from wtforms.fields.simple import StringField, HiddenField from app.models import Departement -from app.scodoc import sco_logos, html_sco_header +from app.scodoc import sco_logos from app.scodoc import sco_utils as scu from app.scodoc.sco_config_actions import LogoInsert from app.scodoc.sco_exceptions import ScoValueError from app.scodoc.sco_logos import find_logo -CSSSTYLES = html_sco_header.BOOTSTRAP_CSS -JAVASCRIPTS = html_sco_header.BOOTSTRAP_JS # class ItemForm(FlaskForm): # """Unused Generic class to document common behavior for classes @@ -367,6 +365,7 @@ def _make_data(modele): class LogosConfigurationForm(FlaskForm): "Panneau de configuration des logos" + depts = FieldList(FormField(DeptForm)) def __init__(self, *args, **kwargs): diff --git a/app/scodoc/TrivialFormulator.py b/app/scodoc/TrivialFormulator.py index cbabc42d..b1525510 100644 --- a/app/scodoc/TrivialFormulator.py +++ b/app/scodoc/TrivialFormulator.py @@ -40,6 +40,7 @@ def TrivialFormulator( submitbuttonattributes=None, top_buttons=False, # place buttons at top of form bottom_buttons=True, # buttons after form + html_head_markup="", html_foot_markup="", readonly=False, is_submitted=False, @@ -116,6 +117,7 @@ def TrivialFormulator( submitbuttonattributes=submitbuttonattributes or [], top_buttons=top_buttons, bottom_buttons=bottom_buttons, + html_head_markup=html_head_markup, html_foot_markup=html_foot_markup, readonly=readonly, is_submitted=is_submitted, @@ -152,6 +154,7 @@ class TF(object): submitbuttonattributes=None, top_buttons=False, # place buttons at top of form bottom_buttons=True, # buttons after form + html_head_markup="", # html snippet put at the beginning, just before the table html_foot_markup="", # html snippet put at the end, just after the table readonly=False, is_submitted=False, @@ -178,6 +181,7 @@ class TF(object): self.submitbuttonattributes = submitbuttonattributes or [] self.top_buttons = top_buttons self.bottom_buttons = bottom_buttons + self.html_head_markup = html_head_markup self.html_foot_markup = html_foot_markup self.title = title self.after_table = after_table @@ -425,22 +429,15 @@ class TF(object): hiddenitemtemplate = "%(elem)s" separatortemplate = '