diff --git a/app/assets/images/services/lastfm.ico b/app/assets/images/services/lastfm.ico new file mode 100644 index 0000000..80cf74c Binary files /dev/null and b/app/assets/images/services/lastfm.ico differ diff --git a/app/assets/images/services/microblog.ico b/app/assets/images/services/microblog.ico new file mode 100644 index 0000000..00450d4 Binary files /dev/null and b/app/assets/images/services/microblog.ico differ diff --git a/app/assets/images/services/official_homepage.png b/app/assets/images/services/official_homepage.png new file mode 100644 index 0000000..8230b46 Binary files /dev/null and b/app/assets/images/services/official_homepage.png differ diff --git a/app/assets/images/services/social_network.ico b/app/assets/images/services/social_network.ico new file mode 100644 index 0000000..7f0e6bf Binary files /dev/null and b/app/assets/images/services/social_network.ico differ diff --git a/app/assets/images/services/wikipedia.ico b/app/assets/images/services/wikipedia.ico new file mode 100644 index 0000000..31b0e38 Binary files /dev/null and b/app/assets/images/services/wikipedia.ico differ diff --git a/app/assets/javascripts/page.coffee b/app/assets/javascripts/page.coffee index 65bcc1b..ebfe681 100644 --- a/app/assets/javascripts/page.coffee +++ b/app/assets/javascripts/page.coffee @@ -43,4 +43,8 @@ $ -> false $('.dropdown-menu li a').live 'click', -> $(this).parent().parent().parent().toggleClass('open') + false + $('.foreign-link').live 'click', -> + # window.open($(this).attr('href')) + e.preventDefault(); false \ No newline at end of file diff --git a/app/assets/stylesheets/albums.scss b/app/assets/stylesheets/albums.scss index 9805228..25a3894 100644 --- a/app/assets/stylesheets/albums.scss +++ b/app/assets/stylesheets/albums.scss @@ -9,6 +9,13 @@ } .desc { height: 220px; + .service-icons { + margin-top: 15px; + a { + text_decoration: none; + margin-right: 10px; + } + } } } diff --git a/app/controllers/artist_controller.rb b/app/controllers/artist_controller.rb index c524a2d..c09a22f 100644 --- a/app/controllers/artist_controller.rb +++ b/app/controllers/artist_controller.rb @@ -78,9 +78,10 @@ class ArtistController < ApplicationController id: artist.id, name: artist.name, desc: ActionController::Base.helpers.strip_tags(artist.desc), - pic: artist.pic_url + pic: artist.pic_url, + urls: artist.artist_links } - + ap artist.artist_links media_types = @@default_album_types session = Session.find_by_key(session_key) unless session.nil? diff --git a/app/views/artist/_page.html.haml b/app/views/artist/_page.html.haml index 5b727b1..d61eb08 100644 --- a/app/views/artist/_page.html.haml +++ b/app/views/artist/_page.html.haml @@ -7,6 +7,11 @@ .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') - @artist[:albums].each do |album|