Skip to content

Commit

Permalink
'Solution'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTarasov57 committed Oct 30, 2024
1 parent 82b8565 commit e8dc728
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
39 changes: 30 additions & 9 deletions templates/includes/pagination.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% if is_paginated %}
<ul class="pagination">
{% if page_obj.has_previous %}
<li class="page-item">
{% if is_paginated %}
<a href="?page={{ page_obj.previous_page_number }}" class="page-link">Prev</a>
{% else %}
<a href="#" class="page-link">1</a>
{% endif %}
</li>
{% else %}
<li class="page-item disabled">
<a href="#" class="page-link">Prev</a>
</li>
{% endif %}

</body>
</html>
<li class="page-item active">
<span class="page-link">{{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</span>
</li>

{% if page_obj.has_next %}
<li class="page-item">
<a href="?page={{ page_obj.next_page_number }}" class="page-link">Next</a>
</li>
{% else %}
<li class="page-item disabled">
<a href="#" class="page-link">Next</a>
</li>
{% endif %}
</ul>
{% endif %}
4 changes: 2 additions & 2 deletions templates/taxi/driver_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<h2>Driver of detail</h2>
<p>{{ driver.first_name }} {{ driver.last_name}}</p>
<ul>
<p>{% for driver in driver.cars.all %}
{% for driver in driver.cars.all %}
<li>{{ driver.model}}</li>
{% endfor %}</p>
{% endfor %}
</ul>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/taxi/manufacturer_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h2>Manufacturers of list</h2>
{% if manufacturer_list %}
<ul>
{% for manufacturer in manufacturer_list %}
<li>{{ manufacturer.name }} h</li>
<li>{{ manufacturer.name }}</li>
{% endfor %}
</ul>
{% endif %}
Expand Down

0 comments on commit e8dc728

Please sign in to comment.