<?php $this->push('styles')?><link rel="stylesheet" href="<?=module_asset('sports','css/sports.css')?>"><?php $this->endPush()?>
<div class="d-flex justify-content-between align-items-center mb-3"><h4 class="mb-0"><i class="fas fa-trophy me-2"></i><?=lang('sports.leagues')?></h4>
<?php if(auth_can('sports.manage')):?><a href="/sports/leagues/create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i>New League</a><?php endif;?></div>
<div class="card"><div class="card-body">
<table id="leagues-table" class="table table-striped w-100" data-url="/api/sports/leagues/datatable"
    data-columns='[{"data":"league_code","title":"Code"},{"data":"name_en","title":"League"},{"data":"sport_name","title":"Sport"},{"data":"season_name","title":"Season"},{"data":"league_type","title":"Type"},{"data":"team_count","title":"Teams"},{"data":"status_badge","title":"Status","orderable":false},{"data":"actions","title":"","orderable":false}]'></table>
</div></div>
<?php $this->push('scripts')?><script>document.addEventListener('DOMContentLoaded',()=>DataTableHelper.init('leagues-table'));</script><?php $this->endPush()?>