Skip to content

Commit

Permalink
Show secondary_carousel only if there pets objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Fer-Bar committed May 23, 2024
1 parent b760da6 commit 0c6a66f
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions pet/templates/pet/secondary_carousel.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<div class="container">
<div class="wrapper-carousel">
<i id="left" class="fa-solid fa-angle-left"></i>
<ul class="carousel-secondary">
{% for pet in pets %}
<li class="card-secondary">
<div class="card-img">
<img src="{{ pet.picture_url }}" alt="Pet: {{ pet.name }}" draggable="false">
</div>
<h2>{{ pet.name }}</h2>
<span>{{ pet.age }}</span>
</li>
{% endfor %}
</ul>
<i id="right" class="fa-solid fa-angle-right"></i>
</div>
</div>
{% if pets %}
<div class="wrapper-carousel">
<i id="left" class="fa-solid fa-angle-left"></i>
<ul class="carousel-secondary">
{% for pet in pets %}
<li class="card-secondary">
<div class="card-img">
<img src="{{ pet.picture_url|default:'#' }}" alt="Pet: {{ pet.name }}" draggable="false">
</div>
<h2>{{ pet.name }}</h2>
<span>{{ pet.age }}</span>
</li>
{% endfor %}
</ul>
<i id="right" class="fa-solid fa-angle-right"></i>
</div>
{% endif %}
</div>

0 comments on commit 0c6a66f

Please sign in to comment.