diff --git a/client/views/radios/radio.html b/client/views/radios/radio.html index a6a4630..a1a1a4e 100644 --- a/client/views/radios/radio.html +++ b/client/views/radios/radio.html @@ -1,3 +1,35 @@ - Radio + + + {{> searchBar viewToggle=0 collection="Playlists" playlistId=this._id }} + + {{#each radioSongs}} + {{> radioSong}} + {{/each}} + + + {{title}} + Stuff + + + + + + + + + + + {{song.snippet.title}} + Added by xxx on xxx + + + {{#each votes}} + {{> circleAvatar}} + {{/each}} + + + + + diff --git a/client/views/radios/radio.js b/client/views/radios/radio.js new file mode 100644 index 0000000..03f13ea --- /dev/null +++ b/client/views/radios/radio.js @@ -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; + }, +});
Stuff
{{song.snippet.title}}