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

@@ -46,6 +46,18 @@
{% endfor %}
</select>
</label>
<label for="production-form-unit">
Unit
<select id="production-form-unit" name="unit_name" required>
<option value="" disabled selected>Select unit</option>
{% for unit in unit_options %}
<option value="{{ unit.name }}" data-symbol="{{ unit.symbol }}">
{{ unit.name }} ({{ unit.symbol }})
</option>
{% endfor %}
</select>
</label>
<input id="production-form-unit-symbol" type="hidden" name="unit_symbol" />
<label for="production-form-amount">
Amount
<input
@@ -75,7 +87,7 @@
{% endblock %} {% block scripts %} {{ super() }}
<script id="production-data" type="application/json">
{{ {"scenarios": scenarios, "production": production_by_scenario} | tojson }}
{{ {"scenarios": scenarios, "production": production_by_scenario, "unit_options": unit_options} | tojson }}
</script>
<script src="/static/js/production.js"></script>
{% endblock %}