Merge pull request 'ameliioration placement (adapte la taille du select au contenu)' (#140) from jmplace/ScoDoc-Lille:placement_amelioration into master

Reviewed-on: https://scodoc.org/git/viennet/ScoDoc/pulls/140
This commit is contained in:
Emmanuel Viennet 2021-09-30 17:51:07 +02:00
commit 1c927cb541
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 groups_tree[partition][group_name] = group_id
if partition != TOUS: if partition != TOUS:
has_groups = True has_groups = True
nb_groups = len(groups_tree)
else: else:
has_groups = False 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 return groups_tree, has_groups, nb_groups

View File

@ -3,7 +3,7 @@
{% macro render_field(field) %} {% macro render_field(field) %}
<tr> <tr>
<td class="wtf-field">{{ field.label }}</td> <td class="wtf-field">{{ field.label }}</td>
<td class="wtf-field">{{ field()|safe }} <td class="wtf-field">{{ field(**kwargs)|safe }}
{% if field.errors %} {% if field.errors %}
<ul class=errors> <ul class=errors>
{% for error in field.errors %} {% for error in field.errors %}
@ -27,7 +27,7 @@
{{ render_field(form.nb_rangs) }} {{ render_field(form.nb_rangs) }}
{{ render_field(form.etiquetage) }} {{ render_field(form.etiquetage) }}
{% if form.has_groups %} {% 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 <!-- 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 %} {% for partition in form.groups_tree %}
<tr> <tr>