{% extends 'buybackprogram/page.html' %}
{% load i18n %}
{% load humanize %}
{% load django_bootstrap5 %}
{% load static %}

{% block body %}
<div class="card">
    <div class="card-header">
        <i class="fas fa-tag me-1"></i> {% trans "Add Static Price" %}
    </div>
    <div class="card-body">
        {% if perms.buybackprogram.manage_all_programs or perms.buybackprogram.manage_programs and program.owner.user == request.user %}
            <form class="form" action="{% url 'buybackprogram:program_edit_static_price' program_pk=program.id %}" method="POST">
                {% csrf_token %}
                {% bootstrap_form form %}
                <div class="d-flex gap-2 mt-2">
                    <button type="submit" class="btn btn-primary">
                        <i class="fas fa-save me-1"></i>{% trans "Save Static Price" %}
                    </button>
                    <a class="btn btn-secondary" href="{% url 'buybackprogram:program_special_taxes' program_pk=program.id %}">
                        <i class="fas fa-arrow-left me-1"></i>{% trans "Back" %}
                    </a>
                </div>
            </form>
        {% else %}
            <p class="text-muted">{% trans "You do not have permission to manage this program." %}</p>
            <a class="btn btn-secondary btn-sm" href="{% url 'buybackprogram:program_special_taxes' program_pk=program.id %}">
                <i class="fas fa-arrow-left me-1"></i>{% trans "Back" %}
            </a>
        {% endif %}
    </div>
</div>
{% endblock %}

{% block extra_javascript %}
<script src="{% static 'buybackprogram/js/bootstrap-autocomplete.min.js' %}"></script>
<script src="{% static 'buybackprogram/js/autocomplete.js' %}"></script>
{% endblock %}

{% block extra_css %}
{% include "buybackprogram/bundles/buybackprogram-css-light.html" %}
{% endblock %}
