<h1 class="title"><?= __('Top Players') ?></h1>

<div class="top-players">
    <?php foreach ($rankings as $ranking): ?>
        <?php foreach ($ranking['data'] as $type => $data): ?>
            <div class="top-player">
                <div class="type"><?= $ranking['name'] ?> <?= __(ucfirst($type)) ?></div>
                <?php if (!empty($data)): ?>
                    <div class="name">
                        <?php if (plugin_active('Profile')): ?>
                            <a data-ajax href="<?= url_to('/profile/' . ($ranking['is_guild'] ? 'guild' : 'character') . '/' . $data[0]['name']) ?>"><?= $data[0]['name'] ?></a>
                        <?php else: ?>
                            <?= $data[0]['name'] ?>
                        <?php endif ?>
                    </div>

                    <div class="image">
                        <?php if ($ranking['is_guild']): ?>
                            <?= util('Guild')->logo($data[0]['mark'], 74) ?>
                        <?php else: ?>
                            <img src="<?= util('Character')->avatar($data[0]['avatar']) ?>" width="60" height="76" />
                        <?php endif ?>
                    </div>

                    <div class="score"><?= __('Score') ?>: <?= $data[0]['score'] ?></div>
                <?php endif ?>
            </div>
        <?php endforeach ?>
    <?php endforeach ?>
</div>
