From 191500aeb735643b3c4cae8ae2acfc507e2bde82 Mon Sep 17 00:00:00 2001 From: zwitschi Date: Sun, 9 Nov 2025 17:27:46 +0100 Subject: [PATCH] feat: add project and scenario templates for detailed views and forms --- templates/projects/detail.html | 78 ++++++++++++++++++++++ templates/projects/form.html | 52 +++++++++++++++ templates/projects/list.html | 42 ++++++++++++ templates/scenarios/detail.html | 112 ++++++++++++++++++++++++++++++++ templates/scenarios/form.html | 79 ++++++++++++++++++++++ 5 files changed, 363 insertions(+) create mode 100644 templates/projects/detail.html create mode 100644 templates/projects/form.html create mode 100644 templates/projects/list.html create mode 100644 templates/scenarios/detail.html create mode 100644 templates/scenarios/form.html diff --git a/templates/projects/detail.html b/templates/projects/detail.html new file mode 100644 index 0000000..e246a8e --- /dev/null +++ b/templates/projects/detail.html @@ -0,0 +1,78 @@ +{% extends "base.html" %} +{% block title %}{{ project.name }} · Project · CalMiner{% endblock %} + +{% block content %} + + + + +
+

Project Overview

+
+
+
Location
+
{{ project.location or '—' }}
+
+
+
Description
+
{{ project.description or 'No description provided.' }}
+
+
+
Created
+
{{ project.created_at.strftime('%Y-%m-%d %H:%M') }}
+
+
+
Updated
+
{{ project.updated_at.strftime('%Y-%m-%d %H:%M') }}
+
+
+
+ +
+
+

Scenarios

+ Add Scenario +
+ {% if scenarios %} + + + + + + + + + + + + {% for scenario in scenarios %} + + + + + + + + {% endfor %} + +
NameStatusCurrencyPrimary Resource
{{ scenario.name }}{{ scenario.status.value.title() }}{{ scenario.currency or '—' }}{{ scenario.primary_resource.value.replace('_', ' ') | title if scenario.primary_resource else '—' }} + View + Edit +
+ {% else %} +

No scenarios yet.

+ {% endif %} +
+{% endblock %} diff --git a/templates/projects/form.html b/templates/projects/form.html new file mode 100644 index 0000000..1b03c3b --- /dev/null +++ b/templates/projects/form.html @@ -0,0 +1,52 @@ +{% extends "base.html" %} +{% block title %}{% if project %}Edit {{ project.name }}{% else %}New Project{% endif %} · CalMiner{% endblock %} + +{% block content %} + + + + +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ Cancel + +
+
+{% endblock %} diff --git a/templates/projects/list.html b/templates/projects/list.html new file mode 100644 index 0000000..39703c5 --- /dev/null +++ b/templates/projects/list.html @@ -0,0 +1,42 @@ +{% extends "base.html" %} +{% block title %}Projects · CalMiner{% endblock %} + +{% block content %} + + + {% if projects %} + + + + + + + + + + + + {% for project in projects %} + + + + + + + + {% endfor %} + +
NameLocationTypeScenarios
{{ project.name }}{{ project.location or '—' }}{{ project.operation_type.value.replace('_', ' ') | title }}{{ project.scenario_count }} + View + Edit +
+ {% else %} +

No projects yet. Create your first project.

+ {% endif %} +{% endblock %} diff --git a/templates/scenarios/detail.html b/templates/scenarios/detail.html new file mode 100644 index 0000000..edb3466 --- /dev/null +++ b/templates/scenarios/detail.html @@ -0,0 +1,112 @@ +{% extends "base.html" %} +{% block title %}{{ scenario.name }} · Scenario · CalMiner{% endblock %} + +{% block content %} + + + + +
+

Scenario Details

+
+
+
Description
+
{{ scenario.description or 'No description provided.' }}
+
+
+
Timeline
+
+ {% if scenario.start_date %} + {{ scenario.start_date }} + {% else %} + — + {% endif %} + → + {% if scenario.end_date %} + {{ scenario.end_date }} + {% else %} + — + {% endif %} +
+
+
+
Discount Rate
+
{{ scenario.discount_rate or '—' }}
+
+
+
Currency
+
{{ scenario.currency or '—' }}
+
+
+
Primary Resource
+
{{ scenario.primary_resource.value.replace('_', ' ') | title if scenario.primary_resource else '—' }}
+
+
+
+ +
+

Financial Inputs

+ {% if financial_inputs %} + + + + + + + + + + + {% for item in financial_inputs %} + + + + + + + {% endfor %} + +
NameCategoryAmountCurrency
{{ item.name }}{{ item.category.value.title() }}{{ '{:,.2f}'.format(item.amount) }}{{ item.currency or '—' }}
+ {% else %} +

No financial inputs recorded.

+ {% endif %} +
+ +
+

Simulation Parameters

+ {% if simulation_parameters %} + + + + + + + + + + + {% for param in simulation_parameters %} + + + + + + + {% endfor %} + +
NameDistributionVariableResource
{{ param.name }}{{ param.distribution.value.title() }}{{ param.variable.value.replace('_', ' ') | title if param.variable else '—' }}{{ param.resource_type.value.replace('_', ' ') | title if param.resource_type else '—' }}
+ {% else %} +

No simulation parameters defined.

+ {% endif %} +
+{% endblock %} diff --git a/templates/scenarios/form.html b/templates/scenarios/form.html new file mode 100644 index 0000000..8b4947d --- /dev/null +++ b/templates/scenarios/form.html @@ -0,0 +1,79 @@ +{% extends "base.html" %} +{% block title %}{% if scenario %}Edit {{ scenario.name }}{% else %}New Scenario{% endif %} · CalMiner{% endblock %} + +{% block content %} + + + + +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ Cancel + +
+
+{% endblock %}