-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve formatting to be consistent with bootstrap 5 (#212)
- Loading branch information
Showing
8 changed files
with
326 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,84 +52,81 @@ | |
<body> | ||
{% load tz %} | ||
{% get_current_timezone as TIME_ZONE %} | ||
<nav class="navbar navbar-expand-sm navbar-dark bg-primary"> | ||
<div class="container-fluid"> | ||
<a class="navbar-brand" href="{% url 'index' %}">Vote, by ElectionScience.org</a> | ||
<button class="navbar-toggler" | ||
type="button" | ||
data-bs-toggle="collapse" | ||
data-bs-target="#navbarColor01" | ||
aria-controls="navbarColor01" | ||
aria-expanded="false" | ||
aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarColor01"> | ||
<ul class="navbar-nav me-auto"> | ||
<li class="nav-item"> | ||
<a href="{% url 'create' %}"> | ||
<button class="btn btn-primary my-2 my-sm-0" type="submit">Create</button> | ||
</a> | ||
</li> | ||
</ul> | ||
<ul class="nav navbar-nav justify-content-end"> | ||
{% block login %} | ||
<header> | ||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary"> | ||
<div class="container"> | ||
<a class="navbar-brand" href="{% url 'index' %}">Vote with Election Science</a> | ||
<button class="navbar-toggler" | ||
type="button" | ||
data-bs-toggle="collapse" | ||
data-bs-target="#navbarMain" | ||
aria-controls="navbarMain" | ||
aria-expanded="false" | ||
aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarMain"> | ||
<ul class="navbar-nav me-auto mb-2 mb-lg-0"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{% url 'create' %}">Create Election</a> | ||
</li> | ||
</ul> | ||
<ul class="navbar-nav"> | ||
{% if user.is_authenticated %} | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{% url 'my_info' %}">{% firstof user.username "My Profile" %}</a> | ||
<a class="nav-link" href="{% url 'my_info' %}">My Profile</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" | ||
href="{% url 'account_logout' %}?next={% url 'index' %}">Logout</a> | ||
</li> | ||
{% else %} | ||
{% if request.path != '/approval_polls/' %} | ||
<li class="nav-item"> | ||
<a class="nav-link" | ||
href="{% url 'account_login' %}?next={{ request.path }}">Login</a> | ||
</li> | ||
{% else %} | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{% url 'account_login' %}">Login</a> | ||
</li> | ||
{% endif %} | ||
<li class="nav-item"> | ||
<a class="nav-link" | ||
href="{% url 'account_login' %}{% if request.path != '/approval_polls/' %}?next={{ request.path }}{% endif %}">Login</a> | ||
</li> | ||
{% endif %} | ||
{% endblock login %} | ||
</ul> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</nav> | ||
<div class="container mt-5 mb-5"> | ||
<div class="row justify-content-center"> | ||
{% block content %} | ||
{% endblock content %} | ||
<div class="row-fluid mt-5"> | ||
<div class="col-md-12"> | ||
<hr> | ||
<p class="text-center"> | ||
This poll uses <a href="https://www.electionscience.org/approval-voting">approval voting</a>, instead of the more common plurality system. | ||
<br /> | ||
</nav> | ||
</header> | ||
<main class="container my-5"> | ||
{% block content %} | ||
{% endblock content %} | ||
</main> | ||
<footer class="bg-light py-4 mt-5"> | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-8 text-center"> | ||
<p> | ||
This election uses <a href="https://www.electionscience.org/approval-voting">approval voting</a>, instead of the more common plurality system. | ||
<br> | ||
<a href="https://www.electionscience.org/approval-voting">Learn why it's better</a> and | ||
<a href="{% url 'create' %}" target="_top">create your own poll</a>. | ||
<a href="{% url 'create' %}">create your own election</a>. | ||
</p> | ||
<div class="container mt-5"> | ||
<div class="row justify-content-center"> | ||
<div class="col-12 col-sm-10 col-md-8 col-lg-6 text-center"> | ||
<a href="https://www.electionscience.org" | ||
target="_blank" | ||
rel="noopener noreferrer"> | ||
<img src="{% static 'images/ces-horizontal-stack.png' %}" | ||
class="img-fluid mx-auto d-block" | ||
alt="Election Science Logo" | ||
style="max-width: 100%; | ||
min-width: 200px"> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
<a href="https://www.electionscience.org" | ||
target="_blank" | ||
rel="noopener noreferrer"> | ||
<img src="{% static 'images/ces-horizontal-stack.png' %}" | ||
class="img-fluid" | ||
alt="Election Science Logo" | ||
style="max-width: 200px"> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</footer> | ||
<!-- Add your scripts here --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" | ||
crossorigin="anonymous"></script> | ||
<script> | ||
$(function () { | ||
$('[data-toggle="tooltip"]').tooltip(); | ||
$('[data-toggle="popover"]').popover(); | ||
}); | ||
</script> | ||
{% block extra_js %}{% endblock %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,60 @@ | ||
{% extends 'base.html' %} | ||
{% block content %} | ||
{% if latest_poll_list %} | ||
<div class='row-fluid top-buffer'> | ||
<div class='col-md-12'> | ||
<h2>Latest Public Polls</h2> | ||
{% for poll in latest_poll_list %} | ||
<div class='well well-sm'> | ||
<a href="{% url 'detail' poll.id %}">{{ poll.question }}</a> | ||
<p>Published on {{ poll.pub_date|date:"N j, Y, P e" }} by {% firstof poll.user.username poll.user.first_name %}</p> | ||
</div> | ||
{% endfor %} | ||
<div class="container"> | ||
{% if latest_poll_list %} | ||
<h1 class="mb-4">Latest Public Polls</h1> | ||
<div class="row"> | ||
<div class="col-12"> | ||
{% for poll in latest_poll_list %} | ||
<div class="card mb-3"> | ||
<div class="card-body"> | ||
<h2 class="card-title h5"> | ||
<a href="{% url 'detail' poll.id %}">{{ poll.question }}</a> | ||
</h2> | ||
<p class="card-text"> | ||
Published on {{ poll.pub_date|date:"N j, Y, P e" }} by {% firstof poll.user.username poll.user.first_name %} | ||
</p> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
<div class='row-fluid top-buffer'> | ||
<div class='col-md-12'> | ||
<div class='text-center'> | ||
<nav aria-label="Poll list pagination" class="my-4"> | ||
<ul class="pagination justify-content-center"> | ||
{% if latest_poll_list.has_previous %} | ||
<a href='?page={{ latest_poll_list.previous_page_number }}'>«Previous</a> | ||
<li class="page-item"> | ||
<a class="page-link" | ||
href="?page={{ latest_poll_list.previous_page_number }}" | ||
aria-label="Previous"> | ||
<span aria-hidden="true">«</span> Previous | ||
</a> | ||
</li> | ||
{% endif %} | ||
(page {{ latest_poll_list.number }} of {{ latest_poll_list.paginator.num_pages }}) | ||
{% if latest_poll_list.has_next %}<a href='?page={{ latest_poll_list.next_page_number }}'>Next»</a>{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
{% else %} | ||
<div class='row-fluid top-buffer'> | ||
<div class='col-md-12'> | ||
<p>No polls are available.</p> | ||
</div> | ||
</div> | ||
{% endif %} | ||
<li class="page-item disabled"> | ||
<span class="page-link">Page {{ latest_poll_list.number }} of {{ latest_poll_list.paginator.num_pages }}</span> | ||
</li> | ||
{% if latest_poll_list.has_next %} | ||
<li class="page-item"> | ||
<a class="page-link" | ||
href="?page={{ latest_poll_list.next_page_number }}" | ||
aria-label="Next"> | ||
Next <span aria-hidden="true">»</span> | ||
</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% else %} | ||
<div class="alert alert-info" role="alert">No polls are available.</div> | ||
{% endif %} | ||
</div> | ||
{% endblock content %} | ||
{% block footer %} | ||
<a href='{% url 'create' %}'>Create a Poll</a> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-12 text-center"> | ||
<a href="{% url 'create' %}" class="btn btn-primary">Create a Poll</a> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.