diff --git a/resources/views/articles/index.blade.php b/resources/views/articles/index.blade.php index 05da0bcc..386cfa97 100644 --- a/resources/views/articles/index.blade.php +++ b/resources/views/articles/index.blade.php @@ -9,25 +9,7 @@ @endif @foreach ($articles as $article) -@if ($article->url != '')
@else
@endif -
-

-@if($article->url == '') - {{ $article->title }} -@else - {{ $article->title }} -@endif -

- -
-
- {!! $article->html !!} -
-
+ @include('templates.article', ['article' => $article]) @endforeach - {{ $articles->links() }} -@stop - -@section('scripts') - +{{ $articles->links() }} @stop diff --git a/resources/views/articles/show.blade.php b/resources/views/articles/show.blade.php index c22c2ec5..dddc6ba2 100644 --- a/resources/views/articles/show.blade.php +++ b/resources/views/articles/show.blade.php @@ -3,19 +3,5 @@ @section('title'){{ strip_tags($article->title) }} « @stop @section('content') -@if($article->url != '')
@else -@stop - -@section('scripts') - + @include('templates.article', ['article' => $article]) @stop diff --git a/resources/views/front-page.blade.php b/resources/views/front-page.blade.php index baf48029..4a0e9ed9 100644 --- a/resources/views/front-page.blade.php +++ b/resources/views/front-page.blade.php @@ -11,10 +11,10 @@ @foreach ($items as $item) @switch($item) @case($item instanceof \App\Models\Note) -

This is a note

+ @include('templates.note', ['note' => $item]) @break @case($item instanceof \App\Models\Article) -

This is an article

+ @include('templates.article', ['article' => $item]) @break @case($item instanceof \App\Models\Like)

This is a like

diff --git a/resources/views/templates/article.blade.php b/resources/views/templates/article.blade.php new file mode 100644 index 00000000..c496c2e0 --- /dev/null +++ b/resources/views/templates/article.blade.php @@ -0,0 +1,11 @@ +