fix dialog size and open

This commit is contained in:
null
2024-03-04 20:29:29 +01:00
parent e33c59ea9c
commit 71e1ec06e4
5 changed files with 85 additions and 80 deletions
+25 -22
View File
@@ -1,5 +1,6 @@
<html>
<head>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
@@ -9,28 +10,30 @@
overflow: hidden;
}
</style>
</head>
<body>
<h2>Create a condition</h2>
<form method="POST" action="/conditions">
<fieldset>
<label for="symbol">Symbol</label>
<input type="text" name="symbol">
</head>
<label for="condition">Condition</label>
<select name="condition">
<option value="gt">Greater than</option>
<option value="lt">Lower than</option>
</select>
<body>
<h2>Create a condition</h2>
<form method="POST" action="/conditions">
<fieldset>
<label for="symbol">Symbol</label>
<input type="text" name="symbol">
<label for="value">Value</label>
<input type="number" step="any" name="value">
</fieldset>
<label for="condition">Condition</label>
<select name="condition">
<option value="gt">Greater than</option>
<option value="lt">Lower than</option>
</select>
<label for="value">Value</label>
<input type="number" step="any" name="value">
</fieldset>
<fieldset>
<button value="cancel" formmethod="dialog" onclick="window.top.postMessage('close', '*')">Cancel</button>
<button type="submit">Submit</button>
</fieldset>
</form>
</body>
<fieldset>
<button value="cancel" formmethod="dialog" onclick="window.top.postMessage('close', '*')">Cancel</button>
<button type="submit">Submit</button>
</fieldset>
</form>
</body>
</html>
+30 -27
View File
@@ -1,5 +1,6 @@
<html>
<head>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
@@ -9,33 +10,35 @@
overflow: hidden;
}
</style>
</head>
<body>
<h2>Update a condition</h2>
<form method="POST" action="/conditions/{{ data.id }}">
<fieldset>
<label>ID</label>
<div>{{ data.id }}</div>
</head>
<label for="symbol">Symbol</label>
<input type="text" name="symbol" value="{{ data.symbol }}">
<body>
<h2>Update a condition</h2>
<form method="POST" action="/conditions/{{ data.id }}">
<fieldset>
<label>ID</label>
<div>{{ data.id }}</div>
<label for="condition">Condition</label>
<select name="condition">
<option value="gt" {% if data.condition == "gt" %}selected{% endif %}>Greater than</option>
<option value="lt" {% if data.condition == "lt" %}selected{% endif %}>Lower than</option>
</select>
<label for="symbol">Symbol</label>
<input type="text" name="symbol" value="{{ data.symbol }}">
<label for="condition">Condition</label>
<select name="condition">
<option value="gt" {% if data.condition=="gt" %}selected{% endif %}>Greater than</option>
<option value="lt" {% if data.condition=="lt" %}selected{% endif %}>Lower than</option>
</select>
<label for="value">Value</label>
<input type="number" step="any" name="value" value="{{ data.value }}">
</fieldset>
<fieldset>
<button value="cancel" formmethod="dialog" onclick="window.top.postMessage('close', '*')">Cancel</button>
<button type="submit">Submit</button>
</fieldset>
</form>
<form method="POST" action="/conditions/delete/{{ data.id }}">
<button class="danger" type="submit">Delete</button>
</form>
</body>
<label for="value">Value</label>
<input type="number" step="any" name="value" value="{{ data.value }}">
</fieldset>
<fieldset>
<button value="cancel" formmethod="dialog" onclick="window.top.postMessage('close', '*')">Cancel</button>
<button type="submit">Submit</button>
</fieldset>
</form>
<form method="POST" action="/conditions/delete/{{ data.id }}">
<button class="danger" type="submit">Delete</button>
</form>
</body>
</html>
+2 -2
View File
@@ -34,7 +34,7 @@
</thead>
<tbody>
{% for item in data.conditions %}
<tr onclick="document.querySelector('dialog iframe').contentWindow.location='/conditions/{{ item.id }}'">
<tr onclick="onOpenDialog('/conditions/{{ item.id }}')">
{% set order = ["id", "symbol", "condition", "value"] %}
{% for key in order %}
@@ -46,7 +46,7 @@
<tfoot>
<tr>
<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>
<button onclick="onOpenDialog('/conditions/create')">Add Item</button>
</td>
</tr>
</tfoot>