Add: List table style

Add bootstrap css for table in /viewall/
This commit is contained in:
Candifloss 2025-04-04 11:20:56 +05:30
parent 5c10cdcef5
commit 4e3b7dff33

View File

@ -6,41 +6,63 @@
<title>View Inventory</title> <title>View Inventory</title>
{% include 'favicon.html' %} {% include 'favicon.html' %}
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet"> <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<style>
/* Minimal custom CSS for table responsiveness */
.table-container {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin-bottom: 1rem;
}
.action-buttons {
white-space: nowrap;
}
</style>
</head> </head>
<body align="center"> <body>
{% include 'header.html' %} {% include 'header.html' %}
<main class="container mt-5 pt-3">
<h2 class="mb-4">Item Inventory</h2> <main class="container-fluid mt-5 pt-3 px-4">
<table class=""> <div class="d-flex justify-content-between align-items-center mb-4">
<h2>Item Inventory</h2>
</div>
<div class="table-container">
<table class="table table-striped table-hover table-bordered">
<thead class="table-light">
<tr> <tr>
<!-- Table headers -->
{% for attrib in item_attributes %} {% for attrib in item_attributes %}
<th>{{ attrib.display_name }}</th> <th>{{ attrib.display_name }}</th>
{% endfor %} {% endfor %}
<th colspan="2">Actions</th> <th class="action-buttons">Actions</th>
</tr> </tr>
</thead>
<!-- Table rows --> <tbody>
{% for item in items %} {% for item in items %}
<tr> <tr>
{% for attrib in item_attributes %} {% for attrib in item_attributes %}
<td>{{ item[attrib.attrib_name] }}</td> <td>{{ item[attrib.attrib_name] }}</td>
{% endfor %} {% endfor %}
<td> <td class="action-buttons">
<form action="/update/{{ item[primary_attrib] }}" method="get"> <div class="d-flex gap-2">
<button type="submit">Edit</button> <a href="/update/{{ item[primary_attrib] }}"
</form> class="btn btn-sm btn-outline-primary">
</td> Edit
<td> </a>
<form action="/delete/{{ item[primary_attrib] }}" method="get"> <form action="/delete/{{ item[primary_attrib] }}" method="get" class="d-inline">
<button type="submit">Delete</button> <button type="submit"
class="btn btn-sm btn-outline-danger">
Delete
</button>
</form> </form>
</div>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
</table> </table>
</div>
</main> </main>
<!-- Bootstrap JS (for dropdowns) -->
<script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script> <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
</body> </body>
</html> </html>