82 lines
2.5 KiB
HTML
82 lines
2.5 KiB
HTML
{% extends "base.html" %} {% block title %}Production · CalMiner{% endblock %}
|
|
{% block content %}
|
|
<section class="panel">
|
|
<h2>Production Output</h2>
|
|
{% if scenarios %}
|
|
<div class="form-grid">
|
|
<label for="production-scenario-filter">
|
|
Scenario filter
|
|
<select id="production-scenario-filter">
|
|
<option value="">Select a scenario</option>
|
|
{% for scenario in scenarios %}
|
|
<option value="{{ scenario.id }}">{{ scenario.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-state">Create a scenario to view production output data.</p>
|
|
{% endif %}
|
|
<div id="production-empty" class="empty-state">
|
|
Choose a scenario to review its production output.
|
|
</div>
|
|
<div id="production-table-wrapper" class="table-container hidden">
|
|
<table aria-label="Scenario production records">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Amount</th>
|
|
<th scope="col">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="production-table-body"></tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Add Production Output</h2>
|
|
{% if scenarios %}
|
|
<form id="production-form" class="form-grid">
|
|
<label for="production-form-scenario">
|
|
Scenario
|
|
<select id="production-form-scenario" name="scenario_id" required>
|
|
<option value="" disabled selected>Select a scenario</option>
|
|
{% for scenario in scenarios %}
|
|
<option value="{{ scenario.id }}">{{ scenario.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
<label for="production-form-amount">
|
|
Amount
|
|
<input
|
|
id="production-form-amount"
|
|
type="number"
|
|
name="amount"
|
|
min="0"
|
|
step="0.01"
|
|
required
|
|
/>
|
|
</label>
|
|
<label for="production-form-description">
|
|
Description (optional)
|
|
<textarea
|
|
id="production-form-description"
|
|
name="description"
|
|
rows="3"
|
|
></textarea>
|
|
</label>
|
|
<button type="submit" class="btn primary">Add Record</button>
|
|
</form>
|
|
<p id="production-feedback" class="feedback hidden" role="status"></p>
|
|
{% else %}
|
|
<p class="empty-state">Create a scenario before adding production output.</p>
|
|
{% endif %}
|
|
</section>
|
|
|
|
{% endblock %} {% block scripts %} {{ super() }}
|
|
<script id="production-data" type="application/json">
|
|
{{ {"scenarios": scenarios, "production": production_by_scenario} | tojson }}
|
|
</script>
|
|
<script src="/static/js/production.js"></script>
|
|
{% endblock %}
|