-
Notifications
You must be signed in to change notification settings - Fork 2
/
_top_song.html.erb
53 lines (46 loc) · 1.32 KB
/
_top_song.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<td class="ranked"><%= ranked.rank.to_s.rjust(2, '0') %></td>
<% if ranked.difference > 0 %>
<td class="positive"><%= "+#{ranked.difference}" %></td>
<% elsif ranked.difference < 0 %>
<td class="negative"><%= "#{ranked.difference}" %></td>
<% else %>
<td><%= "#{ranked.difference}" %></td>
<% end %>
<td class="thumb">
<% if !!ranked.song.song_thumbnail %>
<%= image_tag ranked.song.song_thumbnail.small %>
<% end %>
</td>
<td>
<% if !!ranked.song.name and !!ranked.song.mix_name %>
<div class="song_name"><%= ranked.song.name %></div>
<div class="mix_name">(<%= ranked.song.mix_name %>)</div>
<% end %>
</td>
<td class="artist">
<% if !!ranked.song.artist %>
<%= ranked.song.artist %>
<% end %>
</td>
<td class="genre">
<% if !!ranked.song.genres %>
<% if ranked.song.genres.first.id == 15 %>
<% @s = ranked.song.genres.first.name.split(' / ') %>
<div class="genre">
<%= @s[0] %>
</div>
<div class="genre">
<%= @s[-1] %>
</div>
<% else %>
<div class="genre"><%= ranked.song.genres.first.name %></div>
<% end %>
<% end %>
</td>
<% if is_favorite(ranked.song.id) %>
<td class="heart active" url="/favorite/<%= ranked.song.id %>">
<% else %>
<td class="heart" url="/favorite/<%= ranked.song.id %>">
<% end %>
</td>
<td class="download" url="<%= generateQuery(ranked.song) %>"></td>