@extends('admin.layouts.main') @section('content')

{{ trans('BlogSystem::admin/main.posts') }}

@section('panelTitle')

{{ trans('BlogSystem::admin/main.title') }}

@overwrite @section('panelContent') {!! Form::open(['class' => 'form-horizontal', 'files' => 'true', 'route' => ['admin::posts::store']]) !!}
{!! Form::label(null, trans('BlogSystem::admin/main.creation.title')) !!}:
{!! Form::text('title', '', [ 'class' => 'form-control', 'autocomplete' => 'off', 'placeholder' => trans('BlogSystem::admin/main.creation.title'), 'required', ]) !!}
{!! Form::label(null, trans('BlogSystem::admin/main.creation.string_url')) !!}:
{!! Form::text('url_string', '', [ 'class' => 'form-control', 'autocomplete' => 'off', 'placeholder' => trans('BlogSystem::admin/main.creation.string_url'), 'required', ]) !!}
{!! Form::label(null, trans('BlogSystem::admin/main.creation.image')) !!}:
{!! Form::file('image', ['required']) !!}
{!! Form::label(null, trans('BlogSystem::admin/main.creation.short_description')) !!}:
{!! Form::textarea('short_description', '', [ 'class' => 'form-control', 'autocomplete' => 'off', 'placeholder' => trans('BlogSystem::admin/main.creation.short_description'), 'required', ]) !!}
{!! Form::label(null, trans('BlogSystem::admin/main.creation.description')) !!}:
{!! Form::textarea('description', '', [ 'class' => 'form-control ckeditor', 'autocomplete' => 'off', 'placeholder' => trans('BlogSystem::admin/main.creation.description'), 'required', ]) !!}
{!! Form::label(null, trans('BlogSystem::admin/main.creation.category')) !!}:
{!! Form::label(null, trans('BlogSystem::admin/main.creation.added_categories')) !!}:
{!! Form::label(null, trans('BlogSystem::admin/main.creation.added_at')) !!}
{!! Form::button(trans('global.add'), ['type' => 'submit', 'class' => 'btn btn-wide btn-success ladda-button', 'data-style' => 'slide-up']) !!}
{!! Form::close() !!} @overwrite @include('admin.layouts.includes.panel',['id' => 'post-add']) @section('panelTitle')

{{ trans('BlogSystem::admin/main.posts') }}

@overwrite @if(!$posts->isEmpty()) @section('panelContent')
@foreach($posts as $post)
@foreach($post->categories as $category) {{ $category->getFullCategoryName() }} | @endforeach

{{ $post->getProperLanguageRow('lang', 'title') }}

{!! $post->getProperLanguageRow('lang', 'short_description') !!}

{{ trans('BlogSystem::admin/main.added_at') }}: {{ $post->added_at }}

@endforeach {{ $posts->links() }}
@overwrite @include('admin.layouts.includes.panel',['id' => 'posts']) @else @section('panelContent')

{{ trans('BlogSystem::admin/main.empty') }}

@overwrite @include('admin.layouts.includes.panel',['id' => 'posts']) @endif @push('footScripts') @include('BlogSystem::admin.posts.js.scripts') @endpush @endsection