-
Notifications
You must be signed in to change notification settings - Fork 34
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
- Loading branch information
Showing
6 changed files
with
279 additions
and
266 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
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.