Fix spacing issue
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jannis Portmann 2023-09-18 11:37:01 +02:00
parent c31fd8ff9a
commit 1e9f1a2761
2 changed files with 26 additions and 23 deletions

View file

@ -2,6 +2,7 @@
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% load plz %}
{% block title %} {% block title %}
{% trans 'Offers' %} {% trans 'Offers' %}
{% endblock %} {% endblock %}
@ -31,30 +32,32 @@
{% if offers %} {% if offers %}
<div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 mt-3 mb-3 row-gap-5"> <div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 mt-3 mb-3 row-gap-5">
{% for offer in offers %} {% for offer in offers %}
<div class="col"> {% with plz=offer|get_plz %}
<div class="card h-100 p-0"> <div class="col">
<a href="{% url 'offer_detail' offer.id %}"> <div class="card h-100 p-0">
{% if offer.image %} <a href="{% url 'offer_detail' offer.id %}">
<img class="card-img-top offer-img" src="{{ offer.image.url }}"/> {% if offer.image %}
{% else %} <img class="card-img-top offer-img" src="{{ offer.image.url }}" />
<img class="card-img-top offer-img" src="{% static 'placeholder.jpg' %}" /> {% else %}
{% endif %} <img class="card-img-top offer-img" src="{% static 'placeholder.jpg' %}" />
<div class="card-body"> {% endif %}
<h5 class="h5"> <div class="card-body">
{{ offer.title }}<span class="ms-2 badge pfl-{{ offer.category|lower }}">{{ offer.get_category_display }}</span> <h5 class="h5">
</h5> {{ offer.title }}<span class="ms-2 badge pfl-{{ offer.category|lower }}">{{ offer.get_category_display }}</span>
</div> </h5>
</a> </div>
<div class="card-footer d-flex justify-content-between">
<a href="{% url 'user_detail' offer.user.id %}">
<i class="fas fa-user mt-3"></i> {{ offer.user.username }}
</a> </a>
<p class="zip"> <div class="card-footer d-flex justify-content-between mt-auto">
<i class="fas fa-map-marker-alt mt-3"></i> {{ offer.zipcode }} <a href="{% url 'user_detail' offer.user.id %}">
</p> <i class="fas fa-user mt-3"></i> {{ offer.user.username }}
</a>
<p class="zip">
<i class="fas fa-map-marker-alt mt-3"></i> {{ plz.plz }} {{ plz.name }}
</p>
</div>
</div> </div>
</div> </div>
</div> {% endwith %}
{% endfor %} {% endfor %}
</div> </div>
{% else %} {% else %}

View file

@ -36,12 +36,12 @@
</h5> </h5>
</div> </div>
</a> </a>
<div class="card-footer d-flex justify-content-between"> <div class="card-footer d-flex justify-content-between mt-auto">
<a href="{% url 'user_detail' offer.user.id %}"> <a href="{% url 'user_detail' offer.user.id %}">
<i class="fas fa-user mt-3"></i> {{ offer.user.username }} <i class="fas fa-user mt-3"></i> {{ offer.user.username }}
</a> </a>
<p class="zip"> <p class="zip">
<i class="fas fa-map-marker-alt mt-3"></i> {{ offer.zipcode }} <i class="fas fa-map-marker-alt mt-3"></i> {{ offer.zipcode.plz }} {{ offer.zipcode.name }}
</p> </p>
</div> </div>
</div> </div>