{% extends 'tickets/ticket_detail.html' %}
{% load static %}
{% load i18n %}

{% block status %}
{% endblock %}

{% block action %}
   <a class="btn btn-sm btn-primary btn-update btn-action" data-action="approve"><i class="fa fa-check"></i> {% trans 'Approve' %}</a>
   <a class="btn btn-sm btn-danger btn-update btn-action" data-action="reject"><i class="fa fa-times"></i> {% trans 'Reject' %}</a>
{% endblock %}

{% block custom_foot_js %}
{{ block.super }}
<script>
    var ticketDetailUrl = "{% url 'api-tickets:login-confirm-ticket-detail' pk=object.id %}";
    $(document).ready(function () {
    }).on('click', '.btn-action', function () {
        createComment(function () {
        });
        var action = $(this).data('action');
        var data = {
            url: ticketDetailUrl,
            body: JSON.stringify({action: action}),
            method: "PATCH",
            success: reloadPage
        };
        requestApi(data);
    })
</script>
{% endblock %}



