generated from Code-Institute-Org/ci-full-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move code before and after recipe "for" loop to separate files #88
Keeping in line with the principle of DRY, the same code can be used on 2 pages (and on future Filter or Favourites pages as well)
- Loading branch information
Showing
4 changed files
with
41 additions
and
53 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
17 changes: 17 additions & 0 deletions
17
collection/templates/collection/snippets/after_recipe_list.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- code that comes after the for loop creating the list of recipes on index.html and search_results.html --> | ||
</div> | ||
</div> | ||
</div> | ||
{% if is_paginated %} | ||
<nav aria-label="Page navigation"> | ||
<ul class="pagination justify-content-center"> | ||
{% if page_obj.has_previous %} | ||
<li><a href="?page={{ page_obj.previous_page_number }}" class="page-link"> « PREV</a></li> | ||
{% endif %} | ||
{% if page_obj.has_next %} | ||
<li><a href="?page={{ page_obj.next_page_number }}" class="page-link"> NEXT »</a></li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% endif %} | ||
</div> |
8 changes: 8 additions & 0 deletions
8
collection/templates/collection/snippets/before_recipe_list.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- code that comes before the for loop creating the list of recipes on index.html and search_results.html --> | ||
|
||
<div class="container-fluid"> | ||
<div class="row"> | ||
|
||
<!-- Blog Entries Column --> | ||
<div class="col-12 mt-3 left"> | ||
<div class="row"> |