@include('admin.header')

<body class="skin-blue layout-top-nav">
<div class="wrapper">

@include('admin.sidebar')

<!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <div class="container inner_container">
            <!-- Content Header (Page header) -->

            <!-- Main content -->
            <section class="content" style="padding: 20px 0;">

                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">Save Post</h3>
                    </div>
                    <!-- form start -->
                    <form id="post_form">

                        <input type="hidden" class="post_id" name="id"
                               <?php if(isset($post)){?> value="<?php echo $post['id']; ?>" <?php } ?> >

                        <div class="box-body">

                            <div class="form-group col-md-4">
                                <label>Title <span class="statric">*</span></label>
                                <input type="text" class="form-control post_title" name="title"
                                       placeholder="Enter title"
                                       <?php if(isset($post)){?> value="<?php echo $post['title']; ?>" <?php } ?> >
                            </div>

                            <div class="form-group col-md-4">
                                <label>Slug <span class="statric">*</span></label>
                                <input type="text" class="form-control post_slug" name="slug"
                                       placeholder="Enter Slug"
                                       <?php if(isset($post)){?> value="<?php echo $post['slug']; ?>" <?php } ?> >
                            </div>

                            <div class="form-group col-md-12">
                                <label>Description <span class="statric">*</span></label>
                                <textarea id="editor1" class="form-control post_description" name="description"
                                          rows="10"
                                          cols="80">@if(isset($post)) {{$post['description']}} @endif</textarea>
                            </div>

                            @if(isset($post))
                                <div class="form-group col-md-12">
                                    <img style="border: 1px solid #ddd;border-radius: 4px;padding: 5px;width: 150px;" src="{{\Illuminate\Support\Facades\URL::to('/') .'/public/images/'.$post['media']}}" />
                                </div>
                            @endif

                            <div class="form-group col-md-12">
                                <input accept="image/x-png,image/gif,image/jpeg" type="file" name="select_file" id="select_file" />
                            </div>

                        </div>
                        <!-- /.box-body -->

                        <div class="box-footer col-md-12">
                            <div class="col-md-12">
                                <button class="btn btn-primary save_post">Save</button>
                            </div>
                        </div>
                    </form>
                </div>


            </section>
            <!-- /.content -->
        </div>

    </div>

</div>

@include('admin.footer')
