From 032182d8d18c0b020dde953b3ac3c5163e376f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Bucho=CC=88ster?= Date: Fri, 11 Jan 2013 22:48:04 +0100 Subject: [PATCH] Introduces 'image_path' for all image assets --- app/views/artists/_show.html.haml | 12 ++++++------ app/views/home/index.html.haml | 8 ++++---- app/views/layouts/application.html.haml | 10 +++++----- app/views/layouts/application_old.html.haml | 12 ++++++------ app/views/search/_search_form.html.haml | 2 +- app/views/search/index.html.haml | 6 +++--- app/views/sidebar/_index.html.haml | 2 +- app/views/tracks/_list.html.haml | 6 +++--- app/views/users/_show.html.haml | 6 +++--- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/views/artists/_show.html.haml b/app/views/artists/_show.html.haml index de8f66f..cd6c61b 100644 --- a/app/views/artists/_show.html.haml +++ b/app/views/artists/_show.html.haml @@ -2,21 +2,21 @@ #slider = image_tag validate_img_url(artist.image, "artist", :mega) .tabs_js.information - %h1 + %h1 = artist.name - if signed_in? %span.heart %ul.nav - %li= image_tag "icons/artist-info.png" - %li= image_tag "icons/artist-links.png" - %li= image_tag "icons/artist-tags.png" + %li= image_tag image_path("icons/artist-info.png") + %li= image_tag image_path("icons/artist-links.png") + %li= image_tag image_path("icons/artist-tags.png") .content #artist_info %h2 About =raw artist.bio.summary.empty? ? "No information available!" : artist.bio.summary #artist_links %ul - = image_tag "bing.png", :class=>"bing" + = image_tag image_path("bing.png"), :class=>"bing" #artist_tags %h2 Tags %ul @@ -49,4 +49,4 @@ :javascript $(document).ready(function(){ bing_search("#{CGI.escape(artist.name)}"); - }); \ No newline at end of file + }); diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 0e8923b..9c85d56 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,10 +1,10 @@ %ul#top_artist - for file in @files - %li= image_tag "startsite/"+File.basename(file) + %li= image_tag image_path("startsite/"+File.basename(file)) %ul#top_artist_nav - %li= link_to image_tag("startsite/small/beatles.jpg"),"", :class=>"ll dir" - %li= image_tag "startsite/small/katy-perry.jpg", :class=>"cc" - %li= link_to image_tag("startsite/small/coldplay.jpg"),"", :class=>"rr dir" + %li= link_to image_tag(image_path("startsite/small/beatles.jpg")),"", :class=>"ll dir" + %li= image_tag image_path("startsite/small/katy-perry.jpg"), :class=>"cc" + %li= link_to image_tag(image_path("startsite/small/coldplay.jpg")),"", :class=>"rr dir" #search_home %br.clean #home_foot diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 22da9b6..3cd9c56 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -12,14 +12,14 @@ = favicon_link_tag "9minutes-logo.png", :rel=>"icon", :type=>"image/png" = csrf_meta_tag %body - #loading= image_tag "icons/loading_dark.gif", :class=>"loadingimg" + #loading= image_tag image_path("icons/loading_dark.gif"), :class=>"loadingimg" #error Error #block #bg_stripe #site #uuser{:style=>"display:block; color:#ddd;"} #head - %h1= link_to image_tag("nine-minutes.png"), "/#!/home" + %h1= link_to image_tag(image_path("nine-minutes.png")), "/#!/home" = render :partial=>"layouts/player" #navigation %li.active= link_to "home", "/#!/home" @@ -33,9 +33,9 @@ = text_field_tag 'q', params[:q], :class => "text", :placeholder => "Search here ..." = link_to image_tag("icons/search-navi.png", :class=>"button"), "/#!/search" - if user_signed_in? - %li.login= async_link_to image_tag("icons/logout.png"), destroy_user_session_path + %li.login= async_link_to image_tag(image_path("icons/logout.png")), destroy_user_session_path - else - %li.login= async_link_to image_tag("icons/login.png"), new_user_session_path + %li.login= async_link_to image_tag(image_path("icons/login.png")), new_user_session_path %br.clean #content = yield @@ -53,7 +53,7 @@ #headline %h2 Avril Lavigne %h1 Alice (In Wonderland) - #video= image_tag "examples/video-big.jpg" + #video= image_tag image_path("examples/video-big.jpg") .sidebar .top = render :partial=>"layouts/player" diff --git a/app/views/layouts/application_old.html.haml b/app/views/layouts/application_old.html.haml index ac9d4fe..2724315 100644 --- a/app/views/layouts/application_old.html.haml +++ b/app/views/layouts/application_old.html.haml @@ -7,7 +7,7 @@ = stylesheet_link_tag :all = javascript_include_tag "http://www.google.com/jsapi" = javascript_include_tag :all - + = csrf_meta_tag %body #site @@ -19,7 +19,7 @@ =link_to "Sign Out", destroy_user_session_path #head %h1 - = link_to image_tag("9minutes.png"), "/" + = link_to image_tag(image_path("9minutes.png")), "/" = form_tag '/search', :method => 'get', :id => "search_form", :class => "right" do .wrap = text_field_tag 'q', params[:q], :class => "input", :placeholder => "Search for" @@ -64,8 +64,8 @@ #volume =raw '' #icons - = link_to image_tag("ico/player-volume.png"), "javascript:void(0);", :class=>"volume" - = link_to image_tag("ico/player-repeat.png"), "javascript:void(0);", :class=>"repeat" - = link_to image_tag("ico/player-playlist.png"), "javascript:void(0);", :class=>"playlist" + = link_to image_tag(image_path("ico/player-volume.png")), "javascript:void(0);", :class=>"volume" + = link_to image_tag(image_path("ico/player-repeat.png")), "javascript:void(0);", :class=>"repeat" + = link_to image_tag(image_path("ico/player-playlist.png")), "javascript:void(0);", :class=>"playlist" + - \ No newline at end of file diff --git a/app/views/search/_search_form.html.haml b/app/views/search/_search_form.html.haml index df58ab9..9cb2481 100644 --- a/app/views/search/_search_form.html.haml +++ b/app/views/search/_search_form.html.haml @@ -1,4 +1,4 @@ .box#search_bar = form_tag '/search', :method => 'get', :id => "search_bar_form", :remote=>true do = text_field_tag 'q', params[:q], :class => "text", :placeholder => "Search here ..." - = link_to image_tag("icons/search.png", :class=>"button"), "/#!/search" \ No newline at end of file + = link_to image_tag(image_path("icons/search.png"), :class=>"button"), "/#!/search" diff --git a/app/views/search/index.html.haml b/app/views/search/index.html.haml index fce8aeb..d8352e5 100644 --- a/app/views/search/index.html.haml +++ b/app/views/search/index.html.haml @@ -64,11 +64,11 @@ %sub %br.clean = link_to "NACHLADEN", :class => "more" do - = image_tag "ico/more.png" + = image_tag image_path("ico/more.png") #search_tracks = render :partial => "tracks/list", :locals => { :tracks => @tracks, :additional_class => "tab", :count => 26 } %br.clean %br = link_to "NACHLADEN", :class => "more" do - = image_tag "ico/more.png" - \ No newline at end of file + = image_tag image_path("ico/more.png") + diff --git a/app/views/sidebar/_index.html.haml b/app/views/sidebar/_index.html.haml index 5e09883..5224a4c 100644 --- a/app/views/sidebar/_index.html.haml +++ b/app/views/sidebar/_index.html.haml @@ -1,4 +1,4 @@ #sidebar .box.advertisment %sup Advertisment - = image_tag "placeholder/advertisment.png" \ No newline at end of file + = image_tag image_path("placeholder/advertisment.png") diff --git a/app/views/tracks/_list.html.haml b/app/views/tracks/_list.html.haml index 0fcd6e9..bee08bd 100644 --- a/app/views/tracks/_list.html.haml +++ b/app/views/tracks/_list.html.haml @@ -4,7 +4,7 @@ - tracks.track.each_with_index do |track, i| - id = @youtube_client.videos_by(:query => "#{track.name} #{track.artist} official", :page => 1, :per_page => 1, :order_by => "relevance") %li - = image_tag "ico/play.png", :class=>"play", :videoid=>id.videos.first.unique_id - = image_tag "ico/add.png", :class=>"add" + = image_tag image_path("ico/play.png"), :class=>"play", :videoid=>id.videos.first.unique_id + = image_tag image_path("ico/add.png"), :class=>"add" %span= track.name - = link_to trimString(track.artist, 50), "#!/artists/#{CGI.escape(track.artist)}" \ No newline at end of file + = link_to trimString(track.artist, 50), "#!/artists/#{CGI.escape(track.artist)}" diff --git a/app/views/users/_show.html.haml b/app/views/users/_show.html.haml index 000ed27..4cc34d4 100644 --- a/app/views/users/_show.html.haml +++ b/app/views/users/_show.html.haml @@ -3,8 +3,8 @@ .information %h1= (user.username || current_user.email) %ul.nav - %li=image_tag "icons/artist-info.png" - %li=image_tag "icons/artist-links.png" + %li=image_tag image_path("icons/artist-info.png") + %li=image_tag image_path("icons/artist-links.png") %ul.con %li="#{user.playcount} Plays" %li="#{user.playlist.count} Playlists" @@ -24,4 +24,4 @@ = image_tag artist.img_url %br.clean - if user == current_user - %div=render :partial => "edit", :locals => { :user => current_user } \ No newline at end of file + %div=render :partial => "edit", :locals => { :user => current_user }