@extends('master')
@section('content')

      
 <div class="container" style = "margin-left:0px;width:100%;">  

       <!-- меню !-->
   <nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <div class="navbar-brand"  style = "color:#144d8a;font-weight:600;">Choose hashteg:</div>
    </div>
    <!--<form class="navbar-form navbar-left" action="/action_page.php">
      <div class="form-group">
        <input type="text" class="form-control" placeholder="#input_teg">
      </div>
      <button type="submit" class="btn btn-default">Искать</button>
    </form>-->
    <ul class="nav navbar-nav">
      
      <li><a href="{{action('CRUDController@sport')}}" 
        style = "color:#636c90;font-weight:500;font-size:24px" >#sport</a></li>


      <li><a href="{{action('CRUDController@it')}}" 
        style = "color:#636c90;font-weight:500;font-size:24px" >#it</a></li>


      <li><a href="{{action('CRUDController@festive')}}" 
        style = "color:#636c90;font-weight:500;font-size:24px" >#festive</a></li>
      

      <li><a href="{{action('CRUDController@index')}}" 
        style = "color:#636c90;font-weight:500;font-size:24px" >#all</a></li>

     </ul>
    </div>
</nav> 
<!-- меню !-->
    <br>
    <br>
    <table class="table table-striped">
    <thead>
      <tr>
       <!-- <th>ID</th> !-->
        <th>Название</th>
        <th>Описание</th>
        <th>Дата проведения</th>
        <th>Тип мероприятия</th>
        <th colspan="2">Действия</th>
      </tr>
    </thead>
    <tbody>
      @foreach($cruds as $post)
      <tr>
    
        <td> {{$post->title}} </td>
        <td>{{substr($post->post, 0,130).'...'}}</td>
        <td>{{$post->date}}</td>
        <td>{{$post->type}}</td>
        <td><a href="{{action('CRUDController@edit', $post->id)}}" class="btn btn-warning">Редактировать</a></td>
        <td>
          <form action="{{action('CRUDController@destroy', $post->id)}}" method="post">
            {{csrf_field()}}
            <input name="_method" type="hidden" value="DELETE">
            <button class="btn btn-danger" type="submit">Удалить</button>
          </form>
        </td>
      </tr>
      @endforeach
    </tbody>
  </table>
 </div> 
@endsection