From 6be5868588c371ad25c9a7943b44d9caace59bf8 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Mon, 26 Sep 2011 14:51:52 +0400 Subject: [PATCH] Service icons --- app/assets/images/services/lastfm.ico | Bin 0 -> 1150 bytes app/assets/images/services/microblog.ico | Bin 0 -> 1150 bytes app/assets/images/services/official_homepage.png | Bin 0 -> 1190 bytes app/assets/images/services/social_network.ico | Bin 0 -> 152 bytes app/assets/images/services/wikipedia.ico | Bin 0 -> 318 bytes app/assets/javascripts/page.coffee | 4 ++++ app/assets/stylesheets/albums.scss | 7 +++++++ app/controllers/artist_controller.rb | 5 +++-- app/views/artist/_page.html.haml | 5 +++++ 9 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 app/assets/images/services/lastfm.ico create mode 100644 app/assets/images/services/microblog.ico create mode 100644 app/assets/images/services/official_homepage.png create mode 100644 app/assets/images/services/social_network.ico create mode 100644 app/assets/images/services/wikipedia.ico diff --git a/app/assets/images/services/lastfm.ico b/app/assets/images/services/lastfm.ico new file mode 100644 index 0000000000000000000000000000000000000000..80cf74ce68538468233ae3d6498b146eb3eaeb6f GIT binary patch literal 1150 zcmbu9T}YEr9L8TuiY#%M`MGI2XW7h*DO+1JW@Hv*5m}H#U3wWo7v2q`yP%s0@}em6 zdz-$g3ulHJQcW$Hn@f>>Y0gRwO`Tu$^nZ_9wrRndXF>6`Hl{y* z>Og#Q6|&V0xL@YP!R%Vh1(wj=GX{ma9uYAWP-&~Nu&|8EnnB8%u{-evo>UC5ym((d zqLMlokrFe?9y-`JE=%?&UM5nfcZ}MRB>pY@Unh~4ULv$lf z)`C(03|?FPQ0f}ta89zEPz?1RWGLGaE3+cufE8tr2HAV$s#YY(-;vgZi&s0@{!)Dx z47?iw`j3+9oyb(T(D@d`r@w(%ZbRZ>Ckik3u)Su>FtT#nP*Bu~A=ebfC*~o`ZbdEc z#i!46IC7#HCojCh$mkqOZw;}mROLZ(PCstyKVW8diJc>qfuU&>Ug;&zfn#TT;r7n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ruCYB-LPGn!NQdT|ZlRy+(fw^-+`=%+gee_kY4FWHg<*4sZI8+sFJD270UUORdLHO0nA4V) z%{fwsET5CQ>B?eK%uw4yQc~9?*JVo2}ze(;aRcp*ceL#HUJSllrgm5wQKR zQu+C;QrUh^8rFfA`ftFz{YAidi-`aL010qNS#tmY0{j2~0{j7_C!{a{00CY}L_t(2 z6ZH~G$#aXhaiM$IAG69oAPc&Gynhq literal 0 HcmV?d00001 diff --git a/app/assets/images/services/social_network.ico b/app/assets/images/services/social_network.ico new file mode 100644 index 0000000000000000000000000000000000000000..7f0e6bf50fe76b67664d011a99bfd8b3934cd094 GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`@t!V@Ar`&KKmPx>XI7Q)iEuw> z!F=Su=aKXYyb7Vl62iF-PDfw;Uw^;$CqJ`_bicHu%LU}>W8O*Rxxq3541fOqVUU!NWSB8y2E&b;HyFYr!WpWns~C3f+R0#JWy8<` z2YnhH`#_v#>yB^`onF>gt^uUwukEdp0Ma#X@ev{&9gS?=-(Rc(DeL~+vA3h+r9>A` whvSQmlNy@~Gx{>Rr+TbRifD;wtm`n}BGnT0#;(nF$DQ3VKm)J>h%d+|0VGXX9smFU literal 0 HcmV?d00001 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|