feat: Add currency and unit support across models, routes, and templates; enhance UI for consumption, costs, and production

This commit is contained in:
2025-10-21 09:53:04 +02:00
parent 139ae04538
commit fcea39deb0
18 changed files with 354 additions and 31 deletions

View File

@@ -57,6 +57,17 @@ title %}Costs · CalMiner{% endblock %} {% block content %}
{{ select_field( "Scenario", "capex-form-scenario", name="scenario_id",
options=scenarios, required=True, placeholder="Select a scenario",
placeholder_disabled=True ) }}
{{ select_field(
"Currency",
"capex-form-currency",
name="currency_code",
options=currency_options,
required=True,
placeholder="Select currency",
placeholder_disabled=True,
value_attr="id",
label_attr="name"
) }}
<label for="capex-form-amount">
Amount
<input
@@ -90,6 +101,17 @@ title %}Costs · CalMiner{% endblock %} {% block content %}
{{ select_field( "Scenario", "opex-form-scenario", name="scenario_id",
options=scenarios, required=True, placeholder="Select a scenario",
placeholder_disabled=True ) }}
{{ select_field(
"Currency",
"opex-form-currency",
name="currency_code",
options=currency_options,
required=True,
placeholder="Select currency",
placeholder_disabled=True,
value_attr="id",
label_attr="name"
) }}
<label for="opex-form-amount">
Amount
<input
@@ -117,7 +139,7 @@ title %}Costs · CalMiner{% endblock %} {% block content %}
{% endblock %} {% block scripts %} {{ super() }}
<script id="costs-payload" type="application/json">
{{ {"capex": capex_by_scenario, "opex": opex_by_scenario} | tojson }}
{{ {"capex": capex_by_scenario, "opex": opex_by_scenario, "currency_options": currency_options} | tojson }}
</script>
<script src="/static/js/costs.js"></script>
{% endblock %}