[Eleves] Affichage Eleves

This commit is contained in:
mckmonster 2024-07-17 17:23:33 +02:00
parent 2b5cc846c2
commit 621da28094
2 changed files with 31 additions and 7 deletions

View file

@ -2,6 +2,7 @@
use YesWiki\Core\YesWikiAction;
use YesWiki\Bazar\Service\EntryManager;
use YesWiki\Bazar\Service\ListManager;
class ElevesAction extends YesWikiAction
{
@ -17,7 +18,11 @@ class ElevesAction extends YesWikiAction
$entryManager = $this->getService(EntryManager::class);
$eleves = $entryManager->search(['formsIds' => $formId]);
// echo '<p>'.var_dump($eleves).'</p>';
return $this->render('@meeo/edu_eleves.twig', ['eleves' => $eleves]);
$listManager = $this->getService(ListManager::class);
$classes = $listManager->getOne('ListeClasses');
return $this->render('@meeo/edu_eleves.twig', ['eleves' => $eleves, 'classes' => $classes['label']]);
}
}

View file

@ -1,10 +1,29 @@
<div>
<div class="container">
<div class="row">
<div class="col-sm-8"><h2>Nom</h5></div>
<div class="col-sm-3"><h2>Classe</h2></div>
<div class="col-sm-1 text-center"><h2><span class="glyphicon glyphicon-trash"></span></h2></div>
</div>
<form>
{% for eleve in eleves|sort %}
{% if eleve['listeListeClassesbf_classe'] != 'aucune' %}
<div class="row">
<div class="col-sm-8">{{ eleve['bf_nom'] }}</div>
<div class="col-sm-4">{{ eleve['listeListeClassesbf_classe'] }}</div>
</div>
{% endif %}
<div class="col-sm-3">
<select id="{{eleve['id_fiche']}}_classe" name="{{eleve['id_fiche']}}_classe" class="form-control">
{% for identifier, classe in classes %}
<option value="{{identifier}}">{{classe}}</option>
{% endfor %}
</select>
</div>
<div class="col-sm-1 text-center">
<input class="form-check-iput" type="checkbox" value=""/>
</div>
</div>
{% endfor %}
<div class="row">
<div class="col-sm-12 text-center">
<button class="btn btn-default">Valider</button>
</div>
</div>
</form>
</div>