<?php
/**
 * @var \App\View\AppView $this
 * @var \App\Model\Entity\Timeline[]|\Cake\Collection\CollectionInterface $timelines
 */
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
    <ul class="side-nav">
        <li class="heading"><?= __('Actions') ?></li>
        <li><?= $this->Html->link(__('New Timeline'), ['action' => 'add']) ?></li>
        <li><?= $this->Html->link(__('List Projects'), ['controller' => 'Projects', 'action' => 'index']) ?></li>
        <li><?= $this->Html->link(__('New Project'), ['controller' => 'Projects', 'action' => 'add']) ?></li>
        <li><?= $this->Html->link(__('List Freelancers'), ['controller' => 'Freelancers', 'action' => 'index']) ?></li>
        <li><?= $this->Html->link(__('New Freelancer'), ['controller' => 'Freelancers', 'action' => 'add']) ?></li>
    </ul>
</nav>
<div class="timelines index large-9 medium-8 columns content">
    <h3><?= __('Timelines') ?></h3>
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th scope="col"><?= $this->Paginator->sort('id') ?></th>
                <th scope="col"><?= $this->Paginator->sort('project_id') ?></th>
                <th scope="col"><?= $this->Paginator->sort('event') ?></th>
                <th scope="col"><?= $this->Paginator->sort('perform_by') ?></th>
                <th scope="col"><?= $this->Paginator->sort('freelancer_id') ?></th>
                <th scope="col"><?= $this->Paginator->sort('created') ?></th>
                <th scope="col" class="actions"><?= __('Actions') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($timelines as $timeline): ?>
            <tr>
                <td><?= $this->Number->format($timeline->id) ?></td>
                <td><?= $timeline->has('project') ? $this->Html->link($timeline->project->id, ['controller' => 'Projects', 'action' => 'view', $timeline->project->id]) : '' ?></td>
                <td><?= h($timeline->event) ?></td>
                <td><?= $this->Number->format($timeline->perform_by) ?></td>
                <td><?= $timeline->has('freelancer') ? $this->Html->link($timeline->freelancer->name, ['controller' => 'Freelancers', 'action' => 'view', $timeline->freelancer->id]) : '' ?></td>
                <td><?= h($timeline->created) ?></td>
                <td class="actions">
                    <?= $this->Html->link(__('View'), ['action' => 'view', $timeline->id]) ?>
                    <?= $this->Html->link(__('Edit'), ['action' => 'edit', $timeline->id]) ?>
                    <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $timeline->id], ['confirm' => __('Are you sure you want to delete # {0}?', $timeline->id)]) ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <div class="paginator">
        <ul class="pagination">
            <?= $this->Paginator->first('<< ' . __('first')) ?>
            <?= $this->Paginator->prev('< ' . __('previous')) ?>
            <?= $this->Paginator->numbers() ?>
            <?= $this->Paginator->next(__('next') . ' >') ?>
            <?= $this->Paginator->last(__('last') . ' >>') ?>
        </ul>
        <p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
    </div>
</div>
