<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Interface</title>
    <style>
        table {
            border-collapse: collapse;
            width: 100%;
        }
        th, td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
    </style>
</head>
<body>
    <h1>Admin Interface</h1>
    {% with messages = get_flashed_messages() %}
        {% if messages %}
            <ul>
                {% for message in messages %}
                    <li>{{ message }}</li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endwith %}
    <h2>Upload New Image</h2>
    <form action="{{ url_for('admin_upload') }}" method="POST" enctype="multipart/form-data">
        <input type="file" name="file" accept=".jpg,.jpeg,.png,.gif" required>
        <input type="submit" value="Upload">
    </form>
    <h2>Uploaded Images</h2>
    <table>
        <tr>
            <th>ID</th>
            <th>Thumbnail</th>
            <th>Filename</th>
            <th>Date Taken</th>
            <th>Technical Info</th>
        </tr>
        {% for photo in photos %}
        <tr>
            <td>{{ photo.id }}</td>
            <td><img src="{{ url_for('static', filename='thumbnails/' + photo.thumbnail_filename) }}" alt="Thumbnail" width="100"></td>
            <td>{{ photo.input_filename }}</td>
            <td>{{ photo.date_taken.strftime('%Y-%m-%d %H:%M:%S') }}</td>
            <td>{{ photo.focal_length }}mm f/{{ photo.aperture }} {{ photo.shutter_speed }}s ISO{{ photo.iso }}</td>
        </tr>
        {% endfor %}
    </table>
</body>
</html>
