{extends "index.tpl"}

{block content}
   <div class="page-reset {if $body.act=="passw"}page-reset-old{else}page-reset-new{/if}">
      {if $body.act == "passw"}
         <h1>{t}Zapomněl jsem heslo{/t}</h1>
         {include "block.messages.tpl"}
         {block "textcontent-request"}
            <p>{t}Pokud již máte vytvořený účet, ale zapomněli jste své heslo, zadejte svou e-mailovou adresu, kterou jste uvedli při registraci.{/t}
               <br>
               {t}Zašleme Vám na ni e-mail s odkazem pro nastavení nového hesla.{/t}</p>
         {/block}
         <form name="passw" method="post" action="{url s="login.reset" act=passw}" class="form-inline" role="form">
            <label for="email" class="form-control-label">{t}Váš e-mail{/t}</label>
            <div class="form-group">
               <input type="email" name="email" value="{$body.inputEmail}" maxlength="70" class="form-control"
                      data-bv-notempty="true" id="email">
            </div>
            <input type="hidden" name="emailSubmit" value="1">
            <input class="btn btn-primary m-l-1" type="submit" value="{t}Odeslat{/t}">
         </form>
      {elseif $body.act == "get_new"}
         <h1>{t}Nastavení nového hesla{/t}</h1>
         {include "block.messages.tpl"}
         {block "textcontent-confirm"}
            <p>{t}Vložte své nové heslo.{/t}</p>
         {/block}
         <form name="get_new" method="post"
               action="{url s="login.reset" generatePassword=1 id=$smarty.get.id request=$smarty.get.request}"
               role="form">
            <label for="password" class="form-control-label">{t}Heslo{/t}</label>
            <div class="form-group">
               <input type="password" name="password" id="password" class="form-control" value=""
                      data-bv-notempty="true" data-bv-stringlength="true" data-bv-stringlength-min="6">
            </div>
            <label for="passwordAgain" class="form-control-label">{t}Heslo znovu{/t}</label>
            <div class="form-group">
               <input type="password" name="passwordAgain" id="passwordAgain" class="form-control" value=""
                      data-bv-notempty="true" data-bv-stringlength="true"
                      data-bv-identical="true" data-bv-identical-message="{t}Hesla se neshodují{/t}"
                      data-bv-identical-field="password">
            </div>
            <input class="btn btn-primary" type="submit" name="passSubmit" value="{t}Nastavit heslo{/t}">
         </form>
      {/if}
   </div>
{/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>
