2025-05-30 22:16:05 +00:00
|
|
|
<!-- admin.html -->
|
2025-05-30 21:20:55 +00:00
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
2025-05-30 22:16:05 +00:00
|
|
|
<title>Admin</title>
|
2025-05-30 22:42:08 +00:00
|
|
|
<title>Music Album Catalog Admin Page</title>
|
2025-05-31 11:18:15 +00:00
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
2025-05-30 21:20:55 +00:00
|
|
|
</head>
|
2025-05-30 22:42:08 +00:00
|
|
|
|
2025-05-30 21:20:55 +00:00
|
|
|
<body>
|
2025-05-30 22:16:05 +00:00
|
|
|
<h1>Albums</h1>
|
2025-05-30 22:42:08 +00:00
|
|
|
<table>
|
2025-05-30 22:16:05 +00:00
|
|
|
<tr>
|
|
|
|
|
<th>ID</th>
|
|
|
|
|
<th>Title</th>
|
|
|
|
|
<th>Artist</th>
|
|
|
|
|
<th>Year</th>
|
|
|
|
|
<th>Actions</th>
|
|
|
|
|
</tr>
|
2025-05-30 21:20:55 +00:00
|
|
|
{% for album in albums %}
|
2025-05-30 22:16:05 +00:00
|
|
|
<tr>
|
|
|
|
|
<td>{{ album.id }}</td>
|
|
|
|
|
<td>{{ album.title }}</td>
|
|
|
|
|
<td>{{ album.artist }}</td>
|
|
|
|
|
<td>{{ album.year }}</td>
|
|
|
|
|
<td>
|
|
|
|
|
<form action="/admin" method="post">
|
2025-05-30 21:20:55 +00:00
|
|
|
<input type="hidden" name="action" value="edit">
|
|
|
|
|
<input type="hidden" name="album_id" value="{{ album.id }}">
|
2025-05-30 22:16:05 +00:00
|
|
|
<input type="text" name="title" placeholder="New Title">
|
|
|
|
|
<input type="text" name="artist" placeholder="New Artist">
|
|
|
|
|
<input type="number" name="year" placeholder="New Year">
|
2025-05-30 21:20:55 +00:00
|
|
|
<button type="submit">Edit</button>
|
|
|
|
|
</form>
|
2025-05-30 22:16:05 +00:00
|
|
|
<form action="/admin" method="post">
|
2025-05-30 21:20:55 +00:00
|
|
|
<input type="hidden" name="action" value="delete">
|
|
|
|
|
<input type="hidden" name="album_id" value="{{ album.id }}">
|
|
|
|
|
<button type="submit">Delete</button>
|
|
|
|
|
</form>
|
2025-05-30 22:16:05 +00:00
|
|
|
</td>
|
|
|
|
|
</tr>
|
2025-05-30 21:20:55 +00:00
|
|
|
{% endfor %}
|
2025-05-30 22:16:05 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<!-- Form for adding a new album -->
|
|
|
|
|
<h2>Add New Album</h2>
|
|
|
|
|
<form action="/admin" method="post">
|
|
|
|
|
<input type="hidden" name="action" value="add_album">
|
|
|
|
|
<label for="title">Title:</label>
|
|
|
|
|
<input type="text" id="title" name="title" required>
|
|
|
|
|
<br>
|
|
|
|
|
<label for="artist">Artist:</label>
|
|
|
|
|
<input type="text" id="artist" name="artist" required>
|
|
|
|
|
<br>
|
|
|
|
|
<label for="year">Year:</label>
|
|
|
|
|
<input type="number" id="year" name="year" required>
|
|
|
|
|
<br>
|
|
|
|
|
<button type="submit">Add Album</button>
|
|
|
|
|
</form>
|
2025-05-30 21:20:55 +00:00
|
|
|
</body>
|
|
|
|
|
</html>
|