diff --git a/Gemfile.lock b/Gemfile.lock index 0b9ded7..4063c6d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -71,7 +71,7 @@ GEM nokogiri (1.5.0) pg (0.11.0) polyglot (0.3.2) - rack (1.3.3) + rack (1.3.4) rack-cache (1.0.3) rack (>= 0.4) rack-mount (0.8.3) @@ -98,7 +98,7 @@ GEM rake (0.9.2) rdoc (3.9.4) sass (3.1.8) - sprockets (2.0.1) + sprockets (2.0.2) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) diff --git a/app/assets/javascripts/player.coffee b/app/assets/javascripts/player.coffee index bbe2e65..fb08540 100644 --- a/app/assets/javascripts/player.coffee +++ b/app/assets/javascripts/player.coffee @@ -230,3 +230,10 @@ $('.add-album').live 'click', -> _player.addTracks album.tracks false +$('.s-add').live 'click', -> + artist = $('.artist-info h2').text() + album = _player.albums[$(this).attr('data-album-id')] + item = album.tracks[$(this).attr('data-id')-1] + item['artist'] = artist + item['album'] = album.name + _player.addTracks [item] diff --git a/app/views/artist/_page.html.haml b/app/views/artist/_page.html.haml index 30ff5a2..0fbc96b 100644 --- a/app/views/artist/_page.html.haml +++ b/app/views/artist/_page.html.haml @@ -22,11 +22,11 @@ .button-container %a.btn.add-album{ :'data-album-id' => album[:id] }= I18n.t 'player.add' .span7.columns.tracks - %h3= album[:name] + " (" + album[:year].to_s + ")" + %h3{ :'data-album-id' => album[:id] }= album[:name] + " (" + album[:year].to_s + ")" %table.zebra-striped.tracklist - album[:tracks].each do |track| %tr %td.song-title= track[:name] %td.song-duration .s-duration= track[:duration] - .s-add{ :data_id => track[:id] }= I18n.t 'player.add_one' \ No newline at end of file + .s-add{ :'data-album-id' => album[:id], :'data-id' => track[:id] }= I18n.t 'player.add_one' diff --git a/beathaven.tmproj b/beathaven.tmproj index 0aabf2e..c66dfb0 100644 --- a/beathaven.tmproj +++ b/beathaven.tmproj @@ -21,28 +21,134 @@ 200 metaData + app/assets/javascripts/player.coffee + + caret + + column + 6 + line + 202 + + firstVisibleColumn + 0 + firstVisibleLine + 179 + + app/assets/stylesheets/albums.scss + + caret + + column + 20 + line + 47 + + firstVisibleColumn + 0 + firstVisibleLine + 11 + + app/assets/stylesheets/player.scss + + caret + + column + 0 + line + 74 + + columnSelection + + firstVisibleColumn + 0 + firstVisibleLine + 37 + selectFrom + + column + 5 + line + 86 + + selectTo + + column + 0 + line + 74 + + app/controllers/artist_controller.rb caret column - 62 + 55 line - 91 + 98 firstVisibleColumn 0 firstVisibleLine - 54 + 0 + + app/views/artist/_page.html.haml + + caret + + column + 43 + line + 31 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + + config/locales/en.yml + + caret + + column + 17 + line + 48 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + + config/locales/ru.yml + + caret + + column + 22 + line + 48 + + firstVisibleColumn + 0 + firstVisibleLine + 0 openDocuments app/controllers/artist_controller.rb + app/views/artist/_page.html.haml + config/locales/en.yml + app/assets/stylesheets/player.scss + app/assets/stylesheets/albums.scss + app/assets/javascripts/player.coffee + config/locales/ru.yml showFileHierarchyDrawer windowFrame - {{0, 91}, {1280, 1327}} + {{0, 78}, {1680, 950}}