{% extends "base.html" %} {% import "_macros.html" as m with context %} {% block title %}AI draft{% endblock %} {% block content %} {% if d.kind == "site" %}
{{ m.icon("up") }}{{ d.domain }}

New page draft

Nothing is published yet. Look it over, ask for changes, then publish it as index.html.

{{ m.csrf_field() }}
{{ m.csrf_field() }}
{% if d.has_index_php %}

This site has an index.php, which is served before index.html. Remove or rename it after publishing, or the new page will not show.

{% endif %}
{{ d.domain }}
{# Isolation comes from the preview response itself (CSP sandbox, unique origin). A sandbox attribute here would make the browser load the frame without the panel session, and the preview would stay blank. #}

Ask for changes

The AI keeps the page and applies only what you ask.

{{ m.csrf_field() }}
Usually 20–90 seconds.
Source code ({{ d.content|length|filesizeformat }})
{{ d.content }}
{% else %} {% set own = d.owner if is_admin else "" %}
{{ m.icon("up") }}{{ d.path.rsplit('/', 1)[-1] }}

Proposed changes

“{{ d.prompt }}”. +{{ d.added }} −{{ d.removed }} lines. Nothing is saved until you apply it.

{{ m.csrf_field() }}
{{ m.csrf_field() }}
{% if d.stale %}

The file changed after the AI read it. Go back to the file and ask again so nothing is lost.

{% endif %}
{% for line in d.diff %}{% if line.startswith('+++') or line.startswith('---') %}{{ line }}{% elif line.startswith('@@') %}{{ line }}{% elif line.startswith('+') %}{{ line }}{% elif line.startswith('-') %}{{ line }}{% else %}{{ line }}{% endif %}
{% else %}The AI returned the file without changes.{% endfor %}
{% endif %} {% endblock %}