<html
    xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
    xmlns:belog="http://typo3.org/ns/TYPO3/CMS/Belog/ViewHelpers"
    data-namespace-typo3-fluid="true">

<f:form object="{constraint}" action="list" name="constraint">
    <div class="form-row">

        <div class="form-group">
            <label for="belog-users" class="form-label"><f:translate key="users" /></label>
            <f:form.select
                property="userOrGroup"
                class="form-select"
                id="belog-users"
            >
                <f:form.select.option value="0">{f:translate(key:'allUsers')}</f:form.select.option>
                <f:form.select.option value="-1">{f:translate(key:'self')}</f:form.select.option>
                <f:form.select.optgroup label="{f:translate(key:'group')}">
                    <f:for each="{userGroups.groups}" as="label" key="key">
                        <f:form.select.option value="{key}">{label}</f:form.select.option>
                    </f:for>
                </f:form.select.optgroup>
                <f:form.select.optgroup label="{f:translate(key:'user')}">
                    <f:for each="{userGroups.users}" as="label" key="key">
                        <f:form.select.option value="{key}">{label}</f:form.select.option>
                    </f:for>
                </f:form.select.optgroup>
            </f:form.select>
        </div>

        <div class="form-group">
            <label for="belog-max" class="form-label"><f:translate key="max" /></label>
            <f:form.select
                property="number"
                options="{selectableNumberOfLogEntries}"
                class="form-select"
                id="belog-max"
            />
        </div>

        <f:if condition="{showWorkspaceSelector}">
            <div class="form-group">
                <label for="belog-workspaces" class="form-label"><f:translate key="workspace" /></label>
                <f:form.select
                    property="workspaceUid"
                    options="{workspaces}"
                    class="form-select"
                    id="belog-workspaces"
                />
            </div>
        </f:if>

        <div class="form-group">
            <label for="belog-pageId" class="form-label"><f:translate key="chLog_menuPageId" /></label>
            <div class="input-group">
                <f:form.textfield
                    type="number"
                    property="pageId"
                    value="{pageId}"
                    id="belog-pageId"
                    class="form-control"
                />
                <button
                    class="btn btn-default t3js-element-browser"
                    data-target="{f:be.uri(route: 'wizard_element_browser')}"
                    data-trigger-for="belog-pageId"
                    data-mode="db"
                    title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.browse_db')}"
                >
                    <core:icon identifier="actions-insert-record" />
                </button>
            </div>
        </div>

        <f:if condition="{pageId}">
            <div class="form-group">
                <label for="belog-depth" class="form-label"><f:translate key="chLog_menuDepth" /></label>
                <f:form.select
                    property="depth"
                    options="{pageDepths}"
                    class="form-select"
                    id="belog-depth"
                />
            </div>
        </f:if>

        <div class="form-group">
            <label for="belog-channel" class="form-label"><f:translate key="channel" /></label>
            <f:form.select
                property="channel"
                options="{channels}"
                prependOptionLabel="{f:translate(key='all')}"
                prependOptionValue=""
                class="form-select"
                id="belog-channel"
                value="{channel}"
            />
        </div>

        <div class="form-group">
            <label for="belog-level" class="form-label"><f:translate key="levels" /></label>
            <f:form.select
                property="level"
                options="{levels}"
                prependOptionLabel="{f:translate(key='all')}"
                prependOptionValue=""
                class="form-select"
                id="belog-level"
                value="{level}"
            />
        </div>

        <div class="form-group">
            <label for="manualDateStart" class="form-label"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:from" /></label>
            <div class="input-group">
                <f:form.textfield
                    property="manualDateStart"
                    value="{f:if(condition: constraint.manualDateStart, then: \"{f:format.date(format:'Y-m-d\TH:i:s\Z', date: '{constraint.manualDateStart}')}\")}"
                    id="manualDateStart"
                    additionalAttributes="{'autocomplete': 'off'}"
                    class="form-control form-control-clearable t3js-datetimepicker"
                    data="{date-type: 'datetime'}"
                />
                <label class="btn btn-default" for="manualDateStart">
                    <core:icon identifier="actions-calendar" />
                </label>
            </div>
        </div>

        <div class="form-group">
            <label for="manualDateStop" class="form-label"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:to" /></label>
            <div class="input-group">
                <f:form.textfield
                    property="manualDateStop"
                    value="{f:format.date(format:'Y-m-d\TH:i:s\Z', date: '{constraint.manualDateStop}')}"
                    additionalAttributes="{'autocomplete': 'off'}"
                    id="manualDateStop"
                    class="form-control form-control-clearable t3js-datetimepicker"
                    data="{date-type: 'datetime'}"
                />
                <label class="btn btn-default" for="manualDateStop">
                    <core:icon identifier="actions-calendar" />
                </label>
            </div>
        </div>

        <div class="form-group align-self-end">
            <f:form.button type="submit" name="operation" value="filter" class="btn btn-default">{f:translate(key: 'set')}</f:form.button>
            <f:form.button type="submit" name="operation" value="reset-filters" class="btn btn-link">{f:translate(key: 'reset')}</f:form.button>
        </div>
    </div>
</f:form>

</html>
