@layout('layouts/dashboard')
@set('title', 'News')
@section('body')

<div class="grid-menu">
  @include('partials/dashboard/messages')

  <div class="col" style="text-align:center;margin: 20px;">
    <a class="btn-default" href="{{ route('admin.create.news') }}" >
      Add news
    </a>
  </div>
  <table class="edit-news" style="">

<thead>
  <tr style="text-align:center; vertical-align:top; padding: 10px; margin-top: 20px;">
      <th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending" style="height: 5%">Category</th>
      <th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending" style="height: 25%">Title</th>
      <th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Image</th>
      <th class="headerSort" tabindex="0" colspan="2" role="columnheader button" title="Sort ascending">Options</th>
  </tr>
</thead>
  <tbody style="background-color:#FFFFFF;">
    @each(news in data)

      <tr>
          <td>{{ news.category }}</td>
          <td>{{{ excerpt(news.content, 50) }}}</td>
          <td><img style="" src={{{ news.thumbnail }}}></a></td>
          <td><a href="{{ route('admin.update.news', { slug: news.slug }) }}"> <button type="submit" class="btn-default">Edit</button></a>
          <td><a href="{{ route('auth.admin.delete.news', { slug: news.slug }) }}"> <button type="submit" class="btn-default">Delete</button></a>
          </td>
      </tr>
    @endeach
</tbody>

</table>
@include('partials/dashboard/pagination')

@end
