{% extends "base.html" %}
{% block title %}Paste Settings{% endblock %}
{% block content %}
<div class="container mt-4">
    <h3>Settings for: paste_{{ paste.id }}.{{ paste.get_extension() }}</h3>
    <form method="POST">
        <div class="mb-3">
            <label for="title" class="form-label">Title</label>
            <input type="text" id="title" name="title" class="form-control" value="{{ paste.title or '' }}">
        </div>

     <div class="mb-3">
        <label for="language" class="form-label">Language (Optional)</label>
        <select class="form-select" id="language" name="language">
            <option value="">Select a Language, leave it blank to auto detect</option>
            {% for value, label in pygments_languages %}
                <option value="{{ value }}" {% if paste.language == value %}selected{% endif %}>
                    {{ label }}
                </option>
            {% endfor %}
        </select>
    </div>
        <div class="mb-3">
            <label for="expires_at" class="form-label">Expires At</label>
            <input type="date" id="expires_at" name="expires_at" class="form-control"
                   value="{{ paste.expires_at.strftime('%Y-%m-%d') if paste.expires_at else '' }}">
        </div>

        <div class="form-check mb-2">
            <input class="form-check-input" type="checkbox" id="private" name="private" {% if paste.private %}checked{% endif %}>
            <label class="form-check-label" for="private">Private</label>
        </div>

        <div class="form-check mb-2">
            <input class="form-check-input" type="checkbox" id="editable" name="editable" {% if paste.editable %}checked{% endif %}>
            <label class="form-check-label" for="editable">Editable</label>
        </div>

        <button type="submit" class="btn btn-primary">Save Changes</button>
        <a href="{{ url_for('user_dashboard') }}" class="btn btn-secondary">Back</a>
    </form>
</div>
{% endblock %}


