From b895d1f8f12a3d087f746333b3d7867e4a886951 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Sat, 24 Sep 2022 16:17:03 +0200 Subject: [PATCH] Replace render_kw --- advlabdb/forms.py | 4 +--- advlabdb/model_dependent_funs.py | 1 - .../assistant_group_experiment_form.jinja.html | 10 +++++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/advlabdb/forms.py b/advlabdb/forms.py index fc54069..148741c 100644 --- a/advlabdb/forms.py +++ b/advlabdb/forms.py @@ -6,7 +6,7 @@ from .model_dependent_funs import selection_mark_field class AssistantGroupExperimentFormBase(FlaskForm): - submit = SubmitField(label="Save", render_kw={"class": "btn btn-primary btn-block"}) + submit = SubmitField(label="Save") def assistant_group_experiment_form_factory(current_user, group_experiment): @@ -15,7 +15,6 @@ def assistant_group_experiment_form_factory(current_user, group_experiment): "Note", default=group_experiment.note, validators=[Optional()], - render_kw={"class": "form-control"}, ) appointments = group_experiment.appointments @@ -35,7 +34,6 @@ def assistant_group_experiment_form_factory(current_user, group_experiment): default=appointment.date, validators=[DataRequired()], description=description, - render_kw={"class": "form-control"}, ), ) appointment_num += 1 diff --git a/advlabdb/model_dependent_funs.py b/advlabdb/model_dependent_funs.py index 7a33582..061d97d 100644 --- a/advlabdb/model_dependent_funs.py +++ b/advlabdb/model_dependent_funs.py @@ -54,7 +54,6 @@ def selection_mark_field(mark_type: str, default): default=default, choices=choices, validators=[DataRequired()], - render_kw={"class": "form-control", "style": "width:auto;"}, ) diff --git a/advlabdb/templates/assistant_group_experiment_form.jinja.html b/advlabdb/templates/assistant_group_experiment_form.jinja.html index bafae44..d30d3d5 100644 --- a/advlabdb/templates/assistant_group_experiment_form.jinja.html +++ b/advlabdb/templates/assistant_group_experiment_form.jinja.html @@ -83,7 +83,7 @@ {% for appointment_field in appointment_fields %} - {{ appointment_field }} + {{ appointment_field(class="form-control") }} {{ appointment_field.description }} @@ -128,10 +128,10 @@ {{ student }} - {{ oral_experiment_mark }} + {{ oral_experiment_mark(class="form-control", style="width: auto;") }} - {{ protocol_experiment_mark }} + {{ protocol_experiment_mark(class="form-control", style="width: auto;") }} {% if final_experiment_mark is none %} @@ -159,13 +159,13 @@
- {{ form.note }} + {{ form.note(class="form-control") }}

- {{ form.submit }} + {{ form.submit(class="btn btn-primary btn-block") }}