Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic latest featured #438

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/about/intro/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import ChannelsIndexRoute from 'radio4000/channels/index/route'

export default ChannelsIndexRoute.extend({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here either:

  • just a normal route
  • or do not rewrite the model hook

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote 2, so it's not just "latest featured" but random like on the homepage. But both work of course :]

model() {
return this.store.findAll('channel')
return this.store.query('channel', {
orderBy: 'isFeatured',
equalTo: true,
limitToLast: 10
});
}
})
20 changes: 11 additions & 9 deletions app/about/intro/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@
<section class="Section">
<div class="Container Container--full">
<div class="Grid Grid--center Grid--vcenter Grid--firstHidden">
{{#each model as |item|}}
{{#if model}}
{{#each model as |item|}}
<div class="Grid-cell">
{{channel-card channel=item}}
</div>
{{/each}}
<div class="Grid-cell">
{{channel-card channel=item}}
<div class="ChannelCard ChannelCard--text">
<p>Tap a channel to play it!</p>
<p>Each channel is as unique as the person who is crafting it. <a href="{{href-to 'channels.search'}}" title="">Go to all radios</a>.</p>
</div>
</div>
{{/each}}
<div class="Grid-cell">
<div class="ChannelCard ChannelCard--text">
<p>Simply tap a channel to play it!</p>
<p>Each channel is as unique as the person who is crafting it. <a href="{{href-to 'channels.search'}}" title="">Go to all radios</a>.</p>
</div>
</div>
{{/if}}
</div>
</div>
</section>
Expand Down