|
@@ -1,115 +1,101 @@
|
|
|
-<!DOCTYPE html>
|
|
|
-<html>
|
|
|
-<head>
|
|
|
- <title>{{ ballot.name }} - ssg</title>
|
|
|
- <meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
- <script src="/static/js/main.js"></script>
|
|
|
-</head>
|
|
|
-<body>
|
|
|
- <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
|
- <a class="navbar-brand" href="/"><img src="/static/uploads/logo.png" style="height: 27px"></a>
|
|
|
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
- <span class="navbar-toggler-icon"></span>
|
|
|
- </button>
|
|
|
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
|
- {% block nav %}{% endblock %}
|
|
|
+{% 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>
|
|
|
- </nav>
|
|
|
- <div class="container mt-3">
|
|
|
- {% 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>
|
|
|
+ </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 %}
|
|
|
- </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>
|
|
|
+ {% 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 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 %}
|
|
|
- </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 %}
|
|
|
+ </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 %}
|
|
|
</div>
|
|
|
-</body>
|
|
|
+ <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 %}
|