@extends('Dashboard.master_page')


@section('active') side-menu--active  @endsection


@section('data')


   @if(Session::has('success_message'))
       <div class="rounded-md px-5 py-4 mb-2 bg-theme-9 text-white">{{ Session::get('success_message') }}</div>
       @endif


    @foreach($notes as $note)
    <div class="intro-x cursor-pointer box relative flex items-center p-5 {{ $note->color }}" style="width: 300px;margin-top: 10px;float: left;margin-left: 20px;">
        <div class="ml-2 overflow-hidden">
            <div class="w-full truncate text-gray-600 mt-0.5" style="color:#856404;">{{ $note->description }}</div>
        </div>
        <form action="{{route('Note.destroy' , $note->id)}}" method="post" id="form-{{$note->id}}">
            {{csrf_field()}}
            {{method_field("DELETE")}}
        </form>


        <a href="" onclick="if(confirm('Are you sure to delete?')) {
                event.preventDefault();
                document.getElementById('form-{{$note->id}}').submit();
                }else{ event.preventDefault(); }">
            <div class="w-5 h-5 flex items-center justify-center absolute top-0 right-0 text-xs text-white rounded-full bg-theme-1 font-medium -mt-1 -mr-1">
                <svg style="margin-left: 3px;" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2 w-4 h-4 mr-1"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
            </div>

        </a>

      </div>
    @endforeach

   <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <form action="{{ route('Note.store') }}" method="post">
        @csrf
        <input type="hidden" name="title" value="Title">
        <input type="hidden" name="user_id" value="{{ \Illuminate\Support\Facades\Auth::user()->id }}">
        <br>
        <textarea name="description" id="" cols="120" rows="10" style="padding: 10px;border: 10px solid gray;"></textarea>
        <br>
        <button type="submit" class="button bg-theme-1 text-white mt-5" style="background:blue;width: 80px;">Add</button>
    </form>








@endsection