Skip to content

Commit

Permalink
Adds author listing to /sobre page
Browse files Browse the repository at this point in the history
  • Loading branch information
nawarian committed May 24, 2019
1 parent 939afb6 commit 4e9c30f
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 23 deletions.
19 changes: 19 additions & 0 deletions source/_assets/sass/author/author-card-list.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import '../colors';
@import '../font-sizes';
@import '../mixins/media';

.author-card-list {
&__list {
display: grid;
grid-template-columns: repeat(3, 33%);

@include mobile-only {
display: flex;
flex-direction: column;
}
}

&__list-item {
padding: 0 5px;
}
}
29 changes: 29 additions & 0 deletions source/_assets/sass/author/author-card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@import '../colors';

.author-card {
margin-top: .5em;
flex: 1;
display: block;
text-decoration: none;
color: $primary-text-color;

&__cover {
object-fit: cover;
width: auto;
max-width: 100%;
max-height: 60vh;
border-radius: 5px;
}

&__name {
font-size: 15px;
font-weight: 700;
margin-top: 5px;
}

&__description {
font-size: 16px;
font-weight: 600;
margin: 5px 0;
}
}
26 changes: 3 additions & 23 deletions source/_assets/sass/author/main.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
@import '../mixins/media';

.author {
&__picture {
width: 100%;
max-width: 100%;
height: auto;

@include above-mobile {
float: left;
padding: 10px;
width: auto;
}
}

&__bio {
padding-top: 1px;
}

&__bio .paragraph {
margin: 5px 0;
}
}
@import './page';
@import './author-card';
@import './author-card-list';
23 changes: 23 additions & 0 deletions source/_assets/sass/author/page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@import '../mixins/media';

.author {
&__picture {
width: 100%;
max-width: 100%;
height: auto;

@include above-mobile {
float: left;
padding: 10px;
width: auto;
}
}

&__bio {
padding-top: 1px;
}

&__bio .paragraph {
margin: 5px 0;
}
}
9 changes: 9 additions & 0 deletions source/_partials/authors/author-card-list.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<section class="author-card-list">
<ul class="author-card-list__list">
@foreach($authors as $author)
<li class="author-card-list__list-item">
@include('_partials.authors.author-card', ['author' => $author])
</li>
@endforeach
</ul>
</section>
11 changes: 11 additions & 0 deletions source/_partials/authors/author-card.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<a title="{{ $author['name'] }}" href="{{ $page->baseUrl . '/autores/' . $author['uid'] }}" class="author-card">
@include('_partials.components.image', [
'url' => $author['picture'],
'alt' => $author['name'],
'title' => $author['name'],
'classes' => ['author-card__cover'],
])

<h2 class="author-card__name">{{ $author['name'] }}</h2>
<p class="author-card__description">{{ $author['description'] }}</p>
</a>
8 changes: 8 additions & 0 deletions source/sobre.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@
Brasileira e para o Brasil nos formatos de áudio, publicações e notícias.
</p>

<h2 class="heading heading__secondary">
E quem faz o PODEntender?
</h2>

<br>
@include('_partials.authors.author-card-list', ['authors' => $page->allAuthors])
<br>

<h2 class="heading heading__secondary">
Então bora começar a ouvir!
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ public function handle(Jigsaw $jigsaw): void
$jigsaw->setConfig('lastEpisode', $latestEpisodeService->execute(1, null)->first());
$jigsaw->setConfig('latestEpisodesPerCategory', $latestEpisodesPerCategory);

$authors = $jigsaw->getCollection('authors')
->map(function ($author) {
return $author->author;
})
->toArray();

$jigsaw->setConfig('allAuthors', $authors);

$jigsaw->getCollection('episodes')
->each(function (PageVariable $page) use ($factory, $recommendationsService) {
// AudioEpisode
Expand Down

0 comments on commit 4e9c30f

Please sign in to comment.