<div class="wpj-panel-heading">
   <div class="list-filters-wrapper">
       <div class="list-filters-left">
           {if isset($filtersStorage)}
              <label class="small text-muted">Filtry</label>
           {/if}

          <div class="d-flex flex-wrap">
              {if isset($filtersStorage)}
                  {if $filtersStorage.storage|count}
                      {$activeFilter = $smarty.get.adminFilter}
                      {foreach $filtersStorage.storage as $adminfilter}
                          {if empty($adminfilter.name)}
                              {continue}
                          {/if}
                         <div class="filter-item">
                            <a target="mainFrame" href="launch.php?s=list.php&type={$adminfilter.type}&adminFilter={$adminfilter.id}"
                               class="btn btn-xs btn-custom"
                               style="background-color: {$adminfilter.color}; {if $activeFilter == $adminfilter.id}border-color: #000;{else}border-color: {$adminfilter.color};{/if}"
                               title="{$adminfilter.description}">{$adminfilter.name}
                            </a>
                         </div>
                          {if $activeFilter == $adminfilter.id}{$activeFilterName = $adminfilter.name}{/if}
                      {/foreach}
                  {/if}

                  <div class="d-flex justify-content-start">
                      {block "list-filter-item"}
                          {if !$smarty.get.window}
                             <div class="filter-item">
                                <div class="dropdown">
                                   <a class="btn btn-xs btn-ghost dropdown-toggle" data-toggle="dropdown">
                                      <span class="bi bi-plus-lg m-r-1"></span>{'addFilterTip'|translate:'filters'}
                                   </a>
                                   <ul class="dropdown-menu">
                                      <li class="disabled"><a>{'editFilterTip'|translate:'filters'}:</a></li>
                                       {foreach $filtersStorage.storage as $adminfilter}
                                           {if empty($adminfilter.name)}
                                               {continue}
                                           {/if}
                                          <li>
                                             <a href="javascript:nw('addFilter','{$adminfilter.id}','{$filtersStorage.listName}','{$param2}')"
                                                title="{$adminfilter.description}">
                                                 {if $activeFilter == $adminfilter.id}<b>{$adminfilter.name}</b>{else}{$adminfilter.name}{/if}
                                             </a>
                                          </li>
                                       {/foreach}
                                      <li style="border-top: 1px solid #ddd;">
                                         <a href="javascript:nw('addFilter','','{$filtersStorage.listName}','{$param2}')">
                                            <span class="bi bi-plus-lg m-r-1"></span>{'saveAsNewTip'|translate:'filters'}
                                         </a>
                                      </li>
                                   </ul>
                                </div>
                             </div>
                             <div class="filter-item">
                                <a href="javascript:nw('filtersList','','{$filtersStorage.listName}')"
                                   class="btn btn-xs btn-ghost btn-block" title="{'filtersListTip'|translate:'filters'}">
                                   <span class="bi bi-funnel-fill m-r-1"></span>{'filtersList'|translate:'filters'}
                                </a>
                             </div>
                          {/if}
                      {/block}
                  </div>
              {/if}

              {block addFilter}{/block}
          </div>
       </div>

      <div class="list-filters-right">
         {block "list-filter-pager"}
             {if $pager}
                <div class="filter-item">
                   <span class="small text-muted">
                       {if $pager.isInfinite}
                           {$pageDiff = $pager.onPage - $pageCount}
                          Zobrazeno {($pager->from() + 1)}–{(($pager->to() + 1) - $pageDiff)} z {if $pager.number == 1 && $pageCount < $pager.onPage}{$pageCount|number_format:0:".":" "}{else}<a href="{$pager->getUrl(["loadTotalCount" => 1])}">mnoha</a>{/if}
                       {else}
                          Zobrazeno {if $pager.total}{($pager->from() + 1)}{else}0{/if}–{min($pager->to() + 1, $pager.total)} z {$pager.total|number_format:0:".":" "}
                       {/if}
                   </span>
                </div>
             {/if}
         {/block}

         {block "list-filter-columns-settings"}
            {if !$productsMassModification}
               <div class="filter-item">
                  {if $activeFilter}
                     <button title="Upravit aktuální filtr [{$activeFilterName}]" onclick="nw('filters', '{$activeFilter}')"
                             class="btn btn-ghost btn-xs"><span class="bi bi-arrows-move m-r-1"></span>{'editFilter'|translate:'filters'}
                     </button>
                  {else}
                     <button title="Upravit výchozí zobrazení sloupců" onclick="nw('ListColumns', '', 'acn=add&pg={$smarty.get.type}')"
                             class="btn btn-ghost btn-xs"><span class="bi bi-arrows-move m-r-1"></span>{'editListColumns'|translate:'filters'}
                     </button>
                  {/if}
               </div>
            {/if}
         {/block}
      </div>
   </div>
</div>
