minor fixes

This commit is contained in:
Tobias Klika
2011-05-03 02:19:06 +02:00
parent 16b8b9a914
commit 163327d010
3 changed files with 18 additions and 11 deletions
+5 -7
View File
@@ -1,14 +1,12 @@
module ApplicationHelper
def validate_img_url image, size
if image.nil?
"noImage"
else
image.each do |img|
if img["size"] == size.to_s
return img["#text"]
image.each do |img|
if img["size"] == size.to_s
if img["#text"].empty?
return "/images/placeholder/artist.png"
end
return img["#text"]
end
end
+9 -2
View File
@@ -10,8 +10,11 @@
.active#search_all
#search_all_artists
%ul.artists
- count = 0
- @resultsArtists.artistmatches.artist.each_with_index do |artist, i|
- break if i == 6
- break if (i >= 6 && count >= 6)
- next unless artist.listeners.to_i > 15
- count += 1
%li
= link_to "LINK" do
= image_tag validate_img_url(artist.image, :large)
@@ -45,8 +48,12 @@
%sub
#search_artists
%ul.artists
- count = 0
- @resultsArtists.artistmatches.artist.each_with_index do |artist, i|
- break if i == 18
- break if (i >= 18 && count >= 18)
- next unless artist.listeners.to_i > 15
- count += 1
%li
= link_to "LINK" do
= image_tag validate_img_url(artist.image, :large)
+4 -2
View File
@@ -1,7 +1,9 @@
$(window).load(function() {
$(function() {
$(".artists li:nth-child(6n)").css("marginRight", 0);
$(".songs.tab li:nth-child(2n)").css("marginRight", 0);
});
$(window).load(function() {
$("ul[steering] li").live("click", function(){
$(this).parent().children().each(function(){