<?= $this->layout('_layout', ['title' => $title]); ?>

<main class="main">
    <?= $this->insert('includes/aside_info') ?>

    <div class="content">
        <div class="h2-title h2-title-content flex-s-c">
            <span>Auctions</span>
        </div>

        <div class="flex-c-c my-characters-market auctions-info">
            <?php if ($auctions) : foreach ($auctions as $auction) : ?>
                    <div>
                        <p class="name"><?= $auction->title ?></p>
                        <div>
                            <img src="<?= __resources('auctions/' . $auction->image) ?>" width="160">
                        </div>
                        <p class="name"><?= $auction->price ?> <?= $auction->coin_name ?></p>
                        <p class="name">Finaliza em: <?= date('d/m H:i', strtotime($auction->date)) ?></p>
                        <br>
                        <a class="button" href="<?= __redirect('auction/view/' . $auction->slug) ?>">Dar lance</a>
                    </div>
                <?php endforeach;
            else : ?>
                <div class="warning">Does not currently contain open auctions</div>
            <?php endif; ?>
        </div>
    </div>
</main>