{extends "index.tpl"}

{block css append}
   <link rel="stylesheet" href="/common/static/bootstrapvalidator/css/bootstrapValidator.min.css">
{/block}

{block content}
   {if $body.order}
      <h1>Stav objednávky</h1>
      <div class="show_order_status html-page">
         <p><strong>Číslo objednávky:</strong> {$body.order.id}<br>
            <strong>Stav objednávky:</strong> {$body.order.status_text} (co který stav znamená naleznete <a
                    href="/stav-vyrizeni-objednavky_p10.html">zde</a>)</p>
         <a href="{url s=orderStatus}" class="btn btn-gray">Zpět</a>
      </div>
   {else}
      <h1>Zjistit stav objednávky</h1>
      {include 'block.messages.tpl'}
      <form action="" method="POST" class="get_order_status p-t-1" role="form">

         <div class="row">
            <div class="col-xs-12 col-lg-4 col-xl-3">
               <div class="form-group required">
                  <label for="IDo">Číslo objednávky</label>
                  <input type="number" name="IDo" value="{$body.IDo}" id="IDo" class="form-control disable-spinner" data-bv-notempty="true">
               </div>
            </div>

            <div class="col-xs-12 col-xl-5 col-lg-6">
               {if findModule('recaptcha')}
                  <div class="form-group required">
                     <label>{t}Ověření{/t}</label>
                     {include "block.recaptcha.tpl"}
                  </div>
               {else}
                  <div class="form-group required">
                     <label for="captcha">Opište kód z obrázku</label>
                     <img alt="captcha" src="{url s=captcha id=$smarty.now}" class="img-responsive">
                     <input type="text" name="captcha" id="captcha" data-bv-notempty="true" data-bv-stringlength="true"
                            data-bv-stringlength-min="4" class="form-control" value="">
                     <input type="hidden" name="captcha_id" value="{$smarty.now}">
                  </div>
               {/if}
            </div>

            <div class="col-xs-12 col-xl-3 col-lg-2 p-t-2">
               <input type="submit" value="Zjistit stav" class="btn btn-primary">
            </div>
         </div>
      </form>
   {/if}
{/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}
{/block}

<script>
   {block onready append}

   $('form[role=form]').bootstrapValidator({
      feedbackIcons: {
         valid: 'fc fc-check',
         invalid: 'fc fc-remove',
         validating: 'fc fc-refresh'
      }
   });

   {/block}
</script>
