diff --git a/hub/services/templates/services/pricelist.html b/hub/services/templates/services/pricelist.html index 27ac3c5..ca865ae 100644 --- a/hub/services/templates/services/pricelist.html +++ b/hub/services/templates/services/pricelist.html @@ -112,6 +112,41 @@ {% if representative_plan.compute_plan_group_node_label %}

Node Label: {{ representative_plan.compute_plan_group_node_label }}

{% endif %} + + {# Display storage pricing for this cloud provider #} + {% if representative_plan.storage_plans %} +
+

Storage Options:

+
+ + + + + + + + + + + {% for storage_plan in representative_plan.storage_plans %} + + + + + + + {% endfor %} + +
Storage PlanTermUnitPrices
{{ storage_plan.name }}{{ storage_plan.get_term_display }}{{ storage_plan.get_unit_display }} + {% for price in storage_plan.prices.all %} + {{ price.amount }} {{ price.currency }} + {% empty %} + No prices + {% endfor %} +
+
+
+ {% endif %} {% endwith %} {% endif %} {% endfor %} diff --git a/hub/services/views/pricelist.py b/hub/services/views/pricelist.py index 3f6f6b6..6d59c79 100644 --- a/hub/services/views/pricelist.py +++ b/hub/services/views/pricelist.py @@ -2,7 +2,12 @@ import re from django.shortcuts import render from collections import defaultdict -from hub.services.models import ComputePlan, VSHNAppCatPrice, ExternalPricePlans +from hub.services.models import ( + ComputePlan, + VSHNAppCatPrice, + ExternalPricePlans, + StoragePlan, +) from django.contrib.admin.views.decorators import staff_member_required from django.db import models @@ -235,6 +240,11 @@ def pricelist(request): group_name = plan.group.name if plan.group else "No Group" + # Get storage plans for this cloud provider + storage_plans = StoragePlan.objects.filter( + cloud_provider=plan.cloud_provider + ).prefetch_related("prices") + # Add pricing data to the grouped structure pricing_data_by_group_and_service_level[group_name][ service_level_display @@ -250,6 +260,7 @@ def pricelist(request): "compute_plan_group_node_label": ( plan.group.node_label if plan.group else "" ), + "storage_plans": storage_plans, "vcpus": plan.vcpus, "ram": plan.ram, "cpu_mem_ratio": plan.cpu_mem_ratio,