{ifmodule USER_OAUTH}
<div class="oauth-box">
   {if $ctrl.logged}
      {get_logged_user_provider_ids assign='userProviderIDs'}

      {foreach $userProviderIDs as $providerIDRow}
         {if $providerIDRow.provider == "facebook"}
            {$fbRemove = $providerIDRow}
         {elseif $providerIDRow.provider == "google"}
            {$googleRemove = $providerIDRow}
         {/if}
      {/foreach}
   {/if}

   {block "oauth-text"}
      <p class="h3">{t}Rychlá registrace pomocí sociálních sítí{/t}</p>
   {/block}

   <div class="oauth-buttons">
      {if $dbcfg.oauth.facebook.client_id}
         {if $fbRemove}
            <a href="/login-unbind/{$fbRemove.id}" class="btn btn-fb btn-block active"><span class="icon"></span>
               <span class="text">{t}Odpojit{/t} <small>{$fbRemove.email}</small></span>
            </a>
         {else}
            <a href="/login-bind/facebook" class="btn btn-fb btn-block"><span class="icon"></span><span class="text">Facebook</span></a>
         {/if}
      {/if}
      {if $dbcfg.oauth.google.client_id}
         {if $googleRemove}
            <a href="/login-unbind/{$googleRemove.id}" class="btn btn-gp btn-block active"><span class="icon"></span>
               <span class="text"> {t}Odpojit{/t} <small>{$googleRemove.email}</small></span>
            </a>
         {else}
            <a href="/login-bind/google" class="btn btn-gp btn-block"><span class="icon"></span><span class="text">Google</span></a>
         {/if}
      {/if}
   </div>
</div>
{/ifmodule}
