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

<ul class="breadcrumber">
    <li><a href="<?= url_to('/') ?>" data-ajax><?= __('Home') ?></a></li>
    <li class="active"><?= __('Guild 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">
                    <?= util('Guild')->logo($guild->getMark(), 80) ?>
                </td>
                <td width="100"><?= __('guild') ?></td>
                <td><a data-ajax href="<?= url_to('/profile/guild/' . $guild->getName()) ?>"><?= $guild->getName() ?></a></td>
            </tr>
            <tr>
                <td><?= __('Master') ?></td>
                <td><a data-ajax href="<?= url_to('/profile/character/' . $guild->getMaster()->getName()) ?>"><?= $guild->getMaster()->getName() ?></a></td>
            </tr>
            <tr>
                <td><?= __('Score') ?></td>
                <td><?= $guild->getScore() ?></td>
            </tr>
            <tr>
                <td><?= __('Members') ?></td>
                <td><?= count($guild->getMembers()) ?></td>
            </tr>
        </table>
    </div>
</div>


<div class="box-panel" style="margin-top:10px">
    <div class="box-panel-title"><?= __('Members') ?></div>
    <div class="box-panel-content">
        <table class="list">
            <thead>
                <tr>
                    <th><?= __('Character') ?></th>
                    <th><?= __('Class') ?></th>
                    <?php if (config('columns.resets')): ?>
                        <th><?= __('Resets') ?></th>
                    <?php endif ?>
                    <th><?= __('Level') ?></th>
                    <th width="50"><?= __('Member level') ?></th>
                </tr>
            </thead>

            <tbody>
                <?php foreach ($guild->getMembers() as $member): ?>
                    <tr>
                        <td><a href="<?= url_to('/profile/character/' . $member->getName()) ?>" data-ajax><?= $member->getName() ?></a></td>
                        <td><?= util('Character')->className($member->getClass()) ?></td>
                        <?php if (config('columns.resets')): ?>
                            <td><?= $member->getResets() ?></td>
                        <?php endif ?>
                        <td><?= $member->getLevel() ?></td>
                        <td><?= $member->isMaster() ? 'Master' : 'Member' ?></td>
                    </tr>
                <?php endforeach ?>
            </tbody>
        </table>
    </div>
</div>