<h1 class="title"><?= __('character') ?> <?= $character->getName() ?></h1>

<ul class="breadcrumber">
    <li><a href="<?= url_to('/') ?>" data-ajax><?= __('Home') ?></a></li>
    <li class="active"><?= __('Character profile') ?></li>
</ul>

<div class="box-panel">
    <div class="box-panel-title"><?= __('Information') ?></div>
    <div class="box-panel-content">
        <table class="list">
            <tr>
                <td valign="top" rowspan="7" width="80">
                    <img src="<?= $character->getAvatarUrl(asset_to('/images/no-avatar.png')) ?>" width="80" height="90" />
                </td>
                <td width="100"><?= __('Character') ?></td>
                <td><?= $character->getName() ?></td>
            </tr>
            <tr>
                <td><?= __('Class') ?></td>
                <td><?= util('Character')->className($character->getClass()) ?></td>
            </tr>
            <?php if (config('columns.resets')): ?>
                <tr>
                    <td><?= __('Resets') ?></td>
                    <td><?= $character->getResets() ?></td>
                </tr>
            <?php endif ?>
            <tr>
                <td><?= __('Level') ?></td>
                <td><?= $character->getLevel() ?></td>
            </tr>
            <tr>
                <td><?= __('Map') ?></td>
                <td><?= util('Character')->mapName($character->getMap()) ?>
                    <?php if ($character->getCode() == 0): ?>
                        (<?= $character->getPositionX() ?>/<?= $character->getPositionY() ?>)
                    <?php endif ?>
                </td>
            </tr>
            <tr>
                <td><?= __('Status') ?></td>
                <td><?= util('Character')->status($character->isConnected()) ?></td>
            </tr>
        </table>
    </div>
</div>

<?php if ($character->getGuild() != null): ?>
    <div class="box-panel" style="margin-top:10px">
        <div class="box-panel-title"><?= __('guild') ?></div>
        <div class="box-panel-content">
            <table class="list">
                <tr>
                    <td valign="top" rowspan="7" width="80">
                        <?= util('Guild')->logo($character->getGuild()->getMark(), 80) ?>
                    </td>
                    <td width="100"><?= __('Guild') ?></td>
                    <td><a data-ajax href="<?= url_to('/profile/guild/' . $character->getGuild()->getName()) ?>"><?= $character->getGuild()->getName() ?></a></td>
                </tr>
                <tr>
                    <td><?= __('Master') ?></td>
                    <td><a data-ajax href="<?= url_to('/profile/character/' . $character->getGuild()->getMaster()->getName()) ?>"><?= $character->getGuild()->getMaster()->getName() ?></a></td>
                </tr>
                <tr>
                    <td><?= __('Score') ?></td>
                    <td><?= $character->getGuild()->getScore() ?></td>
                </tr>
                <tr>
                    <td><?= __('Members') ?></td>
                    <td><?= count($character->getGuild()->getMembers()) ?></td>
                </tr>
            </table>
        </div>
    </div>
<?php endif ?>

<?php if (config('profile.show_equipments')): ?>
    <div class="box-panel" style="margin-top:10px">
        <div class="box-panel-title"><?= __('Equipments') ?></div>
        <div class="box-panel-content equipments">
            <div class="mapping">
                <img src="<?= resource_to('/images/inventories/' . strtolower(util('Character')->classShortName($character->getClass())) . '.png') ?>" />
                <?php for ($i = 0; $i < 12; $i++): ?>
                    <div class="item-mapping item<?= $i ?>">
                        <?php $it = $character->getInventory()->getEquipment($i) ?>
                        <?php if ($it !== null): ?>
                            <?php $image = util('Item')->getImage($it) ?>
                             <?php if ($image !== null): ?>
                                <img data-tooltip data-tooltip-url="<?= tooltip_url($it->getHex()) ?>" src="<?= $image ?>" />
                            <?php endif ?>
                        <?php endif ?>
                    </div>
                <?php endfor ?>
            </div>
        </div>
    </div>
<?php endif ?>

<?= notify('profile.character', $character) ?>

