link to offering when filter for cloud provider

This commit is contained in:
Tobias Brunner 2025-03-10 14:54:48 +01:00
parent ac19c4cd25
commit 38ab1f3b2a
No known key found for this signature in database

View file

@ -155,9 +155,19 @@
<div class="d-flex justify-content-between">
{% if service.logo %}
<div class="card__image flex-shrink-0">
<a href="{{ service.get_absolute_url }}">
<img src="{{ service.logo.url }}" alt="{{ service.name }} logo" class="img-fluid">
</a>
{% if request.GET.cloud_provider %}
{% for offering in service.offerings.all %}
{% if offering.cloud_provider.id|stringformat:'i' == request.GET.cloud_provider %}
<a href="{% url 'services:offering_detail' offering.cloud_provider.slug service.slug %}">
<img src="{{ service.logo.url }}" alt="{{ service.name }} logo" class="img-fluid">
</a>
{% endif %}
{% endfor %}
{% else %}
<a href="{{ service.get_absolute_url }}">
<img src="{{ service.logo.url }}" alt="{{ service.name }} logo" class="img-fluid">
</a>
{% endif %}
</div>
{% endif %}
{% if service.is_featured %}
@ -173,7 +183,17 @@
{% endif %}
<div class="card__content d-flex flex-column flex-grow-1">
<div class="card__header">
<h3 class="card__title"><a href="{{ service.get_absolute_url }}" class="text-decoration-none {% if service.is_coming_soon %}text-black-50{% endif %}">{{ service.name }}</a></h3>
<h3 class="card__title">
{% if request.GET.cloud_provider %}
{% for offering in service.offerings.all %}
{% if offering.cloud_provider.id|stringformat:'i' == request.GET.cloud_provider %}
<a href="{% url 'services:offering_detail' offering.cloud_provider.slug service.slug %}" class="text-decoration-none {% if service.is_coming_soon %}text-black-50{% endif %}">{{ service.name }}</a>
{% endif %}
{% endfor %}
{% else %}
<a href="{{ service.get_absolute_url }}" class="text-decoration-none {% if service.is_coming_soon %}text-black-50{% endif %}">{{ service.name }}</a>
{% endif %}
</h3>
<p class="card__subtitle">
{% for category in service.categories.all %}
<span>{{ category.full_path }}</span>