<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Directory Listing - {{ path }}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="/">Puzzle</a>
            <div class="navbar-nav ms-auto">
                <a class="nav-link" href="/home">Home</a>
                {% if not is_public %}
                <a class="nav-link" href="/admin">Admin</a>
                {% endif %}
                <a class="nav-link" href="/profile">Profile</a>
                <a class="nav-link" href="/logout">Logout</a>
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        <h2>Directory Listing: {{ path }}</h2>
        
        {% if files %}
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>Filename</th>
                    <th>Size</th>
                    <th>Last Modified</th>
                </tr>
            </thead>
            <tbody>
                {% for file in files %}
                <tr>
                    <td>
                        <a href="{{ path }}/{{ file.name }}">{{ file.name }}</a>
                    </td>
                    <td>{{ file.size }} bytes</td>
                    <td>{{ file.modified }}</td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        {% else %}
        <div class="alert alert-info">
            No files found in this directory.
        </div>
        {% endif %}
    </div>
</body>
</html>