78 lines
2.2 KiB
HTML
78 lines
2.2 KiB
HTML
<!-- templates/admin.html -->
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Admin Panel</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 20px;
|
|
}
|
|
h1 {
|
|
color: #333;
|
|
}
|
|
form {
|
|
max-width: 400px;
|
|
margin: 0 auto;
|
|
}
|
|
label {
|
|
display: block;
|
|
margin-bottom: 5px;
|
|
font-weight: bold;
|
|
}
|
|
input[type="text"], input[type="number"] {
|
|
width: 100%;
|
|
padding: 8px;
|
|
box-sizing: border-box;
|
|
margin-bottom: 15px;
|
|
}
|
|
button {
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
padding: 10px 20px;
|
|
border: none;
|
|
cursor: pointer;
|
|
}
|
|
button:hover {
|
|
background-color: #45a049;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Add Album</h1>
|
|
<form method="POST">
|
|
<label for="title">Title:</label>
|
|
<input type="text" id="title" name="title" required><br><br>
|
|
|
|
<label for="artist">Artist:</label>
|
|
<input type="text" id="artist" name="artist" required><br><br>
|
|
|
|
<label for="year">Year:</label>
|
|
<input type="number" id="year" name="year" required><br><br>
|
|
|
|
<button type="submit">Add Album</button>
|
|
</form>
|
|
|
|
<h1>Manage Albums</h1>
|
|
<ul>
|
|
{% for album in albums %}
|
|
<li>
|
|
{{ album.title }} by {{ album.artist }} ({{ album.year }})
|
|
<form method="POST" style="display: inline;">
|
|
<input type="hidden" name="action" value="edit">
|
|
<input type="hidden" name="album_id" value="{{ album.id }}">
|
|
<button type="submit">Edit</button>
|
|
</form>
|
|
<form method="POST" style="display: inline;">
|
|
<input type="hidden" name="action" value="delete">
|
|
<input type="hidden" name="album_id" value="{{ album.id }}">
|
|
<button type="submit">Delete</button>
|
|
</form>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</body>
|
|
</html>
|