1
0
forked from ScoDoc/ScoDoc

ameliioration placement (adapte la taille du select au contenu)

This commit is contained in:
Jean-Marie Place 2021-09-30 17:11:03 +02:00
parent a447c6e5f9
commit 4a3e37d371
2 changed files with 3 additions and 4 deletions

View File

@ -88,10 +88,9 @@ def _get_group_info(evaluation_id):
groups_tree[partition][group_name] = group_id
if partition != TOUS:
has_groups = True
nb_groups = len(groups_tree)
else:
has_groups = False
nb_groups = 1
nb_groups = sum([len(groups_tree[p]) for p in groups_tree])
return groups_tree, has_groups, nb_groups

View File

@ -3,7 +3,7 @@
{% macro render_field(field) %}
<tr>
<td class="wtf-field">{{ field.label }}</td>
<td class="wtf-field">{{ field()|safe }}
<td class="wtf-field">{{ field(**kwargs)|safe }}
{% if field.errors %}
<ul class=errors>
{% for error in field.errors %}
@ -27,7 +27,7 @@
{{ render_field(form.nb_rangs) }}
{{ render_field(form.etiquetage) }}
{% if form.has_groups %}
{{ render_field(form.groups) }}
{{ render_field(form.groups, size=form.nb_groups) }}
<!-- Tentative de recréer le choix des groupes sous forme de cases à cocher // demande à créer des champs wtf dynamiquement
{% for partition in form.groups_tree %}
<tr>