<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
    xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
>
<f:if condition="{notes}">
    <div class="note-list">
        <h2><f:translate key="LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:internal_note" /></h2>
        <f:for each="{notes}" as="note">
            <div class="note note-category-{note.category}">
                <div class="note-header">
                    <div class="note-header-bar">
                        <a
                            href="#"
                            class="note-icon"
                            data-contextmenu-trigger="click"
                            data-contextmenu-table="sys_note"
                            data-contextmenu-uid="{note.uid}"
                        >
                            <core:icon identifier="sysnote-type-{note.category}" />
                        </a>
                        <span class="note-author">
                            <f:translate key="LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:author" />:
                            <f:if condition="{note.authorDisabled} || {note.authorDeleted} || !{note.authorUsername}">
                                <f:then>[{f:translate(key: 'LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:author_deleted')}]</f:then>
                                <f:else if="{note.authorRealName}">{note.authorRealName}</f:else>
                                <f:else>{note.authorUsername}</f:else>
                            </f:if>
                        </span>
                        <span class="note-date">
                            <f:translate key="LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:date" />:
                            <f:format.date>@{note.tstamp}</f:format.date>
                        </span>
                        <f:if condition="{note.personal}">
                            <span class="note-badge">
                                <span class="badge badge-info"><f:translate key="LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:personal" /></span>
                            </span>
                        </f:if>
                        <span class="note-actions">
                            <span class="btn-group">
                                <f:if condition="{note.canBeEdited}">
                                    <be:link.editRecord uid="{note.uid}" table="sys_note" class="btn btn-default btn-sm" returnUrl="{returnUrl}">
                                        <core:icon identifier="actions-open" />
                                    </be:link.editRecord>
                                </f:if>
                                <f:if condition="{note.canBeDeleted}">
                                    <form action="{be:moduleLink(route:'tce_db')}" method="post">
                                        <input type="hidden" name="cmd[sys_note][{note.uid}][delete]" value="1" />
                                        <input type="hidden" name="redirect" value="{returnUrl}" />
                                        <button
                                            type="submit"
                                            class="btn btn-default btn-sm t3js-modal-trigger"
                                            data-severity="warning"
                                            data-title="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}"
                                            data-bs-content="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf:deleteWarning')}"
                                            data-button-close-text="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}"
                                        >
                                            <core:icon identifier="actions-edit-delete" />
                                        </button>
                                    </form>
                                </f:if>
                            </span>
                        </span>
                    </div>
                </div>
                <div class="note-body">
                    <h4><span>
                        <f:if condition="{note.category}">
                            <f:translate key="LLL:EXT:sys_note/Resources/Private/Language/locallang.xlf:category.{note.category}" />:
                        </f:if>
                    </span>{note.subject}</h4>
                    <f:format.nl2br>{note.message}</f:format.nl2br>
                </div>
            </div>
        </f:for>
    </div>
</f:if>
</html>
