{% extends "base.html" %}
{% block title %}Upload File - {{ config.BBS_NAME }}{% endblock %}
{% block content %}
<div class="bbs-header">
    <h1><i class="bi bi-upload"></i> Upload File</h1>
</div>
<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header">Upload a File</div>
            <div class="card-body">
                <form method="post" enctype="multipart/form-data">
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                    {{ form.hidden_tag() }}
                    <div class="mb-3">
                        {{ form.file_area_id.label(class="form-label") }}
                        {{ form.file_area_id(class="form-select") }}
                        <div class="form-text">
                            Pick an area to scope the upload, or leave at
                            top-level. Areas may restrict who can upload.
                        </div>
                    </div>
                    <div class="mb-3">
                        {{ form.file.label(class="form-label") }}
                        {{ form.file(class="form-control") }}
                        {% for e in form.file.errors %}<div class="text-danger">{{ e }}</div>{% endfor %}
                    </div>
                    <div class="mb-3">
                        {{ form.description.label(class="form-label") }}
                        {{ form.description(class="form-control", rows="3",
                            placeholder="Leave blank to auto-extract FILE_ID.DIZ from the archive") }}
                    </div>
                    <div class="d-flex gap-2">
                        {{ form.submit(class="btn btn-primary") }}
                        <a href="{{ url_for('files.list_files') }}" class="btn btn-secondary">Cancel</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
