86 lines
3.3 KiB
HTML
86 lines
3.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" data-bs-theme="dark">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
|
<title>Testapp</title>
|
|
<style>
|
|
.darker-bg {
|
|
background-color: #171a1e;
|
|
}
|
|
.list-group {
|
|
width: 100%;
|
|
max-width: 460px;
|
|
margin-inline: 1.5rem;
|
|
}
|
|
.list-group-checkable .list-group-item {
|
|
cursor: pointer;
|
|
}
|
|
.list-group-item-check {
|
|
position: absolute;
|
|
clip: rect(0, 0, 0, 0);
|
|
}
|
|
.list-group-item-check:hover + .list-group-item {
|
|
background-color: var(--bs-secondary-bg);
|
|
}
|
|
.list-group-item-check:checked + .list-group-item {
|
|
color: #fff;
|
|
background-color: var(--bs-primary);
|
|
border-color: var(--bs-primary);
|
|
}
|
|
.list-group-item-check[disabled] + .list-group-item,
|
|
.list-group-item-check:disabled + .list-group-item {
|
|
pointer-events: none;
|
|
filter: none;
|
|
opacity: .5;
|
|
}
|
|
.list-group-radio .list-group-item {
|
|
cursor: pointer;
|
|
border-radius: .5rem;
|
|
}
|
|
.list-group-radio .form-check-input {
|
|
z-index: 2;
|
|
margin-top: -.5em;
|
|
}
|
|
.list-group-radio .list-group-item:hover,
|
|
.list-group-radio .list-group-item:focus {
|
|
background-color: var(--bs-secondary-bg);
|
|
}
|
|
|
|
.list-group-radio .form-check-input:checked + .list-group-item {
|
|
background-color: var(--bs-body);
|
|
border-color: var(--bs-primary);
|
|
box-shadow: 0 0 0 2px var(--bs-primary);
|
|
}
|
|
.list-group-radio .form-check-input[disabled] + .list-group-item,
|
|
.list-group-radio .form-check-input:disabled + .list-group-item {
|
|
pointer-events: none;
|
|
filter: none;
|
|
opacity: .5;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="px-4 py-5 my-5 text-center shadow darker-bg">
|
|
<h1 class="display-5 fw-bold text-body-emphasis">{{ question.question_text }}</h1>
|
|
<br/>
|
|
|
|
<form action="{% url 'polls:vote' question.id %}" method="post">
|
|
{% csrf_token %}
|
|
<fieldset class="d-flex flex-column flex-md-row col-lg-6 mx-auto align-items-center justify-content-center">
|
|
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
|
<div class="list-group list-group-checkable d-grid gap-2 border-0">
|
|
{% for choice in question.choice_set.all %}
|
|
<input class="list-group-item-check pe-none" type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
|
|
<label class="list-group-item rounded-3 py-3" for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br>
|
|
{% endfor %}
|
|
</div>
|
|
</fieldset>
|
|
<br/>
|
|
<input class="btn btn-success rounded-3 px-3" type="submit" value="Vote">
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</html> |