<link rel="stylesheet" href="../../../static/css/answer.css"/>
{% extends "base.html" %} {% block content %}
<div class="decision_page">
    <div class="head_buttons_block">
        <div class="link_back_block">
            <a class="link_back" href="../../../project/{{ project.id }}">
                <p class="link_back_text">К проекту</p>
            </a>
        </div>
        {% if task.creator == current_user.id or project.creator == current_user.id %}
        <div class="link_edit_block">
            <a class="link_edit" href="{{ task.id }}/edit">
                <p class="link_edit_text">Редактировать</p>
            </a>
        </div>
        {% endif %}
    </div>
    <div class="name_block">
        <div class="title_block">
            <h3 class="title_task">{{ task.name }}</h3>
        </div>
        <div class="description_task">
            <div class="description">
                <p class="description_text">{{ task.description }}</p>
            </div>
        </div>
        {% if list_files %}
        <div class="files">
            <h2 class="files_title">Файлы</h2>
            <div class="files_block">
                <div class="files_list">
                    {% for file in list_files %}
                    <div class="file">
                        <div class="file_head">
                            <nav class="file_head_group" style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
                                <ol class="breadcrumb file_head_path">
                                    {% for path in file['current_path'] %}
                                    <li class="breadcrumb-item active file_path" aria-current="page">{{ path }}</li>
                                    {% endfor %}
                                </ol>
                            </nav>
                        </div>
                        <div class="file_buttons">
                            <div class="btn-group file_buttons_groud">
                                {% if current_user.id == project.creator or task.creator == current_user.id or
                                file['user'] == current_user.id %}
                                <a href="../file/{{ file.id }}/delete" class="btn btn-primary file_delete"><p
                                        class="button_text">Удалить</p></a>
                                {% endif %}
                                <a href="../../../{{ file['path'] }}" download="" class="btn btn-primary file_download">
                                    <p class="button_text">Скачать</p></a>
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
        </div>
        {% endif %}
    </div>
    <div class="decision_block">
        <form action="" method="post" class="answer_form" enctype="multipart/form-data">
            {{ form.hidden_tag() }}
            <div class="form_data bottom_data form_text_one">
                <label class="form_label">{{ form.text.label }}</label>
                {{ form.text(class="input_data text_data", type="text", id="text_data", placeholder='your answer') }}
                {% for error in form.text.errors %}
                <div class="alert alert-danger" role="alert">{{ error }}</div>
                {% endfor %}
            </div>
            <div class="data_block">
                <div class="form_data bottom_data">
                    <label class="form_label">{{ form.file.label }}</label>
                    {{ form.file(class="input_data padding_data", type="file") }}
                    {% for error in form.file.errors %}
                    <div class="alert alert-danger" role="alert">{{ error }}</div>
                    {% endfor %}
                </div>
            </div>
            <div class="form_data_button">
                {{ form.submit(type="submit", class="quest_button") }}
                <div class="box">
                    {{ form.realized(class="realized")}}
                    {{form.realized.label }}<br/>
                    {% for error in form.realized.errors %}
                    <div class="alert alert-danger" role="alert">{{ error }}</div>
                    {% endfor %}
                </div>
            </div>
        </form>
    </div>
</div>
{% endblock %}