<?php $__env->startSection('title', 'Manage Assigned Actions'); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-header">
        <h1>Assigned actions</h1>
    </div>

    <table class="table table-striped">
        <thead>
            <tr>
                <th>Action Name</th>
                <th>Assigned To</th>
                <th>Multiplier</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <?php if(!count($actions)): ?>
                <tr>
                    <td colspan="3" class="text-center">No actions assigned. Why not, <a href="<?php echo e(URL::route('admin.assignedActions.create')); ?>">assign one now</a>?</td>
                </tr>
            <?php endif; ?>

            <?php foreach($actions as $action): ?>
                <?php foreach($action->businesses as $resource): ?>
                    <tr>
                        <td><?php echo e($resource->name); ?></td>
                        <td><?php echo e(count($resource->actions)); ?></td>
                        <td>
                            <a class="btn btn-default" href="<?php echo e(URL::route('admin.assignedActions.edit', $action->id, $resource->id)); ?>">Edit</a>&nbsp;
                            <form action="<?php echo e(URL::route('admin.assignedActions.destroy', $action->id, $resource->id)); ?>" class="inline delete-form" method="post">
                                <?php echo csrf_field(); ?>

                                <input type="hidden" name="_method" value="DELETE">
                                <button class="btn btn-danger">Delete</button>
                            </form>
                        </td>
                    </tr>
                <?php endforeach; ?>
            <?php endforeach; ?>
        </tbody>
    </table>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>