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

View file

@ -36,12 +36,12 @@
</h5>
</div>
</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 %}">
<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> {{ offer.zipcode }}
<i class="fas fa-map-marker-alt mt-3"></i> {{ offer.zipcode.plz }} {{ offer.zipcode.name }}
</p>
</div>
</div>