Skip to content

Commit

Permalink
Fix multi-byline (#24)
Browse files Browse the repository at this point in the history
Fix multi-byline
  • Loading branch information
mansona committed May 6, 2019
2 parents ead14d6 + 6b4e6ee commit 69fa9c8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 17 deletions.
29 changes: 14 additions & 15 deletions addon/templates/components/byline-multiple.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,41 @@

<div class="post-full-authors-content">
<p>This post was a collaboration between</p>
<p>{{authors}}</p>
</div>

<ul class="author-list">
{{#foreach authors}}
{{#each @authors as |author|}}
<li class="author-list-item">

<div class="author-card">
<div class="basic-info">
{{#if profile_image}}
<img class="author-profile-image" src="{{img_url profile_image size="xs"}}" alt="{{name}}" />
{{#if author.image}}
<img class="author-profile-image" src={{author.image}} alt={{author.name}} />
{{else}}
<div class="author-profile-image">{{svg-icons/avatar}}</div>
{{/if}}
<h2>{{name}}</h2>
<h2>{{author.name}}</h2>
</div>
<div class="bio">
{{#if bio}}
<p>{{bio}}</p>
<p><a href="{{url}}">More posts</a> by {{name}}.</p>
{{#if author.content}}
<p>{{author.content}}</p>
<p>{{#link-to 'author' author.id}}More posts{{/link-to}} by {{author.name}}.</p>
{{else}}
<p>Read <a href="{{url}}">more posts</a> by this author.</p>
<p>Read {{#link-to 'author' author.id}}more posts{{/link-to}} by this author.</p>
{{/if}}
</div>
</div>

{{#if profile_image}}
<a href="{{url}}" class="moving-avatar">
<img class="author-profile-image" src="{{img_url profile_image size="xs"}}" alt="{{name}}" />
</a>
{{#if author.image}}
{{#link-to 'author' author.id class="moving-avatar"}}
<img class="author-profile-image" src={{author.image}} alt={{author.name}} />
{{/link-to}}
{{else}}
<a href="{{url}}" class="moving-avatar author-profile-image">{{svg-icons/avatar}}</a>
{{#link-to 'author' author.id class="moving-avatar author-profile-image"}}{{svg-icons/avatar}}{{/link-to}}
{{/if}}

</li>
{{/foreach}}
{{/each}}

</ul>

Expand Down
2 changes: 1 addition & 1 deletion app/templates/post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ into the {body} of the default.hbs template --}}
from includes/byline-multiple.hbs, otherwise, we just use the
default byline. --}}

{{#if (gt posts.authors.length 1)}}
{{#if (gt post.authors.length 1)}}
<BylineMultiple @authors={{post.authors}} />
{{else}}
<BylineSingle @author={{post.authors.firstObject}} />
Expand Down
12 changes: 12 additions & 0 deletions tests/dummy/author/chris.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Chris Manson
id: chris
image: /images/chris.jpg
cover:
website:
twitter: real_ate
facebook:
location: Dublin, Ireland
---
Chris Manson is the creator of empress-blog and a member of the Ember Core
Learning team. Feel free to delete this user when creating your own content.
2 changes: 1 addition & 1 deletion tests/dummy/content/ember.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ imageMeta:
attributionLink: https://unsplash.com/photos/OM4TjQwHC1I
featured: true
authors:
- ghost
- chris
date: Tue Jun 12 2018 17:50:59 GMT+0100 (IST)
tags:
- getting-started
Expand Down
1 change: 1 addition & 0 deletions tests/dummy/content/managing-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ imageMeta:
attributionLink:
featured: true
authors:
- chris
- ghost
date: Tue Jun 12 2018 17:55:01 GMT+0100 (IST)
tags:
Expand Down
Binary file added tests/dummy/public/images/chris.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 69fa9c8

Please sign in to comment.