{block name='layout-header-shop-nav-account'}
    {$idPostFix=$idPostFix|default:''}
    {et_isShopVersionAtLeast value="5.2.0-beta" assign='shopIsAtLeast52'}
    {et_isShopVersionAtLeast value="5.5.0-rc.1" assign='shopIsAtLeast55'}
    <div class="nav-item dropdown account-icon-dropdown">
        {block name='layout-header-shop-nav-account-nav-link'}
            <a class="nav-link nav-link-custom"
                href="#"
                data-toggle="dropdown"
                aria-haspopup="true"
                aria-expanded="false"
                aria-controls="account-dropdown-menu"
                role="button"
                aria-label="{lang key='myAccount'}"
            >
                {block name="et-layout-header-shop-nav-account-user-icon"}
                    {* Note: You can use these blocks to show a different user icon for logged in users vs logged out users *}
                    {if JTL\Session\Frontend::getCustomer()->getID() === 0}
                        {block name="et-layout-header-shop-nav-account-user-icon-logged-out"}
                            <span class="{et_getIcon key='login'}"></span>
                        {/block}
                    {else}
                        {block name="et-layout-header-shop-nav-account-user-icon-logged-in"}
                            <span class="{et_getIcon key='login'}"></span>
                        {/block}
                    {/if}
                {/block}
            </a>
        {/block}

        {block name='layout-header-shop-nav-account-dropdown-menu'}
            <div class="dropdown-menu dropdown-menu-right" id="account-dropdown-menu">
                {if JTL\Session\Frontend::getCustomer()->getID() === 0}
                    {block name='layout-header-shop-nav-account-logged-out'}
                        <div class="dropdown-body lg-min-w-lg">
                            {form action="{get_static_route id='jtl.php' secure=true}" method="post" class="jtl-validate" slide=true}
                                {block name='layout-header-shop-nav-account-form-content'}
                                    <fieldset id="quick-login{$idPostFix}" class="quick_login quick-login"> {* quick_login is used for backwards compatibility *}
                                        {block name='header-shop-nav-account-quick-login'}
                                            {if $shopIsAtLeast55}
                                                <legend>
                                                    {lang key='loginForRegisteredCustomers' section='checkout'}
                                                </legend>
                                            {/if}
                                        {/block}
                                        {block name='layout-header-nav-account-form-email'}
                                            {formgroup label-for="email_quick{$idPostFix}" label={lang key='emailadress'}}
                                                <input type="email" name="email" id="email_quick{$idPostFix}" class="form-control form-control-sm"
                                                    required placeholder=" "
                                                    autocomplete="email" />
                                            {/formgroup}
                                        {/block}
                                        {block name='layout-header-nav-account-form-password'}
                                            {formgroup label-for="password_quick{$idPostFix}" label={lang key='password'} class="account-icon-dropdown-pass"}
                                                <input type="password" name="passwort" id="password_quick{$idPostFix}" class="form-control form-control-sm"
                                                    required placeholder=" "
                                                    autocomplete="current-password" />
                                            {/formgroup}
                                        {/block}
                                        {block name='layout-header-nav-account-form-captcha'}
                                            {if isset($showLoginCaptcha) && $showLoginCaptcha}
                                                {formgroup class="simple-captcha-wrapper"}
                                                    {captchaMarkup getBody=true}
                                                {/formgroup}
                                            {/if}
                                        {/block}
                                        {block name='layout-header-shop-nav-account-form-submit'}
                                            <input type="hidden" name="login" value="1" />
                                            {if !empty($oRedirect->cURL)}
                                                {foreach $oRedirect->oParameter_arr as $oParameter}
                                                    <input type="hidden" name="{$oParameter->Name}" value="{$oParameter->Wert}" />
                                                {/foreach}
                                                <input type="hidden" name="r" value="{$oRedirect->nRedirect}" />
                                                <input type="hidden" name="cURL" value="{$oRedirect->cURL}" />
                                            {/if}
                                            {include file="widgets/base/button.tpl" type="submit" variant="primary" classes="btn-sm btn-block" id="submit-btn{$idPostFix}" label="{lang key='login'}"}
                                        {/block}
                                    </fieldset>
                                {/block}
                            {/form}
                            {block name='layout-header-nav-account-link-forgot-password'}
                                <a href="{get_static_route id='pass.php'}" rel="nofollow">
                                    {lang key='forgotPassword'}
                                </a>
                            {/block}
                            {block name='layout-header-nav-amazonpay-login-placeholder'}
                                <div id="amapay-login-dropdown{$idPostFix}" class="amapay-login-dropdown"></div>
                            {/block}
                        </div>
                        {block name='layout-header-nav-account-link-register'}
                            <div class="dropdown-footer">
                                {lang key='newHere'}
                                <a href="{get_static_route id='registrieren.php'}" rel="nofollow">
                                    {lang key='registerNow'}
                                </a>
                            </div>
                        {/block}
                    {/block}
                {else}
                    {block name='layout-header-shop-nav-account-logged-in'}
                        {get_static_route id='jtl.php' secure=true assign='secureAccountURL'}
                        <a target="_self" class="dropdown-item" href="{$secureAccountURL}" rel="nofollow">
                            {lang key='myAccount'}
                        </a>
                        <a target="_self" class="dropdown-item" href="{$secureAccountURL}?bestellungen=1" rel="nofollow">
                            {lang key='myOrders'}
                        </a>
                        <a target="_self" class="dropdown-item" href="{$secureAccountURL}?editRechnungsadresse=1" rel="nofollow">
                            {lang key='myPersonalData'}
                        </a>
                        {if $shopIsAtLeast52}
                            <a target="_self" class="dropdown-item" href="{$secureAccountURL}?editLieferadresse=1" rel="nofollow">
                                {lang key='myShippingAddresses'}
                            </a>
                        {/if}
                        {if $shopIsAtLeast55 && $Einstellungen.global.global_rma_enabled === 'Y'}
                            <a target="_self" class="dropdown-item" href="{$secureAccountURL}?returns=1" rel="nofollow">
                                {lang key='myReturns' section='rma'}
                            </a>
                        {/if}
                        {if $Einstellungen.global.global_wunschliste_anzeigen === 'Y'}
                            <a target="_self" class="dropdown-item" href="{$secureAccountURL}#my-wishlists" rel="nofollow">
                                {lang key='myWishlists'}
                            </a>
                        {/if}
                        {if $Einstellungen.vergleichsliste.vergleichsliste_anzeigen === 'Y'}
                            <a target="_self" class="dropdown-item" href="{get_static_route id='vergleichsliste.php'}">
                                {lang key='myCompareList'}
                            </a>
                        {/if}
                        <div role="separator" class="dropdown-divider"></div>
                        <a target="_self" href="{$secureAccountURL}?logout=1" rel="nofollow" class="dropdown-item account-icon-dropdown-logout">
                            {lang key='logOut'}
                        </a>
                    {/block}
                {/if}
            </div>
        {/block}
    </div>
{/block}
