{% load static %}
{% load i18n %}


{%trans "Введите сообщение..." as p_write_msg %}
{%trans "Тема запроса" as p_create_ticket %}
<form class="form-create-ticket" name="create-ticket">

    {% if errors.all__ %}<div class="errors_all" style="margin-bottom: 12px;width: 100%;font-size: 16px;">{{ errors.all__ }}</div>{% endif %}

    {% csrf_token %}
    <div class="container-input-form-create-ticket">
        <select name="department"
                id="id_department"
            class="custom_select el-form-create-ticket-select">
{#            <option>Отдел: Техническая поддержка</option>#}
            {% for choice in form.fields.department.choices %}
                <option title="{{ choice.1 }}" value="{{ choice.0 }}"{% if choice.0 == form.initial.department %} selected{% endif %}>{{ choice.1 }}</option>
            {% endfor %}
        </select>
        {% if form.errors.department %}<div class="errors">{{ form.errors.department }}</div>{% endif %}
    </div>
    <div class="container-input-form-create-ticket">
        <input type="text"
               class="el-form-create-ticket"
               name="name"
               id="id_name"
               placeholder= "{{ p_create_ticket }}"
               value="{% if form.initial.name %}{{ form.initial.name }}{% endif %}"
        >
        {% if form.errors.name %}<div class="errors">{{ form.errors.name }}</div>{% endif %}
    </div>
    <div class="container-input-form-create-ticket">
        <div style="width: 100%;min-height: 240px;filter: drop-shadow(-1px 4px 10px rgba(198, 199, 203, 0.20)) drop-shadow(0px -1px 10px rgba(198, 199, 203, 0.20));">
            <textarea name="text"
                      id="id_text"
                      class="el-form-create-ticket-textarea"
                      placeholder="{{ p_write_msg }}"
{#                      placeholder=p_write_msg  #}
                      value="{% if form.adding_machine.text %}{{ form.initial.text }}{% endif %}"
                      onclick="countLetters()"
                      oninput="countLetters()"
                      maxlength="500"></textarea>
            <div class="letrs-count"><span class="letrs-count-span ins-span">0</span><span class="ins_span">/500</span></div>

        </div>
        {% if form.errors.text %}<div class="errors">{{ form.errors.text }}</div>{% endif %}

    </div>
    <div class="form-create-tickets-btns">
        <button class="create-ticket-btn" onclick="createTicket(this)">{% translate "Создать тикет" %}</button>
        <button class="attach-file-btn" onclick="attachFileCreateTicket()"></button>
{#        <input class="create-ticket-file" type="file" value="">#}

    </div>
</form>

<div></div>