<?php $__env->startSection('content'); ?>
  <h1><?php echo ucfirst($contentType->getLabel()); ?></h1>
  <div id="generic_wrapper">
    <?php if($contentType->hasActions("grid")): ?>
      <div class="grid-btns-wrapper">
        <?php foreach($contentType->getActions("grid") as $action): ?>
          <button type="button" data-toggle="tooltip" data-placement="right"
                  class="btn btn-default command-<?php echo $action->getType(); ?>" title="<?php echo $action->getLabel(); ?>">
            <span class="icon glyphicon <?php echo $action->getCssClass(); ?>"></span>
          </button>
        <?php endforeach; ?>
      </div>
    <?php endif; ?>
    <table id="grid" class="table table-condensed table-hover table-striped">
      <thead>
      <tr>
        <th data-column-id="id" data-type="numeric" data-identifier="true" data-visible="false">ID</th>
        <?php foreach($contentType->getFields()->getListableFields() as $field): ?>
          <?php echo $field->toGridHeader(); ?>

        <?php endforeach; ?>

        <?php if($contentType->getShowSlug()): ?>
          <th data-column-id="slug">Slug</th>
        <?php endif; ?>

        <?php if($contentType->getShowUri()): ?>
          <th data-column-id="uri">Uri</th>
        <?php endif; ?>

        <th data-column-id="status">Status</th>

        <?php if($contentType->hasActions("row")): ?>
          <th data-column-id="commands" data-formatter="commands"
              data-sortable="false"><?php echo Lang::get('backend.actions'); ?></th>
        <?php endif; ?>
      </tr>
      </thead>
    </table>
  </div>
  <script>
    $(function () {
      var genericListView = new Eae.View.BackendGenericList({
        el: $('#generic_wrapper'),
        contentType: <?php echo $contentType->toJson(); ?>

      });
    });
  </script>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.main', array('scripts' => array(Config::get('path.backoffice.js_path') . '/view/generic/backend-generic-list.js', Config::get('path.backoffice.js_path') . '/view/generic/backend-generic-form-modal.js')), array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>