123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- {% extends "layout/public.j2" %}
- {% block head %}
- <title>{{ ballot.name }} - Democratic Assembly</title>
- {% endblock %}
- {% block content %}
- {% with messages = get_flashed_messages(with_categories=true) %}
- {% if messages %}
- {% for category, message in messages %}
- <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
- {{ message }}
- <button type="button" class="close" data-dismiss="alert" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- {% endfor %}
- {% endif %}
- {% endwith %}
- <h1>{{ ballot.name }}</h1>
- <table class="table table-sm">
- {% if ballot.description %}
- <tr>
- <th scope="row">Description</th>
- <td>{{ ballot.description }}</td>
- </tr>
- {% endif %}
- <tr>
- <th scope="row">Start</th>
- <td>{{ ballot.start_at }}</td>
- </tr>
- <tr>
- <th scope="row">Eindigt</th>
- <td>{{ ballot.end_at }}</td>
- </tr>
- {% if ballot.active() %}
- <tr>
- <th scope="row">Te gaan</th>
- <td class="countdown" date="{{ ballot.end_at }}"><span class="hours">00</span>:<span class="minutes">00</span>:<span class="seconds">00</span></td>
- </tr>
- {% endif %}
- <tr>
- <th scope="row">Aangemaakt door</th>
- <td>{{ ballot.user.name }}</td>
- </tr>
- {% if ballot.priority %}
- <tr>
- <th scope="row">Priority</th>
- <td>{{ ballot.priority.name }}</td>
- </tr>
- {% endif %}
- </table>
- {% if ballot.active() %}
- <form method="post">
- <div class="card mb-4">
- <div class="card-body">
- <h5 class="card-title">Controle code</h5>
- <input type="text" class="form-control" name="security_code" placeholder="code" required>
- </div>
- </div>
- {% for question in ballot.questions %}
- <div class="card mb-4">
- <div class="card-body">
- <h5 class="card-title">{{ question.name }}</h5>
- {% if question.description %}
- <p class="card-text">{{ question.description }}</p>
- {% endif %}
- {% for option in question.options %}
- <div class="form-check">
- <input class="form-check-input" type="radio" name="{{ question.id }}" id="{{ "option_%s" % option.id }}" value="{{ option.id }}">
- <label class="form-check-label" for="{{ "option_%s" % option.id }}">
- {{ option.name }}
- </label>
- </div>
- {% endfor %}
- </div>
- </div>
- {% endfor %}
- <div class="form-group pull-right">
- <button class="btn btn-primary" type="submit">Opslaan</button>
- </div>
- </form>
- {% else %}
- {% for question in ballot.questions %}
- <div class="card mb-4">
- <div class="card-body">
- <h5 class="card-title">{{ question.name }}</h5>
- {% if question.description %}
- <p class="card-text">{{ question.description }}</p>
- {% endif %}
- {% if question.combined_approval_voting %}
- <p class="card-text">Score: {{ question.score() }}</p>
- {% else %}
- <p class="card-text">Meeste stemmen: {{ question.score() }}</p>
- {% endif %}
- </div>
- <ul class="list-group list-group-flush">
- {% for option in question.options %}
- <li class="list-group-item d-flex justify-content-between align-items-center">
- {{ option.name }}
- <span class="badge badge-primary badge-pill">{{ option.votes.all() | count }}</span>
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endfor %}
- {% endif %}
- {% endblock %}
|