diff --git a/hub/services/templates/services/offering_list.html b/hub/services/templates/services/offering_list.html index 42340fb..4defc7f 100644 --- a/hub/services/templates/services/offering_list.html +++ b/hub/services/templates/services/offering_list.html @@ -1,167 +1,204 @@ {% extends 'services/base.html' %} {% block content %} -
-
-
-
-
Filters
-
-
- - -
- -
- - -
- -
- - -
- - - Clear -
+
+
+
+

Service Offerings

+
+

Explore our available service offerings

-
+
- -
-
- {% for offering in offerings %} -
-
-
-
-
- {% if offering.service.logo %} - {{ offering.service.name }} - {% endif %} + + +
+
+
+ +
+ +
+ +
+ +
+
+ + + + + + + + + + + +
+ +
+
+ +
+ + + +
+ + +
+
+
-
- - {{ offering.service.name }} - -
-
- {% if offering.cloud_provider.logo %} - - {{ offering.cloud_provider.name }} - - {% endif %} - - {{ offering.cloud_provider.name }} - + +
+
+ + +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ + +
+ Clear +
+ +
+
+
+ + +
+
+ {% for offering in offerings %} +
+
+
+
+
+
+ {% if offering.service.logo %} + {{ offering.service.name }} + {% endif %} +
+
+

+ + {{ offering.service.name }} + +

+
+ {% if offering.cloud_provider.logo %} + + {{ offering.cloud_provider.name }} + + {% else %} + + {{ offering.cloud_provider.name }} + + {% endif %} +
+
+
+ +
+ {% for category in offering.service.categories.all %} + {{ category.full_path }} + {% endfor %}
-
-
- {% for category in offering.service.categories.all %} - {{ category.full_path }} - {% endfor %} -
- -
- {{ offering.description|safe|truncatewords_html:30 }} -
- - {% if offering.plans.exists %} -
- Available Plans: -
    - {% for plan in offering.plans.all %} -
  • • {{ plan.name }}
  • - {% endfor %} -
+
+ {{ offering.description|safe|truncatewords_html:30 }}
- {% endif %} - -
- View Details - {% if offering.plans.exists %} - {% if offering.status == 'available' %} - {% if offering.plans.count == 1 %} - {% with plan=offering.plans.first %} - Order - {% endwith %} - {% else %} - - {% endif %} - {% elif offering.status == 'planned' %} - Show Interest - {% else %} - Request Information - {% endif %} - {% else %} - {% if offering.status == 'available' %} - Order - {% elif offering.status == 'planned' %} - Show Interest - {% else %} - Request Information - {% endif %} - {% endif %}
-
- {% empty %} -
-
- No service offerings found matching your criteria. + {% empty %} +
+
+ No service offerings found matching your criteria. +
+ {% endfor %}
- {% endfor %} +
-
+
{% endblock %} \ No newline at end of file diff --git a/hub/services/views/offerings.py b/hub/services/views/offerings.py index a866b40..62ef10d 100644 --- a/hub/services/views/offerings.py +++ b/hub/services/views/offerings.py @@ -1,10 +1,6 @@ from django.shortcuts import render, get_object_or_404 from django.db.models import Q -from hub.services.models import ( - ServiceOffering, - CloudProvider, - Category, -) +from hub.services.models import ServiceOffering, CloudProvider, Category, Service def offering_list(request): @@ -22,6 +18,7 @@ def offering_list(request): cloud_providers = CloudProvider.objects.all() categories = Category.objects.filter(parent=None).prefetch_related("children") + services = Service.objects.all().order_by("name") # Add this line # Handle cloud provider filter if request.GET.get("cloud_provider"): @@ -37,6 +34,11 @@ def offering_list(request): Q(service__categories=category) | Q(service__categories__in=subcategories) ).distinct() + # Add service filter handling + if request.GET.get("service"): + service_id = request.GET.get("service") + offerings = offerings.filter(service_id=service_id) + # Handle search if request.GET.get("search"): query = request.GET.get("search") @@ -50,6 +52,7 @@ def offering_list(request): "offerings": offerings, "cloud_providers": cloud_providers, "categories": categories, + "services": services, } return render(request, "services/offering_list.html", context)