refactor templates
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Trading Zone Website</title>
|
||||
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='js/main.js') }}"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<dialog>
|
||||
<iframe frameborder="0"></iframe>
|
||||
</dialog>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="{{ data.order | length }}">
|
||||
<h2>{{ data.title }}</h2>
|
||||
</td>
|
||||
</tr>
|
||||
{% if data.fields %}
|
||||
<tr>
|
||||
{% for key in data.order %}
|
||||
<th>{{ key }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<th class="nodata">No Data</th>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for field in data.fields %}
|
||||
<tr onclick="onOpenDialog('{{ data.prefix }}/update/{{ field.id }}')">
|
||||
{% for key in data.order%}
|
||||
<td>{{ field[key] }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="{{ data.order | length }}" style="text-align: right;">
|
||||
<button onclick="onOpenDialog('{{ data.prefix }}/create')">Add Item</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user