{% extends "base.html" %}
{% block title %}Edit Prompts{% endblock %}
{% block content %}
    <div class="alert alert-primary alert-dismissible fade show" role="alert">
        <h4 class="alert-heading">Edit Prompts</h4>
        <button type="button"
                class="btn-close"
                data-bs-dismiss="alert"
                aria-label="Close"></button>
        <p>Select a prompt file to edit for the current revision</p>
    </div>
    <h3 class="header-space">Available Prompt Files</h3>
    {% if files %}
        <div class="list-group">
            {% for file in files %}
                <a href="{{ url_for('edit_file', filename=file) }}"
                   class="list-group-item list-group-item-action">
                    <i class="bi bi-file-text"></i> {{ file }}
                </a>
            {% endfor %}
        </div>
    {% else %}
        <div class="alert alert-warning" role="alert">
            <i class="bi bi-exclamation-triangle"></i>
            No prompt files found for this revision. You can create new files by editing them directly.
        </div>
        <p>
            <a href="{{ url_for('edit_file', filename='new_prompt.jinja') }}"
               class="btn btn-primary">
                <i class="bi bi-plus"></i> Create New Prompt
            </a>
        </p>
    {% endif %}
{% endblock %}
