{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
{% import "macro_functions.phtml" as mf %}
{% set active_menu = 'support' %}
{% block meta_title %}Canned response{% endblock %}

{% block content %}

<div class="widget first">

    <div class="head">
        <h5>{% trans 'Canned response' %}</h5>
    </div>
    
    <form method="post" action="admin/support/canned_update" class="mainForm save api-form" data-api-redirect="support/canned-responses">
        <fieldset>
            <div class="rowElem noborder">
                <label>{% trans 'Category' %}:</label>
                <div class="formRight">
                    {{ mf.selectbox('category_id', admin.support_canned_category_pairs, response.category.id, 1) }}
                </div>
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <label>{% trans 'Title' %}:</label>
                <div class="formRight">
                    <input type="text" name="title" value="{{response.title}}" required="required" placeholder=""/>
                </div>
                <div class="fix"></div>
            </div>
            <input type="submit" value="{% trans 'Update' %}" class="greyishBtn submitForm" />
            <input type="hidden" name="id" value="{{ response.id }}"/>
        </fieldset>
    </form>
    
    <div class="body">
        <a href="{{ 'support/canned-responses'|alink }}"  title="" class="btnIconLeft mr10"><img src="images/icons/dark/arrowLeft.png" alt="" class="icon"><span>{% trans 'Go back' %}</span></a>
    </div>
</div>


<div class="widget">
    <div class="head">
        <h5>{{response.title}}</h5>
    </div>
    
    <form method="post" action="admin/support/canned_update" class="mainForm save api-form" data-api-redirect="support/canned-responses">
        <fieldset>
            <textarea name="content" cols="5" rows="10" class="bb-textarea">{{ response.content }}</textarea>
            <input type="submit" value="{% trans 'Update' %}" class="greyishBtn submitForm" />
            <input type="hidden" name="id" value="{{ response.id }}"/>
        </fieldset>
    </form>
</div>


{% endblock %}


{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %}