crud with conditions

This commit is contained in:
null
2024-02-28 21:02:23 +01:00
parent 99b78c9bd1
commit a56cf12c2a
6 changed files with 82 additions and 35 deletions
+19 -8
View File
@@ -11,30 +11,41 @@
<body>
<div class="container">
<h1>Conditions</h1>
<dialog>
<iframe frameborder="0"></iframe>
</dialog>
<table id="conditionTable">
<thead>
<tr>
{% for key, value in data.conditions.model.items() %}
<th>{{ value.name }}</th>
{% endfor %}
<td colspan="5"><h2>Conditions</h2></td>
</tr>
{% if data.conditions %}
<tr>
<th>ID</th>
<th>Symbol</th>
<th>Condition</th>
<th>Value</th>
</tr>
{% else %}
<tr>
<th class="nodata">No Data</th>
</tr>
{% endif %}
</thead>
<tbody>
{% for item in data.conditions.data %}
{% for item in data.conditions %}
<tr onclick="document.querySelector('dialog iframe').contentWindow.location='/conditions/{{ item.id }}'">
{% for key, value in item.items() %}
<td>{{ value }}</td>
{% set order = ["id", "symbol", "condition", "value"] %}
{% for key in order %}
<td>{{ item[key] }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="3" style="text-align: right;"> <!-- Adjust colspan as per your total columns -->
<td colspan="5" style="text-align: right;"> <!-- Adjust colspan as per your total columns -->
<button onclick="document.querySelector('dialog iframe').contentWindow.location='/conditions/create'">Add Item</button>
</td>
</tr>