diff --git a/src/servala/frontend/forms/service.py b/src/servala/frontend/forms/service.py index 189f9d5..04fe2df 100644 --- a/src/servala/frontend/forms/service.py +++ b/src/servala/frontend/forms/service.py @@ -1,5 +1,4 @@ from django import forms -from django.db.models import Q from django.utils.translation import gettext_lazy as _ from servala.core.models import ( @@ -19,17 +18,13 @@ class ServiceFilterForm(forms.Form): cloud_provider = forms.ModelChoiceField( queryset=CloudProvider.objects.all(), required=False ) - q = forms.CharField(label=_("Search"), required=False) + q = forms.CharField(required=False) def filter_queryset(self, queryset): if category := self.cleaned_data.get("category"): queryset = queryset.filter(category=category) if cloud_provider := self.cleaned_data.get("cloud_provider"): queryset = queryset.filter(offerings__provider=cloud_provider) - if search := self.cleaned_data.get("q"): - queryset = queryset.filter( - Q(name__icontains=search) | Q(category__name__icontains=search) - ) return queryset diff --git a/src/servala/frontend/templates/frontend/organizations/service_detail.html b/src/servala/frontend/templates/frontend/organizations/service_detail.html index a118539..c3962eb 100644 --- a/src/servala/frontend/templates/frontend/organizations/service_detail.html +++ b/src/servala/frontend/templates/frontend/organizations/service_detail.html @@ -28,42 +28,38 @@ -
- {% for offering in service.offerings.all %} -
-
-
- {% if offering.provider.logo %} - {{ offering.provider.name }} - {% endif %} -
-

{{ offering.provider.name }}

-
-
-
- {% if offering.description %} -

{{ offering.description }}

- {% elif offering.provider.description %} -

{{ offering.provider.description }}

- {% endif %} -
- + {% for offering in service.offerings.all %} +
+
+ {% if offering.provider.logo %} + {{ offering.provider.name }} + {% endif %} +
+

{{ offering.provider.name }}

- {% empty %} -
-
-

{% translate "No offerings found." %}

-
+
+ {% if offering.description %} +

{{ offering.description }}

+ {% elif offering.provider.description %} +

{{ offering.provider.description }}

+ {% endif %}
- {% endfor %} -
+ +
+ {% empty %} +
+
+

{% translate "No offerings found." %}

+
+
+ {% endfor %} {% endblock content %} diff --git a/src/servala/frontend/templates/frontend/organizations/services.html b/src/servala/frontend/templates/frontend/organizations/services.html index b3707e4..3286952 100644 --- a/src/servala/frontend/templates/frontend/organizations/services.html +++ b/src/servala/frontend/templates/frontend/organizations/services.html @@ -16,40 +16,36 @@
-
- {% for service in services %} -
-
-
- {% if service.logo %} - {{ service.name }} - {% endif %} -
-

{{ service.name }}

- {{ service.category }} -
-
-
- {% if service.description %}

{{ service.description }}

{% endif %} -
- + {% for service in services %} +
+
+ {% if service.logo %} + {{ service.name }} + {% endif %} +
+

{{ service.name }}

+ {{ service.category }}
- {% empty %} -
-
-

{% translate "No services found." %}

-
+
+ {% if service.description %}

{{ service.description }}

{% endif %}
- {% endfor %} -
+ +
+ {% empty %} +
+
+

{% translate "No services found." %}

+
+
+ {% endfor %} {% endblock content %}