Added header to all pages

This commit is contained in:
Candifloss 2025-03-08 13:04:23 +05:30
parent 12b902c382
commit 1021a8db32
6 changed files with 29 additions and 3 deletions

View File

@ -7,6 +7,7 @@
<script src="{{ url_for('static', filename='edited_csv.js') }}"></script>
</head>
<body>
{% include 'header.html' %}
<h1>CSV Preview</h1>
<!-- Display error messages -->

View File

@ -5,6 +5,7 @@
<title>Delete Item</title>
</head>
<body align="center">
{% include 'header.html' %}
<h2>Are you sure you want to delete the item?</h2>
<!-- Confirmation form -->

21
templates/header.html Normal file
View File

@ -0,0 +1,21 @@
<!-- Header bar -->
<div class="header">
<h1 class="appname">Inventory Manager</h1>
<div class="buttons">
<form action="/create" method="get">
<button type="submit">Add New Item</button>
</form>
<form action="/import_from_csv" method="get">
<button type="submit">Import from CSV</button>
</form>
<form action="/edit_using_csv" method="get">
<button type="submit">Edit using CSV</button>
</form>
<form action="/export_csv" method="POST">
<button type="submit">Export Data</button>
</form>
<form action="/logout" method="get">
<button type="submit">Logout</button>
</form>
</div>
</div>

View File

@ -5,7 +5,8 @@
<title>{% if item %}Update{% else %}Add{% endif %} Item</title>
</head>
<body>
<h2 align="center">{% if item %}Update{% else %}Add{% endif %} Item</h2>
{% include 'header.html' %}
<h2>{% if item %}Update{% else %}Add{% endif %} Item</h2>
<!-- Display error message if any -->
{% if error %}

View File

@ -6,6 +6,7 @@
<title>Upload CSV File</title>
</head>
<body>
{% include 'header.html' %}
<h1>Upload CSV File</h1>
<!-- Display flash messages (only errors) -->

View File

@ -5,6 +5,7 @@
<title>View Inventory</title>
</head>
<body align="center">
{% include 'header.html' %}
<h2>Item Inventory</h2>
<table border="1" align="center">
@ -36,7 +37,7 @@
{% endfor %}
</table>
<br>
<!-- br>
<form action="/create" method="get">
<button type="submit">Add new Item</button>
</form>
@ -51,6 +52,6 @@
</form>
<form action="/logout" method="get">
<button type="submit">Logout</button>
</form>
</form -->
</body>
</html>