<div class="bigw-knowledge">
  <h2 class="title"><?= t('Wybierz kategorię'); ?></h2>
  <div class="bigw-knowledge expand-reality">
    <?php foreach ($categories as $tid => $category): ?>
      <div class="col-5 col-xs-12 col-sm-4 category-item-wrapper">
        <div class="category-item">
          <h3 class="category-title"><?= $category['name']; ?></h3>
          <img src="<?= image_style_url('contest', $category['image']); ?>" />
          <a class="btn btn-default" href="knowledge/<?= $tid; ?>"><?= t("Przeglądaj") ?></a>
        </div>
        <div class="leaders">
        <?php foreach ($category['leaders'] as $leader): ?>
          <div class="leader col-xs-12">
            <div class="result-img">
          <?php if (isset($leader['image'])): ?>
              <img src="<?= image_style_url('profile_image', $leader['image']); ?>" />
          <?php endif; ?>  
            </div>
            <div class="result-user">
              <?= $leader['name']; ?>
            </div>
            <div class="result-points">
              <?= $leader['points']; ?>
            </div>
          </div>
        <?php endforeach; ?>
        </div>
      </div>
    <?php endforeach; ?>
  </div>
</div>
