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

<div class="card">
    <div class="card-header ch-alt">
        <h2><?=__('Custom Fields') ?></h2>

        <a class="btn bgm-blue btn-float" role="button" title="<?=sprintf(__('Add %s'), __('Custom Field')) ?>" href="<?=$router->named('admin:custom_fields:add') ?>">
            <span class="sr-only"><?=__('Add %s', __('Custom Field')) ?></span>
            <i class="zmdi zmdi-plus"></i>
        </a>
    </div>
    <div class="table-responsive">
        <table class="table table-striped">
            <colgroup>
                <col width="30%">
                <col width="40%">
                <col width="30%">
            </colgroup>
            <thead>
            <tr>
                <th><?=__('Actions') ?></th>
                <th><?=__('Name') ?></th>
                <th><?=__('Programmatic Name') ?></th>
            </tr>
            </thead>
            <tbody>
            <?php foreach($records as $row): ?>
                <tr class="input">
                    <td>
                        <a class="btn btn-sm btn-default" href="<?=$router->named('admin:custom_fields:edit', ['id' => $row['id']]) ?>"><?=__('Edit') ?></a>
                        <a class="btn btn-sm btn-danger" href="<?=$router->named('admin:custom_fields:delete', ['id' => $row['id'], 'csrf' => $csrf]) ?>"><?=__('Delete') ?></a>
                    </td>
                    <td>
                        <?=$this->e($row['name']) ?>
                    </td>
                    <td>
                        <?=$this->e($row['short_name']) ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>
