{% load static %}
<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="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="Тема запроса"
               value="{% if form.adding_machine.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 class="letrs-count" style="color: #27242499;position: relative;top: 39px;left: 760px;display: inline-block;"><span class="letrs-count-span">0</span><span>/500</span></div>
        <textarea name="text"
                  id="id_text"
                  class="el-form-create-ticket-textarea"
                  placeholder="Введите сообщение..."
                  value="{% if form.adding_machine.text %}{{ form.initial.text }}{% endif %}"
                  onkeyup="countLetters()"></textarea>
        {% 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)">Создать тикет</button>
        <button class="attach-file-btn" onclick="attachFileCreateTicket()"></button>
{#        <input class="create-ticket-file" type="file" value="">#}

    </div>
</form>