BudgetingApp/app/templates/vendors.html
ydb5755 b6dd9d4892 init vendors js file
add function to delete buttons
add connection to add vendor api
2024-10-09 14:40:45 +03:00

46 lines
No EOL
2.1 KiB
HTML

{% extends 'base.html' %}
{% block title %}Budget Categories{% endblock title %}
{% block content %}
<main>
<div class="container mt-5">
<div class="card">
<div class="card">
<div class="card-header bg-primary text-white">
Vendors
</div>
<div class="card-body">
<form action="{{ url_for('add_vendor') }}" method="POST">
<div class="mb-3">
<label for="vendorName" class="form-label">Add Vendor</label>
<input type="text" class="form-control" id="vendorName" name="vendor_name" placeholder="Enter vendor name" required>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
{% for vendor in vendors %}
<tr id="{{vendor[0].id}}-row">
<th scope="row">{{vendor[0].id}}</th>
<th scope="row">{{vendor[0].name}}</th>
<th scope="row"><button class="btn btn-danger del-button" id="{{vendor[0].id}}">Delete</button></th>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="{{url_for('.static', filename='vendors.js')}}"></script>
{% endblock content %}