<?php use Fisharebest\Webtrees\I18N; ?>

<?php foreach ($all_trees as $tree) : ?>
    <tr class="<?= $changes[$tree->id()] ? 'danger' : '' ?>">
        <th scope="row">
            <a href="<?= e(route('tree-page', ['ged' => $tree->name()])) ?>">
                <?= e($tree->name()) ?>
                -
                <?= e($tree->title()) ?>
            </a>
        </th>
        <td>
            <a href="<?= e(route('admin-trees', ['ged' => $tree->name()])) ?>" title="<?= I18N::translate('Preferences') ?>">
                <?= view('icons/preferences') ?>
            </a>
        </td>
        <td class="text-right">
            <?php if ($changes[$tree->id()]) : ?>
                <a href="<?= e(route('show-pending', ['ged' => $tree->name(), 'url' => route('admin-control-panel')])) ?>">
                    <?= I18N::number($changes[$tree->id()]) ?>
                    <span class="sr-only"><?= I18N::translate('Pending changes') ?> <?= e($tree->title()) ?></span>
                </a>
            <?php else : ?>
                -
            <?php endif ?>
        </td>
        <td class="d-none d-sm-table-cell text-right">
            <?php if ($individuals[$tree->id()]) : ?>
                <a href="<?= e(route('individual-list', ['ged' => $tree->name()])) ?>">
                    <?= I18N::number($individuals[$tree->id()]) ?>
                </a>
            <?php else : ?>
                -
            <?php endif ?>
        </td>
        <td class="d-none d-lg-table-cell text-right">
            <?php if ($families[$tree->id()]) : ?>
                <a href="<?= e(route('family-list', ['ged' => $tree->name()])) ?>">
                    <?= I18N::number($families[$tree->id()]) ?>
                </a>
            <?php else : ?>
                -
            <?php endif ?>
        </td>
        <td class="d-none d-sm-table-cell text-right">
            <?php if ($sources[$tree->id()]) : ?>
                <a href="<?= e(route('source-list', ['ged' => $tree->name()])) ?>">
                    <?= I18N::number($sources[$tree->id()]) ?>
                </a>
            <?php else : ?>
                -
            <?php endif ?>
        </td>
        <td class="d-none d-lg-table-cell text-right">
            <?php if ($repositories[$tree->id()]) : ?>
                <a href="<?= e(route('repository-list', ['ged' => $tree->name()])) ?>">
                    <?= I18N::number($repositories[$tree->id()]) ?>
                </a>
            <?php else : ?>
                -
            <?php endif ?>
        </td>
        <td class="d-none d-sm-table-cell text-right">
            <?php if ($media[$tree->id()]) : ?>
                <a href="<?= e(route('media-list', ['ged' => $tree->name()])) ?>">
                    <?= I18N::number($media[$tree->id()]) ?>
                </a>
            <?php else : ?>
                -
            <?php endif ?>
        </td>
        <td class="d-none d-lg-table-cell text-right">
            <?php if ($notes[$tree->id()]) : ?>
                <a href="<?= e(route('note-list', ['ged' => $tree->name()])) ?>">
                    <?= I18N::number($media[$tree->id()]) ?>
                </a>
            <?php else : ?>
                -
            <?php endif ?>
        </td>
    </tr>
<?php endforeach ?>
