{extends "reclamations/reclamations-new.tpl"}

{block content}
   <div class="descr">
      {insert_page type="RECLAMATION_SUMMARY" use_default=1}
   </div>
   <form name="summary-form" class="row flex-row" method="post" data-summary-form>
      {if $body.order}
      {$readonly = false}
      {$deliveryType = $body.order->getDeliveryType()}
      <div class="col-md-7 col-xxs-12">
         <fieldset>
            <div class="box-returns-summary">

               <p class="title-default">{t}Pokud vám budeme něco posílat...{/t}</p>
               <p>{t escape=false}
                     <strong>... máme uloženou tuto adresu.</strong>
                     Případný balíček vám pošleme stejným způsobem
                     jako původní objednávku. Potřebujete změnit způsob dopravy? Napište nám do poznámky.{/t}</p>
               <p><strong>{t}Doručovací adresa{/t}</strong></p>
               <div class="row">
                  <div class="col-sm-6 col-xs-12">
                     <div class="form-group required">
                        <label for="name">{t}Jméno{/t}</label>
                        <input type="text" name="delivery[name]" id="name" class="form-control" value="{$body.order.delivery_name}"
                               data-bv-notempty="true" data-bv-stringlength="true" data-bv-stringlength-min="2">
                     </div>
                  </div>
                  <div class="col-sm-6 col-xs-12">
                     <div class="form-group required">
                        <label for="surname">{t}Příjmení{/t}</label>
                        <input type="text" name="delivery[surname]" id="surname" class="form-control"
                               value="{$body.order.delivery_surname}"
                               data-bv-notempty="true" data-bv-stringlength="true" data-bv-stringlength-min="2">
                     </div>
                  </div>
               </div>
               <div class="row">
                  <div class="col-sm-6 col-xs-12">
                     <div class="form-group required">
                        <label for="street">{t}Ulice{/t}</label>
                        <input type="text" name="delivery[street]" id="street" class="form-control" value="{$body.order.delivery_street}"
                               data-bv-notempty="true" data-bv-regexp="true" {if !$readonly}pattern=".*\S+\s+[0-9]+.*"{/if}
                               data-bv-regexp-message="{t}Doplňte prosím číslo popisné{/t}"
                               {if $readonly}disabled{/if}
                        >
                     </div>
                  </div>
                  <div class="col-sm-6 col-xs-12">
                     <div class="form-group required">
                        <label for="city">{t}Město{/t}</label>
                        <input type="text" name="delivery[city]" id="city" class="form-control" value="{$body.order.delivery_city}"
                               data-bv-notempty="true" data-bv-stringlength="true" data-bv-stringlength-min="2"
                               {if $readonly}disabled{/if}
                        >
                     </div>
                  </div>
               </div>
               <div class="row">
                  <div class="col-sm-6 col-xs-12">
                     <div class="form-group required">
                        <label for="phone">{t}Telefon{/t}</label>
                        <input type="text" name="delivery[phone]" id="phone" class="form-control" value="{$body.order.invoice_phone}"
                               data-bv-notempty="true" data-bv-phone="true" data-bv-phone-country="delivery[country]">
                     </div>
                  </div>
                  <div class="col-sm-6 col-xs-12">
                     <div class="form-group required">
                        <label for="zip">{t}PSČ{/t}</label>
                        <input type="text" name="delivery[zip]" id="zip" class="form-control" value="{$body.order.delivery_zip}"
                               data-bv-notempty="true" data-bv-zipcode="true" data-bv-zipcode-country="delivery[country]"
                               {if $readonly}disabled{/if}
                        >
                     </div>
                  </div>
               </div>
               {block "delivery_country"}
                  {get_contexts country=true assign='contexts'}
                  <div class="row">
                     <div class="col-sm-6 col-xs-12">
                        <div class="form-group required">
                           <label for="country">{t}Stát{/t}</label>
                           <select class="form-control custom-select c-select" id="country" name="delivery[country]" {if $readonly}disabled{/if}>
                              {$selected = $body.order.delivery_country|default:$active.id}
                              {foreach $contexts.country->getAll() as $id => $country}
                                 <option value="{$id}" {if $selected == $id}selected{/if}>{$country->getName()}</option>
                              {/foreach}
                           </select>
                        </div>
                     </div>
                  </div>
               {/block}
               <br>
               <p><strong>{t}Způsob dopravy{/t}</strong></p>
               <p>{$deliveryType.delivery}</p>
            </div>
         </fieldset>
         {/if}
         <div class="box-returns-summary">
            <div class="form-group">
               <label for="preferred_handle_type" class="title-default">{t}Jaké řešení reklamace preferujete?{/t}</label>
               <select class="form-control custom-select c-select" id="preferred_handle_type" name="preferred_handle_type">
                  {html_options options=$body.preferred_handle_types}
               </select>
            </div>
            <br>
            <div class="form-group">
               <label for="bank_account" class="title-default">{t}Na jaký účet Vám můžeme případně vrátit platbu?{/t}</label>
               <input type="text" name="bank_account" id="bank_account" class="form-control" data-bv-bankaccount="true"
                      data-bv-notempty="false">
               <span data-bank-account="error" style="color: #ea0f33; display: none;">{t}Zadejte platné číslo bankovního účtu{/t}</span>
            </div>
         </div>

         <div class="box-returns-summary">
            <div class="form-group required">
               <label for="note" class="title-default">{t}Důvod reklamace a poznámky{/t}</label>
               <p>{t}Popište, prosím, jaký se objevil problém. Pokud je lépe patrný na fotografiích,
                     využijte možnosti nahrát obrázky níže. Klidně jej na fotkách označte.{/t}</p>
               <textarea required class="form-control" name="note" id="note" rows="5"
                         data-bv-notempty="true"></textarea>
            </div>
            <br>
            <div class="form-group">
               <label for="note" class="title-default">{t}Přílohy k reklamaci{/t}</label>
               {include "block.fileUploader.tpl" pageType='reclamation'}
            </div>
         </div>
      </div>

      <div class="col-md-5 col-xxs-12">
         <div class="sticky-wrapper">
            {include "reclamations/block.reclamations-pricebox.tpl"}
         </div>
      </div>
   </form>
{/block}

{block "js-dynamic-load" append}
   <script src="/admin/static/fineuploader/jquery.fine-uploader.min.js"></script>
{/block}




