<h1 class="title"><?= __('Ranking') ?> <?= $ranking['name'] ?></h1>

<ul class="breadcrumber">
    <li><a href="<?= url_to('/') ?>" data-ajax><?= __('Home') ?></a></li>
    <li><a href="<?= url_to('/rankings') ?>" data-ajax><?= __('Rankings') ?></a></li>
    <li class="active"><?= $ranking['name'] ?></li>
</ul>

<?= partial('rankings', ['current' => $ranking]) ?>

<hr />

<div class="rankings">
    <?php foreach ($data as $guild): ?>
        <div class="guild rank-<?= $guild['rownum'] ?>">
            <?= util('Ranking')->position($guild['rank']) ?>
            <?php if ($guild['rownum'] > 3): ?>
                <div class="rank"><?= $guild['rownum'] ?>&deg;</div>
            <?php else: ?>
                <div class="rank-trophy"></div>
            <?php endif ?>

            <div class="image">
                <?php ($guild['mark']) ?>
                <?= util('Guild')->logo($guild['mark']) ?>
            </div>
            <div class="desc">
                <div class="name"><?= plugin_active('Profile') ? '<a data-ajax href="' . url_to('/profile/guild/' . $guild['name']) . '">' . $guild['name'] . '</a>' : $guild['name'] ?></div>
                <div class="class"><?= plugin_active('Profile') ? '<a data-ajax href="' . url_to('/profile/character/' . $guild['master']) . '">' . $guild['master'] . '</a>' : $guild['master'] ?></div>
                <div class="level"><?= $guild['score'] ?></div>
                <div class="resets"><?= __('Members') ?>: <?= $guild['members'] ?></div>
            </div>
        </div>
    <?php endforeach ?>
</div>