From 10fe70b767a0ef5274ea37e8c25a2c19335dee70 Mon Sep 17 00:00:00 2001 From: Joao Paulo Vendramini Martins Date: Thu, 25 Oct 2018 11:16:21 +0100 Subject: [PATCH] =?UTF-8?q?PoC=20para=20p=C3=A1gina=20de=20autores=20de=20?= =?UTF-8?q?artigos;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/authors/grid-item.blade.php | 26 +++++++++++++++ .../_partials/content/authors/grid.blade.php | 32 +++++++++++++++++++ source/autores.blade.php | 17 ++++++++++ 3 files changed, 75 insertions(+) create mode 100644 source/_partials/content/authors/grid-item.blade.php create mode 100644 source/_partials/content/authors/grid.blade.php create mode 100644 source/autores.blade.php diff --git a/source/_partials/content/authors/grid-item.blade.php b/source/_partials/content/authors/grid-item.blade.php new file mode 100644 index 00000000..fe9e9b35 --- /dev/null +++ b/source/_partials/content/authors/grid-item.blade.php @@ -0,0 +1,26 @@ +
+
+
+
+ authorEmail))); ?> + Gravatar de {{ $author->author }} +
+
+

{{ $authorsPostsCount[$author->author] }} author] > 1 ? 'artigos':'artigo'; ?>

+
+
+
+
+

+ {{ $author->author }} + @johnsmith + 31m +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean efficitur sit amet massa + fringilla egestas. Nullam condimentum luctus turpis. +

+
+
+
+
\ No newline at end of file diff --git a/source/_partials/content/authors/grid.blade.php b/source/_partials/content/authors/grid.blade.php new file mode 100644 index 00000000..acc132a4 --- /dev/null +++ b/source/_partials/content/authors/grid.blade.php @@ -0,0 +1,32 @@ +author, $authorsPostsCount)) { + $authorsPostsCount[$post->author] = 0; + $authors[] = (object)[ + 'author' => $post->author, + 'authorEmail' => $post->authorEmail, + ]; + } + + ++$authorsPostsCount[$post->author]; +} + +$columns = 3; +$count = 0; +?> +@if (count($authors) > 0) +
+ @foreach ($authors as $author) +
+ @include('_partials.content.authors.grid-item', ['author' => $author, 'postCount' => $authorsPostsCount]) +
+ @if(++$count % $columns === 0) +
+
+ @endif + @endforeach +
+@endif \ No newline at end of file diff --git a/source/autores.blade.php b/source/autores.blade.php new file mode 100644 index 00000000..0529a23e --- /dev/null +++ b/source/autores.blade.php @@ -0,0 +1,17 @@ + +@extends('_layouts.master') + +@section('body') + +
+
+

Autores

+ @include('_partials.content.authors.grid') +
+ +{{-- @include('_partials.layout.pagination')--}} +
+@endsection +