<div id="header-banner"
     i18n:domain="design.plone.theme"
     tal:condition="view/showLanguageSelector">
    <div class="header-banner-inner" tal:attributes="class string:header-banner-inner">
        <div class="header-banner-owner" tal:condition="python: view.header_link_label and view.header_link_url">
          <a href="${view/header_link_url}">${view/header_link_label}</a>
        </div>
        <div class="header-banner-language"
             tal:condition="view/available"
             tal:define="languages view/languages;
                         current python: [x for x in languages if x['selected']][0] or None">
           <div class="language-selector dropdown">
             <button id="language-selector-button" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
               <span tal:content="current/code">Current language</span>
               <i class="fas fa-chevron-down"></i>
             </button>
             <ul class="dropdown-menu" aria-labelledby="language-selector-button">
               <tal:language repeat="lang languages">
                   <li tal:define="code lang/code;
                                   selected lang/selected;
                                   codeclass string:language-${code};
                                   current python: selected and 'currentLanguage ' or '';"
                       tal:attributes="class string:${current}${codeclass}; selected selected">
                       <a href=""
                          tal:define="name lang/native|lang/name;
                                      code lang/code"
                          tal:attributes="href lang/url;
                                          title name"
                         ><span tal:content="name"></span
                       ></a>
                   </li>
               </tal:language>
             </ul>
          </div>
        </div>
        <div class="header-banner-second-link"
             tal:condition="python: view.header_second_link_label and view.header_second_link_url">
             <a href="${view/header_second_link_url}">${view/header_second_link_label}</a>
        </div>
        <div class="header-banner-login-button"
             tal:condition="view/login_button_visible"
             tal:define="isAnon context/@@plone_portal_state/anonymous">
          <a href="${context/portal_url}/login" tal:condition="isAnon">
            <span i18n:translate="login">Login</span>
          </a>
          <tal:logged tal:condition="not: isAnon">
            <a href="${context/portal_url}/@@personal-information"
               class="header-login-userinfo"
               tal:define="user_infos view/getUserInfos">
              <span>${user_infos/fullname}</span>
            </a>
            <a href="${context/portal_url}/logout"
               class="header-login-logout">
              <span i18n:translate="logout">Logout</span>
            </a>
          </tal:logged>
        </div>
    </div>
</div>
