-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
<template name="radio"> | ||
Radio | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
{{> searchBar viewToggle=0 collection="Playlists" playlistId=this._id }} | ||
|
||
{{#each radioSongs}} | ||
{{> radioSong}} | ||
{{/each}} | ||
</div> | ||
<div class="col-md-4"> | ||
<h1>{{title}}</h1> | ||
<p>Stuff</p> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<template name="radioSong"> | ||
<div class="row"> | ||
<div class="col-md-1"> | ||
<img src="{{song.snippet.thumbnails.default.url}}" class="img-responsive" alt="Responsive image"> | ||
</div> | ||
<div class="col-md-6"> | ||
<p><strong>{{song.snippet.title}}</strong></p> | ||
<small>Added by xxx on xxx</small> | ||
</div> | ||
<div class="col-md-4"> | ||
{{#each votes}} | ||
{{> circleAvatar}} | ||
{{/each}} | ||
</div> | ||
<div class="col-md-1"> | ||
<button><span class="glyphicon glyphicon-chevron-up"></span></button> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Template.radio.helpers({ | ||
radioSongs: function () { | ||
var radioSongs = RadioSongs.find({radioId: this._id}).fetch(); | ||
|
||
_.each(radioSongs, function (rs) { | ||
var songInfo = Songs.findOne({_id: rs.songId}); | ||
|
||
rs.votes = _.map(rs.votes, function (vote) { | ||
return Meteor.users.findOne({_id: vote}); | ||
}); | ||
|
||
rs.song = songInfo; | ||
}); | ||
|
||
return radioSongs; | ||
}, | ||
}); |