Compare commits

..

No commits in common. "ad3f06d6ff8e81ffaf83545799dfb71dfd80bc09" and "9ce96674c00b7bbaf7cc8a658b13ae30717f7dba" have entirely different histories.

4 changed files with 3 additions and 30 deletions

View file

@ -16,8 +16,6 @@ spec:
labels: labels:
app: servala app: servala
spec: spec:
nodeSelector:
appuio.io/node-class: nokto
imagePullSecrets: imagePullSecrets:
- name: gitlab-pull-secret - name: gitlab-pull-secret
containers: containers:

View file

@ -101,14 +101,7 @@ class ExternalLinkInline(admin.TabularInline):
@admin.register(Service) @admin.register(Service)
class ServiceAdmin(admin.ModelAdmin): class ServiceAdmin(admin.ModelAdmin):
list_display = ( list_display = ("name", "logo_preview", "category_list", "partner_list")
"name",
"logo_preview",
"category_list",
"is_featured",
"is_coming_soon",
"disable_listing",
)
list_filter = ("categories",) list_filter = ("categories",)
search_fields = ("name", "description", "slug") search_fields = ("name", "description", "slug")
prepopulated_fields = {"slug": ("name",)} prepopulated_fields = {"slug": ("name",)}

View file

@ -145,7 +145,7 @@
<div class="pt-40"> <div class="pt-40">
<h3 class="fs-24 fw-semibold lh-1 mb-12" id="services" style="scroll-margin-top: 100px;">Available Services</h3> <h3 class="fs-24 fw-semibold lh-1 mb-12" id="services" style="scroll-margin-top: 100px;">Available Services</h3>
<div class="row"> <div class="row">
{% for offering in ordered_offerings %} {% for offering in provider.offerings.all %}
<div class="col-12 col-md-6 mb-30"> <div class="col-12 col-md-6 mb-30">
<div class="card h-100 d-flex flex-column"> <div class="card h-100 d-flex flex-column">
{% if offering.service.logo or offering.service.is_featured %} {% if offering.service.logo or offering.service.is_featured %}

View file

@ -2,7 +2,6 @@ from django.shortcuts import render, get_object_or_404
from django.db.models import Q from django.db.models import Q
from hub.services.models import ( from hub.services.models import (
Service, Service,
ServiceOffering,
CloudProvider, CloudProvider,
) )
@ -40,30 +39,13 @@ def provider_detail(request, slug):
# Get all services offered by this provider through offerings # Get all services offered by this provider through offerings
services = ( services = (
Service.objects.filter( Service.objects.filter(offerings__cloud_provider=provider)
offerings__cloud_provider=provider, disable_listing=False
)
.distinct() .distinct()
.prefetch_related("categories") .prefetch_related("categories")
) )
# Get the provider's offerings and sort them by service attributes
# Exclude offerings with disabled services
ordered_offerings = (
ServiceOffering.objects.filter(
cloud_provider=provider, service__disable_listing=False
)
.select_related("service")
.order_by(
"-service__is_featured", # Featured first (True before False)
"service__is_coming_soon", # Coming soon last (False before True)
"service__name", # Alphabetically within each group
)
)
context = { context = {
"provider": provider, "provider": provider,
"services": services, "services": services,
"ordered_offerings": ordered_offerings,
} }
return render(request, "services/provider_detail.html", context) return render(request, "services/provider_detail.html", context)