<link rel="stylesheet" href="../static/css/projects.css"/>
{% extends "base.html" %} {% block content %}
<div class="projects_page">
    <div class="header_block">
        <h2 class="header_title">ПРОЕКТЫ</h2>
        <strong class="header_title_2">Здесь вы можете создавать свои проекты, изменять их, ставить дату дедлайна и
            добавлять участников в своей проект.</strong>
    </div>
    <div class="find_block">
        <form action="" method="post" class="form_project_block">
            {{ form.hidden_tag() }}
            {{ form.project(class="find_input_text", type="text", placeholder='Имя проекта') }}
            {% for error in form.project.errors %}
            <div class="alert alert-danger" role="alert">{{ error }}</div>
            {% endfor %}
            {{ form.submit(type="submit", class="find_input_button") }}
            {% if find == 1 %}
            <div class="find_project_button">
                <a class="find_project_button_link" href="/projects">
                    <p class="find_project_button_text">Сброс</p>
                </a>
            </div>
            {% endif %}
            <div class="new_project_button">
                <a class="new_project_button_link" href="/projects/new">
                    <p class="new_project_button_text">Создать</p>
                </a>
            </div>
        </form>
    </div>
    <div class="list_project_block">
        {% for project in list_projects %}
        <div class="accordion list_project" id="accordionPanelsStayOpen{{ project.id }}">
            <div class="accordion-item project">
                <h2 class="accordion-header project_header" id="panelsStayOpen-heading{{ project.id }}">
                    <button class="accordion-button project_header_button" type="button" data-bs-toggle="collapse"
                            data-bs-target="#panelsStayOpen-collapse{{ project.id }}" aria-expanded="true"
                            aria-controls="panelsStayOpen-collapse{{ project.id }}">
                        <div class="project_button_block_one">
                            <div class="project_logo_block">
                                <img src="{{ project.logo }}" class="project_logo">
                            </div>
                            <div class="project_title_block">
                                <p class="project_title">{{ project.name }}</p>
                            </div>
                        </div>
                    </button>
                </h2>
                <div id="panelsStayOpen-collapse{{ project.id }}"
                     class="accordion-collapse collapse project_description_block"
                     aria-labelledby="panelsStayOpen-heading{{ project.id }}">
                    <div class="accordion-body project_description">
                        <div class="collaborator_block">
                            <div class="staff_block">
                                {% for user in project.staff %}
                                <div class="user">
                                    <a class="link_to_user" href="/user/{{ user.login }}">
                                        <img class="user_logo" src="{{user.photo}}">
                                        <p class="user_names">{{user.name}}</p>
                                    </a>
                                </div>
                                {% endfor %}
                            </div>
                        </div>
                        <div class="description_block">
                            <div class="description_header_block">
                                <p class="description_header_text">Описание</p>
                            </div>
                            <div class="description_block_text">
                                <p class="description_text">{{ project.description }}</p>
                            </div>
                        </div>
                        <div class="open_project_block">
                            <div class="open_button">
                                <a class="open_button_link" href="/project/{{ project.id }}">
                                    <p class="open_button_text">Открыть</p>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %}