{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2025 Teclib' and contributors.
 # @licence   https://www.gnu.org/licenses/gpl-3.0.html
 #
 # ---------------------------------------------------------------------
 #
 # LICENSE
 #
 # This file is part of GLPI.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # ---------------------------------------------------------------------
 #}

<div id="new-itilobject-form" class="d-flex">
   {% for timeline_itemtype in timeline_itemtypes %}
      {% set is_private = timeline_itemtype.item.fields['is_private'] ?? false %}
      {% set is_private_class = is_private ? "private-item" : "" %}
      <div class="timeline-item mb-1 ms-auto {{ is_private_class }} {{ timeline_itemtype.type }} collapse"
        id="new-{{ timeline_itemtype.class }}-block" aria-expanded="false" data-bs-parent="#new-itilobject-form">
         <div class="row">
            <div class="col-auto todo-list-state"></div>
            <div class="col-auto d-flex flex-column user-part ms-0 order-sm-last">
               {{ include('components/user/picture.html.twig', {'users_id': session('glpiID')}, with_context = false) }}
            </div>
            <div class="col-12 col-sm d-flex flex-column content-part">
               <div class="timeline-content t-right card mt-2">
                  <div class="card-body px-1 px-xxl-3">
                     <div class="clearfix">
                        <button class="btn btn-sm btn-ghost-secondary float-end mb-1 close-itil-answer"
                              data-bs-toggle="collapse" data-bs-target="#new-{{ timeline_itemtype.class }}-block">
                           <i class="fs-2 ti ti-x"></i>
                        </button>
                     </div>
                     <div>
                        {% if timeline_itemtype.template is defined %}
                           {{ include(timeline_itemtype.template, {
                              'item': item,
                              'subitem': timeline_itemtype.item,
                              'mention_options': mention_options,
                           }) }}
                        {% else %}
                           {% set sf_options = {'parent': item} %}
                           {{ timeline_itemtype.item.showForm(-1, sf_options) }}
                        {% endif %}
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </div>
   {% endfor %}
</div>
