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

<f:flashMessages/>
<f:if condition="{cookieWarning}">
    <div class="alert alert-info" role="alert">
        <f:render partial="CookieWarning" />
    </div>
</f:if>

<f:if condition="{messageKey}">
    <div class="alert alert-{messageKey}" role="alert">
        <h3><f:render partial="RenderLabelOrMessage" arguments="{key: '{messageKey}_header'}"/></h3>
        <p><f:render partial="RenderLabelOrMessage" arguments="{key: '{messageKey}_message'}"/></p>
    </div>
</f:if>
<f:if condition="{onSubmit}">
    <f:then>
        <f:form target="_top" fieldNamePrefix="" action="login" onsubmit="{onSubmit}">
            <f:render section="content" arguments="{_all}"/>
        </f:form>
    </f:then>
    <f:else>
        <f:form target="_top" fieldNamePrefix="" action="login">
            <f:render section="content" arguments="{_all}"/>
        </f:form>
    </f:else>
</f:if>

<f:if condition="{settings.showForgotPassword}">
    <f:link.action action="recovery" controller="PasswordRecovery">
        <f:render partial="RenderLabelOrMessage" arguments="{key: 'forgot_header'}"/>
    </f:link.action>
</f:if>

<f:section name="content">
    <fieldset>
        <legend>
            <f:translate key="login"/>
        </legend>
        <div class="form-group">
            <label class="sr-only" for="user"><f:translate key="username"/></label>
            <f:form.textfield name="user" id="user" placeholder="{f:translate(key: 'username')}" class="form-control"/>
        </div>
        <div class="form-group">
            <label class="sr-only" for="pass"><f:translate key="password"/></label>
            <f:form.password name="pass" id="pass" placeholder="{f:translate(key: 'password')}" data="{rsa-encryption: ''}" class="form-control"/>
        </div>

        <f:if condition="{permaloginStatus} > -1">
            <div class="form-group">
                <label for="permalogin"><f:translate id="permalogin"/></label>
                <f:if condition="{permaloginStatus} == 1">
                    <f:then>
                        <f:form.hidden name="permalogin" value="0" additionalAttributes="{disabled: 'disabled'}"/>
                        <f:form.checkbox name="permalogin" id="permalogin" value="1" checked="checked"/>
                    </f:then>
                    <f:else>
                        <f:form.hidden name="permalogin" value="0"/>
                        <f:form.checkbox name="permalogin" id="permalogin" value="1"/>
                    </f:else>
                </f:if>
            </div>
        </f:if>

        <div class="form-group">
            <f:form.submit value="{f:translate(key: 'login')}" name="submit" class="btn btn-default" />
        </div>

        <div class="felogin-hidden">
            <f:form.hidden name="logintype" value="login"/>
            <f:form.hidden name="pid" value="{storagePid}"/>
            <f:if condition="{redirectURL}!=''">
                <f:form.hidden name="redirect_url" value="{redirectURL}" />
            </f:if>
            <f:if condition="{referer}!=''">
                <f:form.hidden name="referer" value="{referer}" />
            </f:if>
            <f:if condition="{redirectReferrer}!=''">
                <f:form.hidden name="redirectReferrer" value="off" />
            </f:if>
            <f:if condition="{noRedirect}!=''">
                <f:form.hidden name="noredirect" value="1" />
            </f:if>

            {extraHidden}
        </div>
    </fieldset>
</f:section>
</html>
