From 037f16ea801fd451256864f4aea1c2460ebdd501 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Mon, 26 Sep 2011 17:34:18 +0400 Subject: [PATCH] Add single track button --- app/assets/javascripts/player.coffee | 1 + app/assets/stylesheets/albums.scss | 24 ++++++++++++++++++++++++ app/views/artist/_page.html.haml | 15 +++++++++------ config/locales/en.yml | 1 + config/locales/ru.yml | 1 + 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/player.coffee b/app/assets/javascripts/player.coffee index 249b5cb..bbe2e65 100644 --- a/app/assets/javascripts/player.coffee +++ b/app/assets/javascripts/player.coffee @@ -229,3 +229,4 @@ $('.add-album').live 'click', -> item['album'] = album.name _player.addTracks album.tracks false + diff --git a/app/assets/stylesheets/albums.scss b/app/assets/stylesheets/albums.scss index 25a3894..7ab3d2e 100644 --- a/app/assets/stylesheets/albums.scss +++ b/app/assets/stylesheets/albums.scss @@ -37,6 +37,30 @@ } td.song-duration { text-align: right; + .s-duration { + display: block; + padding: 1px 0; + } + .s-add { + display: none; + font-size: 11px; + line-height: 11px; + color: #fafffa; + background-color: #90cc90; + border: #80bb80 1px solid; + border-radius: 3px; + padding: 0 3px 2px 3px; + float: right; + cursor: pointer; + } + } + tr:hover { + .s-duration { + display: none; + } + .s-add { + display: block; + } } } } \ No newline at end of file diff --git a/app/views/artist/_page.html.haml b/app/views/artist/_page.html.haml index d61eb08..30ff5a2 100644 --- a/app/views/artist/_page.html.haml +++ b/app/views/artist/_page.html.haml @@ -7,11 +7,12 @@ .span7.columns.desc %h2= @artist[:artist][:name] = @artist[:artist][:desc] unless @artist[:artist][:desc].nil? - .service-icons - - @artist[:artist][:urls].each do |service| - - if ['wikipedia', 'microblog', 'official_homepage', 'social_network'].include?service.service - %a.foreign-link{ :href => service.url, :target => '_blank' } - = image_tag 'services/'+service.service+(service.service == 'official_homepage' ? '.png' : '.ico') + - unless @artist[:artist][:urls].nil? + .service-icons + - @artist[:artist][:urls].each do |service| + - if ['wikipedia', 'microblog', 'official_homepage', 'social_network'].include?service.service + %a.foreign-link{ :href => service.url, :target => '_blank' } + = image_tag 'services/'+service.service+(service.service == 'official_homepage' ? '.png' : '.ico') - @artist[:albums].each do |album| @@ -26,4 +27,6 @@ - album[:tracks].each do |track| %tr %td.song-title= track[:name] - %td.song-duration= track[:duration] \ No newline at end of file + %td.song-duration + .s-duration= track[:duration] + .s-add{ :data_id => track[:id] }= I18n.t 'player.add_one' \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 5086dbf..b45b80f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -46,6 +46,7 @@ en: player: add: "Add to Now Playing" + add_one: "add" repeat: "Repeat" shuffle: "Shuffle" do_empty: "Empty" \ No newline at end of file diff --git a/config/locales/ru.yml b/config/locales/ru.yml index b9e12d7..38de03d 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -46,6 +46,7 @@ ru: player: add: "Добавить в плей-лист" + add_one: "добавить" repeat: "Повторять" shuffle: "Перемешать" do_empty: "Очистить" \ No newline at end of file