resultat vote

This commit is contained in:
2025-09-04 21:18:22 +02:00
parent 48781d086e
commit 21230d6ca5
6 changed files with 143 additions and 2 deletions

View File

@@ -51,7 +51,29 @@
</div>
<div class='card-body'>
{{project.summary|nl2br}}
{% if project.status=="Voté" or project.status=="Archivé" %}
<small>
<hr>
<div class="row">
<div class="col-xs-6">
{% for option in project.options %}
{{ option.title|title }} = {{ option.nbVote }}<br>
{% endfor %}
</div>
<div class="col-xs-6">
Votes Blancs = {{ project.nbVoteWhite }}<br>
Votes Nuls = {{ project.nbVoteNull }}
</div>
</div>
<hr>
<strong>Résultat = </strong><br>
{{ project.resultVote|nl2br }}
</small>
{% endif %}
</div>
<div class='card-footer' style="line-height:14px">
<small><em>
{% if project.dueDate %}

View File

@@ -1 +0,0 @@

View File

@@ -82,6 +82,29 @@
</div>
<div class="col-md-8 mx-auto">
{% if project.status=="Voté" or project.status=="Archivé" %}
<div class="card mt-3">
<div class="card-header">Vote</div>
<div class="card-body">
<div class="row" style="font-size:150%">
<div class="col-md-6">
{% for option in project.options %}
{{ option.title|title }} = {{ option.nbVote }}<br>
{% endfor %}
</div>
<div class="col-md-6">
Votes Blancs = {{ project.nbVoteWhite }}<br>
Votes Nuls = {{ project.nbVoteNull }}
</div>
</div>
<hr>
<strong>Résultat = </strong><br>
{{ project.resultVote|nl2br }}
</div>
</div>
{% endif %}
<div style="display:flex;" class="mt-3">
{% for option in project.options %}
<div class="card" style="flex:1 1 0">

View File

@@ -0,0 +1,63 @@
{% extends 'base.html.twig' %}
{% block title %} = {{title}}{% endblock %}
{% block body %}
<h1>{{title}}</h1>
{% include('include/error.html.twig') %}
{{ form_start(form) }}
{{ form_widget(form.submit) }}
<a href="{{ path(routecancel,{id:project.id}) }}" class="btn btn-secondary me-5">Annuler</a>
<div class="row">
<!-- Colonne VOTE -->
<div class="col-md-4 ms-auto d-flex flex-column">
<div class="card mt-3 flex-fill d-flex flex-column">
<div class="card-header">Vote</div>
<div class="card-body flex-fill">
<div class="list-group h-100">
{% for optionForm in form.options %}
<div class="list-group-item d-flex justify-content-between align-items-center">
<span class="fw-bold">{{ optionForm.title.vars.value }}</span>
<div style="width:120px;">
{{ form_widget(optionForm.nbVote, {'attr': {'class': 'form-control form-control-sm'}}) }}
</div>
</div>
{% endfor %}
<div class="list-group-item d-flex justify-content-between align-items-center">
<span class="fw-bold">{{ form.nbVoteWhite.vars.label }}</span>
<div style="width:120px;">
{{ form_widget(form.nbVoteWhite, {'attr': {'class': 'form-control form-control-sm'}}) }}
</div>
</div>
<div class="list-group-item d-flex justify-content-between align-items-center">
<span class="fw-bold">{{ form.nbVoteNull.vars.label }}</span>
<div style="width:120px;">
{{ form_widget(form.nbVoteNull, {'attr': {'class': 'form-control form-control-sm'}}) }}
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Colonne RESULT -->
<div class="col-md-4 me-auto d-flex flex-column">
<div class="card mt-3 flex-fill d-flex flex-column">
<div class="card-header">Résultat</div>
<div class="card-body flex-fill d-flex flex-column">
{{ form_widget(form.resultVote, { 'attr': { 'class': 'flex-fill w-100' } }) }}
</div>
</div>
</div>
</div>
<div style="display:none;">
{{ form_rest(form) }}
</div>
{{ form_end(form, { render_rest: false }) }}
{% endblock %}