|
1 |
| -<header> |
2 |
| - <h1> |
3 |
| - <span class="back"><%= link_to "〈".html_safe, artists_path, title: "Back" %></span> |
4 |
| - <%= @artist.name %> |
5 |
| - <%= button_to 'Edit', edit_artist_path(@artist), method: 'get' %> |
6 |
| - </h1> |
7 |
| -</header> |
| 1 | +<div class="artist"> |
| 2 | + <header> |
| 3 | + <h1> |
| 4 | + <span class="back"><%= link_to "〈".html_safe, artists_path, title: "Back" %></span> |
| 5 | + <%= image_tag "http://ruby.elastic.co.s3-website-us-east-1.amazonaws.com/demo/music/bands/#{@artist.id}.jpeg", height: '50px', class: 'band' %> |
| 6 | + <%= @artist.name %> |
| 7 | + <%= button_to 'Edit', edit_artist_path(@artist), method: 'get' %> |
| 8 | + </h1> |
| 9 | + </header> |
8 | 10 |
|
9 |
| -<p id="notice"><%= notice %></p> |
| 11 | + <p id="notice"><%= notice %></p> |
10 | 12 |
|
11 |
| -<section class="artist-info"> |
12 |
| - <span><%= @artist.members.to_sentence last_word_connector: ' and ' %></span> | |
13 |
| - <span><%= pluralize @albums.size, 'album' %></span> |
14 |
| - <p class="artist-profile"><%= @artist.profile %></p> |
15 |
| -</section> |
| 13 | + <section class="artist-info"> |
| 14 | + <span><%= @artist.members.to_sentence last_word_connector: ' and ' %></span> | |
| 15 | + <span><%= pluralize @albums.size, 'album' %></span> |
| 16 | + <p class="artist-profile"><%= @artist.profile %></p> |
| 17 | + </section> |
16 | 18 |
|
17 |
| -<section class="albums"> |
18 |
| - <% @albums.each do |album| %> |
19 |
| - <%= div_for album, class: 'clearfix' do %> |
20 |
| - <h3> |
21 |
| - <span class="title"><%= album.title %></span> |
22 |
| - <div class="info"> |
23 |
| - <small><%= album.meta.formats.join(', ') %></small> |
24 |
| - <small><%= album.released %></small> |
| 19 | + <section class="albums"> |
| 20 | + <% @albums.each do |album| %> |
| 21 | + <%= div_for album, class: 'clearfix' do %> |
| 22 | + <h3> |
| 23 | + <span class="title"><%= album.title %></span> |
| 24 | + <div class="info"> |
| 25 | + <small><%= album.meta.formats.join(', ') %></small> |
| 26 | + <small><%= album.released %></small> |
| 27 | + </div> |
| 28 | + </h3> |
| 29 | + |
| 30 | + <div class="cover"> |
| 31 | + <%= image_tag "http://ruby.elastic.co.s3-website-us-east-1.amazonaws.com/demo/music/covers/#{album.id}.jpeg", width: '100px', class: 'cover' %> |
25 | 32 | </div>
|
26 |
| - </h3> |
27 | 33 |
|
28 |
| - <div class="cover"> |
29 |
| - <%= image_tag "http://ruby-demo-assets.s3.amazonaws.com/discogs/covers/#{album.id}.jpeg", width: '100px', class: 'cover' %> |
30 |
| - </div> |
| 34 | + <div class="content"> |
| 35 | + <% album.tracklist.in_groups_of(album.tracklist.size/2+1).each_with_index do |half, g| %> |
| 36 | + <ul class=<%= cycle 'first', 'second' %> start="<%= g < 1 ? 1 : album.tracklist.size/2+2 %>"> |
| 37 | + <% half.compact.each_with_index do |track, i| %> |
| 38 | + <li> |
| 39 | + <i class="counter"><%= g < 1 ? i+1 : i+(g*album.tracklist.size/2+2) %></i> |
| 40 | + <%= track['title'] %> |
| 41 | + <small><%= track['duration'] %></small> |
| 42 | + </li> |
| 43 | + <% end %> |
| 44 | + </ul> |
| 45 | + <% end %> |
| 46 | + </div> |
| 47 | + <% end %> |
31 | 48 |
|
32 |
| - <div class="content"> |
33 |
| - <% album.tracklist.in_groups_of(album.tracklist.size/2+1).each_with_index do |half, g| %> |
34 |
| - <ul class=<%= cycle 'first', 'second' %> start="<%= g < 1 ? 1 : album.tracklist.size/2+2 %>"> |
35 |
| - <% half.compact.each_with_index do |track, i| %> |
36 |
| - <li> |
37 |
| - <i class="counter"><%= g < 1 ? i+1 : i+(g*album.tracklist.size/2+2) %></i> |
38 |
| - <%= track['title'] %> |
39 |
| - <small><%= track['duration'] %></small> |
40 |
| - </li> |
41 |
| - <% end %> |
42 |
| - </ul> |
43 |
| - <% end %> |
44 |
| - </div> |
45 | 49 | <% end %>
|
46 | 50 |
|
47 |
| - <% end %> |
48 |
| - |
49 |
| - <script>$('img').error(function(){ $(this).attr('src', '/images/blank_cover.png'); });</script> |
50 |
| - <script>$(document.location.hash).effect('highlight', 1500)</script> |
51 |
| -</section> |
| 51 | + <script>$('img').error(function(){ $(this).attr('src', '/images/blank_cover.png'); });</script> |
| 52 | + <script>$(document.location.hash).effect('highlight', 1500)</script> |
| 53 | + </section> |
| 54 | +</div> |
0 commit comments