Skip to content

Commit

Permalink
Display news preview when editing
Browse files Browse the repository at this point in the history
  • Loading branch information
NFarrington committed Jun 8, 2018
1 parent 076523d commit 17758ef
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
12 changes: 12 additions & 0 deletions resources/views/platform/_news-card.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="card mb-4">
<div class="card-header">
<span class="lead">{{ $post->title }}</span>
<small class="text-muted" data-toggle="tooltip" data-placement="top"
title="{{ $post->created_at->format('Y-m-d H:i:s T') }}">
Posted {{ $post->created_at->diffForHumansAt() }}
</small>
</div>
<div class="card-body">
{!! \Markdown::convertToHtml($post->content) !!}
</div>
</div>
2 changes: 1 addition & 1 deletion resources/views/platform/admin/news/_card.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="card">
<div class="card mb-4">
<div class="card-header">
<span class="lead">News</span>
<ul class="nav nav-tabs card-header-tabs float-right">
Expand Down
2 changes: 2 additions & 0 deletions resources/views/platform/admin/news/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@
</form>
</div>
@endcomponent

@include('platform._news-card', ['post' => $news])
@endsection
13 changes: 1 addition & 12 deletions resources/views/platform/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@
@section('content')
@if($news->isNotEmpty())
@foreach($news as $post)
<div class="card mb-4">
<div class="card-header">
<span class="lead">{{ $post->title }}</span>
<small class="text-muted" data-toggle="tooltip" data-placement="top"
title="{{ $post->created_at->format('Y-m-d H:i:s T') }}">
Posted {{ $post->created_at->diffForHumansAt() }}
</small>
</div>
<div class="card-body">
{!! \Markdown::convertToHtml($post->content) !!}
</div>
</div>
@include('platform._news-card')
@endforeach

<div class="d-flex justify-content-center">{{ $news->links() }}</div>
Expand Down

0 comments on commit 17758ef

Please sign in to comment.