{% extends request.ajax ? 'layout_blank.html.twig' : 'layout_default.html.twig' %}

{% import 'macro_functions.html.twig' as mf %}

{% block meta_title %}{{ 'Canned Category'|trans }}{% endblock %}

{% set active_menu = 'support' %}

{% block breadcrumbs %}
    <ol class="breadcrumb">
        <li class="breadcrumb-item">
            <a href="{{ '/'|alink }}">
                <svg class="icon">
                    <use xlink:href="#home" />
                </svg>
            </a>
        </li>
        <li class="breadcrumb-item">
            <a href="{{ 'support'|alink }}">{{ 'Support'|trans }}</a>
        </li>
        <li class="breadcrumb-item">
            <a href="{{ 'support/canned-responses'|alink }}">{{ 'Canned Responses'|trans }}</a>
        </li>
        <li class="breadcrumb-item">
            <a href="{{ 'support/canned-responses'|alink }}#tab-categories">{{ 'Categories'|trans }}</a>
        </li>
        <li class="breadcrumb-item active" aria-current="page">{{category.title}}</li>
    </ol>
{% endblock %}

{% block content %}
<div class="card">
    <div class="card-body">
        <h3>{{ 'Canned category'|trans }}</h3>

        <form method="post" action="{{ 'api/admin/support/canned_category_update'|link }}" class="api-form" data-api-redirect="{{ 'support/canned-responses'|alink }}">
            <div class="mb-3 row">
                <label class="form-label col-3 col-form-label">{{ 'Title'|trans }}:</label>
                <div class="col">
                    <input class="form-control" type="text" name="title" value="{{ category.title }}" required>
                </div>
            </div>

            <input type="hidden" name="id" value="{{ category.id }}">
            <button class="btn btn-primary w-100" type="submit">{{ 'Update'|trans }}</button>
        </form>
    </div>
</div>
{% endblock %}
