<!doctype html>
<html lang="en">
<head>
    {% if not present_export %}
        <title>Manim Editor &mdash; {{ title }}</title>
    {% else %}
        <title>{{ name }}</title>
    {% endif %}
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="shortcut icon" type="image/jpg" href="{{ url_for('static', filename='img/favicon.png') }}"/>
    <link rel="stylesheet" href="{{ url_for('static', filename='webpack/base.css') }}">
    {% block stylesheets %}{% endblock %}
</head>

<body class="d-flex flex-column min-vh-100">
    <nav class="navbar navbar-expand-lg navbar-light bg-light mb-3">
        <div class="container-fluid">
            {% if not present_export %}
                <a class="navbar-brand" href="{{ url_for('main.index') }}">Manim Editor</a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <div class="navbar-nav">
                        <a class="nav-link {% if title == 'Project Selection' %}active{% endif %}" href="{{ url_for('main.project_selection') }}">Project Selection</a>
                        <a class="nav-link {% if title == 'Create New Project' %}active{% endif %}" href="{{ url_for('main.create_project') }}">Create New Project</a>
                        <div class="nav-link {% if title == 'Edit Project' %}active{% endif %}">Edit Project</div>
                        <a class="nav-link" target="_blank" href="https://manim-editor.readthedocs.io/en/latest">Docs</a>
                        <a class="nav-link" target="_blank" href="https://github.com/ManimEditorProject/manim_editor">
                            <i class="bi bi-github" role="img"></i>
                            GitHub
                        </a>
                    </div>
                </div>
            {% else %}
                <a class="navbar-brand" target="_blank" href="https://github.com/ManimEditorProject/manim_editor"></a>
            {% endif %}
        </div>
    </nav>
    {% if not present_export %}
        <div class="container">
            <div id="flashes">
                {% with messages = get_flashed_messages(with_categories=True) %}
                {% for category, message in messages %}
                <div class="alert alert-{{ category }} alert-dismissible fade show mt-3" role="alert">
                    {{ message }}
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                </div>
                {% endfor %}
                {% endwith %}
            </div>
            {% block content %}{% endblock %}
        </div>
    {% endif %}

    <div class="container-fluid">
        {% block fluid_content %}{% endblock %}
    </div>

    <footer class="page-footer font-small mt-auto">
        <div class="footer-copyright text-center pb-3 fs-6 text-muted">
            {% if not present_export %}
                {{ version }}
                <a class="ms-2" href="https://github.com/ManimEditorProject/manim_editor">
                    Source on GitHub
                </a>
            {% else %}
                Created with the
                <a href="https://github.com/ManimEditorProject/manim_editor">
                    Manim Editor {{ version }}
                </a>
            {% endif %}
        </div>
    </footer>

    <script src="{{ url_for('static', filename='webpack/base.js') }}"></script>
    {% block scripts %}{% endblock scripts %}
</body>
</html>
