{#
 # ---------------------------------------------------------------------
 # Formcreator is a plugin which allows creation of custom forms of
 # easy access.
 # ---------------------------------------------------------------------
 # LICENSE
 #
 # This file is part of Formcreator.
 #
 # Formcreator 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 2 of the License, or
 # (at your option) any later version.
 #
 # Formcreator 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 Formcreator. If not, see <http://www.gnu.org/licenses/>.
 # ---------------------------------------------------------------------
 # @copyright Copyright © 2011 - 2021 Teclib'
 # @license   http://www.gnu.org/licenses/gpl.txt GPLv3+
 # @link      https://github.com/pluginsGLPI/formcreator/
 # @link      https://pluginsglpi.github.io/formcreator/
 # @link      http://plugins.glpi-project.org/#/plugin/formcreator
 # ---------------------------------------------------------------------
 #}

{% import 'components/form/fields_macros.html.twig' as fields %}

<div class="card-body d-flex flex-wrap">
    <div class="col-12 col-xxl-{{ item_has_pictures ? '9' : '12' }} flex-column">
        <div class="d-flex flex-row flex-wrap flex-xl-nowrap">
        <div class="row flex-row align-items-start flex-grow-1">
            <div class="row flex-row">
                <table class="table">
                    <tr><th colspan="5">{{ __('List of available tags') }}</th></tr>
                    <tr>
                        <th colspan="2">{{ _n('Question', 'Questions', 1, 'formcreator') }}</th>
                        <th>{{ __('Title') }}</th>
                        <th>{{ _n('Answer', 'Answers', 1, 'formcreator') }}</th>
                        <th>{{ _n('Section', 'Sections', 1, 'formcreator') }}</th>
                    </tr>
                    <tr>
                        <td colspan="2"><strong>{{ __('Full form', 'formcreator') }}</strong></td>
                        <td>-</td>
                        <td><strong>##FULLFORM##</strong></td>
                        <td>-</td>
                    </tr>
                     {% for tag in extra_tags %}
                        <tr>
                            <td colspan="2"><strong>{{ tag.question }}</strong></td>
                            <td>{{ tag.title }}</td>
                            <td><strong>{{ tag.answer }}</strong></td>
                            <td>{{ tag.section }}</td>
                        </tr>
                    {% endfor %}
                    {% set sections = call('PluginFormcreatorQuestion::getQuestionsFromFormBySection', [item]) %}
                    {% for sectionName, questions in sections %}
                        {% for questionId, questionName in questions %}
                            <tr>
                                <td colspan="2">{{ questionName }}</td>
                                <td>##question_{{ questionId }}##</td>
                                <td>##answer_{{ questionId }}##</td>
                                <td>{{ sectionName }}</td>
                            </tr>
                        {% endfor %}
                    {% endfor %}
                </table>
            </div> {# .row #}
        </div> {# .row #}
        </div> {# .flex-row #}
    </div>
