refactor to generic classes
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
<html>
|
||||
|
||||
<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') }}">
|
||||
<style>
|
||||
body {
|
||||
background-color: white;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h2>Create a condition</h2>
|
||||
<form method="POST" action="/conditions?submitted">
|
||||
<fieldset>
|
||||
<label for="symbol">Symbol</label>
|
||||
<input type="text" name="symbol">
|
||||
|
||||
<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">
|
||||
|
||||
<label for="disabled">Disabled</label>
|
||||
<input type="checkbox" name="disabled">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<button value="cancel" formmethod="dialog" onclick="window.top.postMessage('close', '*')">Cancel</button>
|
||||
<button type="submit" >Submit</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,50 +0,0 @@
|
||||
<html>
|
||||
|
||||
<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') }}">
|
||||
<style>
|
||||
body {
|
||||
background-color: white;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h2>Update a condition</h2>
|
||||
<form method="POST" action="/conditions/{{ data.id }}?submitted">
|
||||
<fieldset>
|
||||
<label>ID</label>
|
||||
<div>{{ data.id }}</div>
|
||||
|
||||
<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 }}">
|
||||
|
||||
<label for="disabled">Disabled</label>
|
||||
<input type="checkbox" name="disabled" {{ "checked" if data.disabled }}>
|
||||
|
||||
<label for="fulfilled">Fulfilled</label>
|
||||
<input type="checkbox" name="fulfilled" {{ "checked" if data.fulfilled }}>
|
||||
</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 }}?submitted">
|
||||
<button class="danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+1
-42
@@ -12,48 +12,7 @@
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<dialog>
|
||||
<iframe frameborder="0"></iframe>
|
||||
</dialog>
|
||||
<table id="conditionTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="5"><h2>Conditions</h2></td>
|
||||
</tr>
|
||||
{% if data.conditions %}
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Symbol</th>
|
||||
<th>Condition</th>
|
||||
<th>Value</th>
|
||||
<th>Disabled</th>
|
||||
<th>Fulfilled</th>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<th class="nodata">No Data</th>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in data.conditions %}
|
||||
<tr onclick="onOpenDialog('/conditions/{{ item.id }}')">
|
||||
|
||||
{% set order = ["id", "symbol", "condition", "value", "disabled", "fulfilled"] %}
|
||||
{% for key in order %}
|
||||
<td>{{ item[key] }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6" style="text-align: right;"> <!-- Adjust colspan as per your total columns -->
|
||||
<button onclick="onOpenDialog('/conditions/create')">Add Item</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<a href="/strategies/abc">Abc</a>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<a href="/">Home</a>
|
||||
<dialog>
|
||||
<iframe frameborder="0"></iframe>
|
||||
</dialog>
|
||||
|
||||
Reference in New Issue
Block a user