{extends "index.tpl"}

{block "css-entry" append}
   {encore_entry_link_tags entry='user'}
{/block}

{block "js-entry" append}
   {encore_entry_script_tags entry='user'}
{/block}

{block "js-dynamic-load" append}
   {asset_compile}
      <script src="/common/static/bootstrapvalidator/js/bootstrapValidator.js"></script>
      <script src="/common/static/bootstrapvalidator/js/language/{$ctrl.active_language_code}.js"></script>
   {/asset_compile}

   {if findModule('recaptcha','registration') and findModule('recaptcha','site_invisible') and $body.newUser}
      {include "block.recaptcha.invisible.tpl"}
      {captchaScript}
   {/if}
{/block}

{block "meta-robots"}
    <meta name="robots" content="noindex, nofollow">
{/block}

{block "main-class"}page-user page-user-new{/block}

{block "content"}
    <div class="col-xl-6 col-xl-offset-3 col-md-8 col-md-offset-2 col-xxs-12">
      <p class="h3">{t}Registrace na prodejně{/t}</p>
      {if $smarty.get.success}
         <div>
            <div class="messages">
               <div class="alert alert-success" role="alert">{t}Uživatel byl úspěšně zaregistrován.{/t}</div>
            </div>

            {if $smarty.get.cardNumber}
               <div style="margin-bottom: 15px">
                  <p><strong>Číslo zákaznické karty</strong>: <input type="text" style="background: none; border: none; width: fit-content" disabled data-copy-input value="{$smarty.get.cardNumber}">
                     <a href="#" data-copy data-success="{t}Zkopírováno!{/t}" rel="noreferrer noopener">{t}Zkopírovat kód{/t}</a>
                  </p>
                  {insert_barcode type='C128' code=$smarty.get.cardNumber height=75}
               </div>

               {if $smarty.get.userId}
                  <a href="{path('external_hannah_oc_usercardpdf', ['userId' => $smarty.get.userId])}" class="btn btn-block btn-secondary" target="_blank">Zobrazit kartu v PDF</a>
               {/if}
            {/if}

            <a href="{path('external_hannah_oc_sellerregistration', ['token' => $body.token, 'sellerId' => $body.sellerId])}" class="btn btn-block btn-primary">Registrovat dalšího zákazníka</a>
         </div>
      {else}
         {include "seller/seller.registration.form.tpl"}
      {/if}
    </div>
{/block}
