Skip to content

Instantly share code, notes, and snippets.

@jathayde
Created March 10, 2009 14:23
Show Gist options
  • Save jathayde/76903 to your computer and use it in GitHub Desktop.
Save jathayde/76903 to your computer and use it in GitHub Desktop.
<div id="top_ten" class="widget">
<h3 class="sifrdboldgray">Top 10</h3>
<ol>
<% playlist.listings.each_with_index do |listing, i| -%>
<% if i < show %>
<li>
<p class="track_title"><%= truncate(listing.composition.title,20,"...") %></p>
<a class="sm2_link" href="<%= listing.composition.preview_url %>"><span class="hide_me">Preview</span>&nbsp;&nbsp;&nbsp;</a>
<p class="artist_name"><%= !listing.composition.producer_name.blank? ? truncate(listing.composition.producer_name,20,"...") : "No artist listed" %></p>
<%#= link_to_function(image_tag("icon_load_in_player.png", :alt => "Add to Playlist",:title => "Add to Playlist"), "addCompositionToPlayerPlaylist(#{listing.composition.id})") %>
</li>
<% end %>
<% end -%>
</ol>
<h3><a class="load_in_player" href="#" onclick="addPlaylistToPlayerPlaylist(<%=playlist.id%>); return false;">Add to Playlist</a></h3>
</div>
<div id="top_ten" class="widget">
<h2><span class="hide">Top 10</span></h2>
<ol class="">
<% playlist.listings.each_with_index do |listing, i| -%>
<% if i < show %>
<li>
<table>
<tr>
<td class="rank top_ten_<%= i %>"><%= i+1 %></td>
<td class="details top_ten_<%= i %>">
<%= truncate(listing.composition.title,15,"...") %><br />
(<%= truncate(listing.composition.producer_name,15, "...")%>)
</td>
<td class="icon">
<a class="sm2_link" href="<%= listing.composition.preview_url %>">
<span class="hide_me">Preview</span>&nbsp;&nbsp;&nbsp;
</a>
<%#= link_to_function(image_tag("icon_load_in_player.gif", :alt => "Queue in player",:title => "Queue in player"), "addCompositionToPlayerPlaylist(#{listing.composition.id})") %>
</td>
</tr>
</table>
</li>
<% end %>
<% end -%>
</ol>
<h3><a class="load_in_player" href="#">Load in PLayer</a></h3>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment