<div class="d-flex justify-content-between align-items-center mb-4">
    <h4 class="mb-0"><i class="fas fa-calendar-alt me-2"></i><?= lang('board.terms') ?></h4>
    <?php if (auth_can('board.manage')): ?>
    <a href="/board/terms/create" class="btn btn-primary"><i class="fas fa-plus me-1"></i><?= lang('common.create') ?></a>
    <?php endif; ?>
</div>

<div class="card">
    <div class="card-body">
        <table id="termsTable" class="table table-striped table-hover w-100"
               data-url="/board/terms/datatable"
               data-columns='[
                   {"data":"id","title":"#","width":"50px"},
                   {"data":"term_name","title":"<?= lang('board.term_name') ?>"},
                   {"data":"start_date","title":"<?= lang('board.start_date') ?>"},
                   {"data":"end_date","title":"<?= lang('board.end_date') ?>"},
                   {"data":"status","title":"<?= lang('common.status') ?>"},
                   {"data":"members","title":"<?= lang('board.members_count') ?>"},
                   {"data":"actions","title":"<?= lang('common.actions') ?>","orderable":false,"searchable":false}
               ]'>
            <thead>
                <tr>
                    <th>#</th>
                    <th><?= lang('board.term_name') ?></th>
                    <th><?= lang('board.start_date') ?></th>
                    <th><?= lang('board.end_date') ?></th>
                    <th><?= lang('common.status') ?></th>
                    <th><?= lang('board.members_count') ?></th>
                    <th><?= lang('common.actions') ?></th>
                </tr>
            </thead>
        </table>
    </div>
</div>

<?php $__view->push('scripts') ?>
<script>
document.addEventListener('DOMContentLoaded', function() {
    DataTableHelper.init('termsTable');
});
</script>
<?php $__view->endPush() ?>