Skip to content

Commit

Permalink
add simple layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayman committed Nov 23, 2014
1 parent 7d9358a commit 8468dfc
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
34 changes: 33 additions & 1 deletion client/views/radios/radio.html
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>
17 changes: 17 additions & 0 deletions client/views/radios/radio.js
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;
},
});

0 comments on commit 8468dfc

Please sign in to comment.