<?php $this->layout('main', ['title' => __('Stations'), 'manual' => true]); ?>

<div class="card">
    <div class="card-header bg-primary-dark">
        <h2 class="card-title"><?=__('Manage Stations')?></h2>
    </div>
    <div class="card-actions">
        <a class="btn btn-outline-primary" role="button" href="<?=$router->named('admin:stations:add')?>">
            <i class="material-icons" aria-hidden="true">add</i>
            <?=__('Add Station')?>
        </a>
    </div>
    <table class="table table-striped table-responsive-md mb-0">
        <colgroup>
            <col width="20%">
            <col width="80%">
        </colgroup>
        <thead>
        <tr>
            <th><?=__('Actions')?></th>
            <th><?=__('Station')?></th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ((array)$stations as $record): ?>
            <tr class="align-middle">
                <td class="center">
                    <div class="btn-group btn-group-sm">
                        <a class="btn btn-sm btn-primary" href="<?=$router->named('stations:index:index',
                            ['station_id' => $record['id']])?>" target="_blank"><?=__('Manage')?></a>
                        <a class="btn btn-sm btn-dark" href="<?=$router->named('admin:stations:edit',
                            ['id' => $record['id']])?>"><?=__('Edit')?></a>
                        <a class="btn btn-sm btn-dark" href="<?=$router->named('admin:stations:clone',
                            ['id' => $record['id']])?>"><?=__('Clone')?></a>
                        <a class="btn btn-sm btn-danger" data-confirm-title="<?=$this->e(__('Delete station "%s"?',
                            $record['name']))?>" href="<?=$router->named('admin:stations:delete',
                            ['id' => $record['id'], 'csrf' => $csrf])?>"><?=__('Delete')?></a>
                    </div>
                </td>
                <td>
                    <big><?=$this->e($record['name'])?></big>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
</div>
