<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:formvh="http://typo3.org/ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="FormManager" />
<f:section name="MainContent">

    <h1><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.headline" /></h1>
    <f:if condition="{paginator.paginatedItems}">
        <f:then>
            <div class="table-fit">
                <table id="forms" class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <th></th>
                            <th><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.form_name" /></th>
                            <th><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.location" /></th>
                            <th></th>
                            <th></th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                    <f:for each="{paginator.paginatedItems}" as="form">
                        <tr>
                            <td class="col-icon">
                                <f:if condition="{form.invalid}">
                                    <f:then>
                                        <span title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.invalid')}" data-bs-toggle="tooltip" data-bs-placement="top">
                                            <core:icon identifier="overlay-missing" />
                                        </span>
                                    </f:then>
                                    <f:else if="{form.duplicateIdentifier}">
                                        <span title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.duplicate_identifier')} {form.identifier}" data-bs-toggle="tooltip" data-bs-placement="top">
                                            <core:icon identifier="overlay-missing" />
                                        </span>
                                    </f:else>
                                    <f:else>
                                        <span title="id={form.identifier}" data-bs-toggle="tooltip" data-bs-placement="right">
                                            <core:icon identifier="content-form" />
                                        </span>
                                    </f:else>
                                </f:if>
                            </td>
                            <td class="col-title">
                                <f:if condition="{form.invalid} || {form.readOnly}">
                                        <f:then>
                                            <div title="{form.name}">{form.name}</div>
                                        </f:then>
                                        <f:else>
                                            <f:link.action controller="FormEditor" action="index" arguments="{formPersistenceIdentifier: form.persistenceIdentifier}" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.edit_form')}" data="{toggle: 'tooltip', placement: 'right'}">{form.name}</f:link.action>
                                        </f:else>
                                </f:if>
                            </td>
                            <td><code>{form.persistenceIdentifier}</code></td>
                            <td class="col-control">
                                <f:if condition="{form.referenceCount}">
                                    <f:then>
                                        <a href="#" data-identifier="showReferences" data-form-persistence-identifier="{form.persistenceIdentifier}" data-form-name="{form.name}">
                                            <span class="label label-info">
                                                {form.referenceCount} <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.references"/>
                                            </span>
                                        </a>
                                    </f:then>
                                    <f:else>
                                        <span class="label label-default">
                                            {form.referenceCount} <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.references"/>
                                        </span>
                                    </f:else>
                                </f:if>
                            </td>
                            <td>
                                <div class="btn-group" role="group">
                                    <f:if condition="{form.invalid} || {form.readOnly}">
                                        <f:then>
                                            <button class="btn btn-default form-record-readonly" disabled="disabled" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.edit_form_not_allowed')}"><core:icon identifier="actions-open" /></button>
                                        </f:then>
                                        <f:else>
                                            <f:link.action controller="FormEditor" action="index" arguments="{formPersistenceIdentifier: form.persistenceIdentifier}" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.edit_form')}" class="btn btn-default form-record-open"><core:icon identifier="actions-open" /></f:link.action>
                                        </f:else>
                                    </f:if>
                                    <f:if condition="{form.invalid}">
                                        <button class="btn btn-default form-record-readonly" disabled="disabled" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.duplicate_form_not_allowed')}"><core:icon identifier="actions-duplicate" /></button>
                                    </f:if>
                                </div>
                                <div class="btn-group dropdown position-static">
                                    <a href="#actions-{form.identifier}" class="btn btn-default dropdown-toggle dropdown-toggle-no-chevron" data-bs-toggle="dropdown" data-bs-boundary="window" aria-expanded="false"><core:icon identifier="actions-menu-alternative" /></a>
                                    <ul id="actions-{form.identifier}" class="dropdown-menu dropdown-list">
                                        <f:if condition="{form.invalid}">
                                            <f:else>
                                                <li>
                                                    <a href="#" class="dropdown-item" aria-label="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.duplicate_this_form')}" data-identifier="duplicateForm" data-form-persistence-identifier="{form.persistenceIdentifier}" data-form-name="{form.name}">
                                                        <core:icon identifier="actions-duplicate" />
                                                        <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.duplicate_this_form" />
                                                    </a>
                                                </li>
                                            </f:else>
                                        </f:if>
                                        <f:if condition="{form.referenceCount}">
                                            <li>
                                                <a href="#" class="dropdown-item" aria-label="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.show_references')}" data-identifier="showReferences" data-form-persistence-identifier="{form.persistenceIdentifier}" data-form-name="{form.name}">
                                                    <core:icon identifier="actions-eye-link" />
                                                    <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.show_references" />
                                                </a>
                                            </li>
                                        </f:if>
                                        <f:if condition="{form.removable} && ({form.invalid} == '0') && ({form.referenceCount} == '0')">
                                            <li>
                                                <a href="#" class="dropdown-item" aria-label="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.delete_form')}" data-identifier="removeForm" data-form-persistence-identifier="{form.persistenceIdentifier}">
                                                    <core:icon identifier="actions-edit-delete" />
                                                    <f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.delete_form" />
                                                </a>
                                            </li>
                                        </f:if>
                                    </ul>
                                </div>
                            </td>
                            <td></td>
                        </tr>
                    </f:for>
                </tbody>
            </table>
        </div>
        <f:render partial="FormManager/Pagination" arguments="{_all}" />
    </f:then>
    <f:else>
        <f:be.infobox state="-1" title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.forms_not_found.title')}">
            <p><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.forms_not_found.message" /></p>
            <a class="btn btn-primary" href="#" data-identifier="newForm"><f:translate key="LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.create_new_form" /></a>
        </f:be.infobox>
    </f:else>
</f:if>

</f:section>
</html>
