From 17758ef22f6d9600f7ef92a992a47d0dc63cda67 Mon Sep 17 00:00:00 2001 From: Neil Farrington Date: Fri, 8 Jun 2018 20:18:27 +0100 Subject: [PATCH] Display news preview when editing --- resources/views/platform/_news-card.blade.php | 12 ++++++++++++ resources/views/platform/admin/news/_card.blade.php | 2 +- resources/views/platform/admin/news/edit.blade.php | 2 ++ resources/views/platform/dashboard.blade.php | 13 +------------ 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 resources/views/platform/_news-card.blade.php diff --git a/resources/views/platform/_news-card.blade.php b/resources/views/platform/_news-card.blade.php new file mode 100644 index 0000000..55ce0e7 --- /dev/null +++ b/resources/views/platform/_news-card.blade.php @@ -0,0 +1,12 @@ +
+
+ {{ $post->title }} + + Posted {{ $post->created_at->diffForHumansAt() }} + +
+
+ {!! \Markdown::convertToHtml($post->content) !!} +
+
diff --git a/resources/views/platform/admin/news/_card.blade.php b/resources/views/platform/admin/news/_card.blade.php index da1af22..19ed068 100644 --- a/resources/views/platform/admin/news/_card.blade.php +++ b/resources/views/platform/admin/news/_card.blade.php @@ -1,4 +1,4 @@ -
+
News
@endcomponent + + @include('platform._news-card', ['post' => $news]) @endsection diff --git a/resources/views/platform/dashboard.blade.php b/resources/views/platform/dashboard.blade.php index 7794a8d..6b3432a 100644 --- a/resources/views/platform/dashboard.blade.php +++ b/resources/views/platform/dashboard.blade.php @@ -3,18 +3,7 @@ @section('content') @if($news->isNotEmpty()) @foreach($news as $post) -
-
- {{ $post->title }} - - Posted {{ $post->created_at->diffForHumansAt() }} - -
-
- {!! \Markdown::convertToHtml($post->content) !!} -
-
+ @include('platform._news-card') @endforeach
{{ $news->links() }}