<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') ?>

<hr />

<div class="align-center">
    <a data-ajax class="btn-secondary" href="<?= url_to('/rankings/gens') ?>"><?= __('Duprian') ?></a>
    <a data-ajax class="btn-secondary" href="<?= url_to('/rankings/gens:vanert') ?>"><?= __('Vanert') ?></a>
</div>
<br />

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

            <div class="image">
                <img src="<?= util('Avatar.Avatar')->url($gen['avatar']) ?>" width="60" height="76" />
                <div class="gen"><img src="<?= resource_to('/images/gens/' . strtolower(util('Gens')->familyName($gen['family'])) . '/' . (isset($gen['graduation']) ? $gen['graduation'] : util('Gens')->getGraduationFromContribution($gen['contribution'], $gen['rank'])) . '.png') ?>" width="25" /></div>
            </div>
            <div class="desc">
                <div class="name">
                    <?= plugin_active('Profile') ? '<a data-ajax href="' . url_to('/profile/character/' . $gen['name']) . '">' . $gen['name'] . '</a>' : $gen['name'] ?>
                    <?php if (config('register.countries_flag_column', null)): ?>
                        <img title="<?= country_name($gen['country']) ?>" src="<?= resource_to('/images/flags/' . strtolower($gen['country']) . '.gif') ?>" height="10" />
                    <?php endif ?>

                    <?php if (plugin_active('Patents')): ?>
                        <?php if (empty($gen['patentImage'])): ?>
                            <sup style="color:#5ab5ce"><?= $gen['patentTitle'] ?></sup>
                        <?php else: ?>
                            <sup style="color:#5ab5ce"><img data-toggle="tooltip" title="<?= $gen['patentTitle'] ?>" src="<?= upload_to('/patents/' . $gen['patentImage']) ?>" height="20" /></sup>
                        <?php endif ?>
                    <?php endif ?>
                </div>
                <div class="class"><?= util('Gens')->graduationName(isset($gen['graduation']) ? $gen['graduation'] : util('Gens')->getGraduationFromContribution($gen['contribution'], $gen['rank'])) ?></div>
                <div class="level"><?= $gen['contribution'] ?></div>
                <div class="status"><?= __('Status') ?>: <?= strtolower(util('Character')->status($gen['status'])) ?></div>
                <div class="guild-name">
                    <?= __('Guild') ?>:
                    <?php if ($gen['guild']): ?>
                        <?= plugin_active('Profile') ? '<a data-ajax href="' . url_to('/profile/guild/' . $gen['guild']) . '">' . $gen['guild'] . '</a>' : $gen['guild'] ?>
                    <?php else: ?>
                        -
                    <?php endif ?>
                </div>
            </div>
        </div>
    <?php endforeach ?>
</div>