<?php
/**
 * @var \kernel\app_modules\user_stage\models\User $user
 */

use kernel\app_modules\user_stage\services\UserStageService;

?>
<!-- [ Main Content ] start -->

<!-- [ breadcrumb ] start -->
<div class="page-header">
    <div class="page-block">
        <div class="row align-items-center">
            <div class="col-md-12">
                <div class="page-header-title">
                    <h2 class="mb-0">Этапы конкурса</h2>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- [ breadcrumb ] end -->

<!-- [ Main Content ] start -->
<div class="row">
    <!-- [ sample-page ] start -->
    <div class="col-sm-12">
        <?php foreach ($user->stages as $stage): ?>
            <div class="card <?= UserStageService::getStageClass($stage); ?>">
                <a href="/lk/stage/<?= $stage->id ?>" <?= $stage->pivot->is_closed === 1 ? "onclick='return false;'" : "" ?>>
                    <div class="card-header">
                        <h5><?= $stage->title ?></h5>
                    </div>
                </a>
                <div class="card-body">
                    <p>
                        <?= $stage->description ?>
                    </p>
                    <p class="mb-0 text-muted text-sm">Статус:
                        <b><?= UserStageService::getStageStatusText($stage); ?></b></p>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
    <!-- [ sample-page ] end -->
</div>
<!-- [ Main Content ] end -->
<!-- [ Main Content ] end -->
