saves
This commit is contained in:
126
index.html
Normal file
126
index.html
Normal file
@@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Product Catalog</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Arial', sans-serif;
|
||||
background-color: #f4f4f4;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.container {
|
||||
width: 80%;
|
||||
margin: 50px auto;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
.form-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.form-container input {
|
||||
width: 200px;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
.form-container button {
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
.form-container button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 20px;
|
||||
}
|
||||
table th, table td {
|
||||
padding: 12px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
table th {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
.actions a {
|
||||
text-decoration: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 5px;
|
||||
color: white;
|
||||
background-color: #007BFF;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
.actions a:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
.actions .delete {
|
||||
background-color: #e74c3c;
|
||||
}
|
||||
.actions .delete:hover {
|
||||
background-color: #c0392b;
|
||||
}
|
||||
.actions .edit {
|
||||
background-color: #f39c12;
|
||||
}
|
||||
.actions .edit:hover {
|
||||
background-color: #e67e22;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Product Catalog</h1>
|
||||
<div class="form-container">
|
||||
<form action="/add" method="POST">
|
||||
<input type="text" name="name" placeholder="Product Name" required>
|
||||
<input type="text" name="price" placeholder="Price" required>
|
||||
<button type="submit">Add Product</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h2>Product List</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
{{range .Products}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td>{{.Name}}</td>
|
||||
<td>{{.Price}}</td>
|
||||
<td class="actions">
|
||||
<a href="/edit/{{.ID}}" class="edit">Edit</a>
|
||||
<a href="/delete/{{.ID}}" class="delete">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user