{% extends "admin/generate_image_base.html" %}
{% load i18n %}

{% block image_title %}Generate Image for "{{ word_instance.word }}"{% endblock %}

{% block breadcrumb_items %}
    <li class="breadcrumb-item"><a href="{% url "admin:cmsv2_word_changelist" %}">{% translate "Words" %}</a></li>
    <li class="breadcrumb-item"><a href="{% url "admin:cmsv2_word_change" word_instance.pk %}">{{ word_instance.word }}</a></li>
    <li class="breadcrumb-item active">{% trans "Generate Image" %}</li>
{% endblock %}

{% block image_info %}
    <div>
        <strong>Word Text:</strong> {{ word_text }}
    </div>
{% endblock %}

{% block store_url %}{% url "cmsv2:word_store_generated_image_permanently" word_instance.pk %}{% endblock %}

{% block store_button_text %}Store to Image Field{% endblock %}

{% block back_buttons %}
    <a href="{% url "admin:cmsv2_word_change" word_instance.pk %}" class="button">Back to Edit View</a>
{% endblock %}

{% block generate_url %}{% url "cmsv2:generate_image_via_openai" %}{% endblock %}

{% block form_data_builder %}
function(formData) {
    formData.append("word_text", "{{ word_text }}")
}
{% endblock %}
