From 242c170a41749462b0f2031393dad3cfdc849b93 Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Mon, 11 Apr 2011 07:12:06 +0400 Subject: [PATCH] Search fix --- app/controllers/artist_controller.rb | 6 ++-- app/controllers/track_controller.rb | 6 +--- app/views/layouts/application.html.erb | 10 +++--- app/views/main/index.html.erb | 1 - php-bak/favicon.ico | Bin 67646 -> 0 bytes public/favicon.ico | Bin 0 -> 1150 bytes public/stylesheets/beathaven.css | 8 ++--- public/stylesheets/search-autocomplete.css | 40 +++++++++++++++++---- 8 files changed, 49 insertions(+), 22 deletions(-) delete mode 100644 php-bak/favicon.ico diff --git a/app/controllers/artist_controller.rb b/app/controllers/artist_controller.rb index 72138b6..06289e8 100644 --- a/app/controllers/artist_controller.rb +++ b/app/controllers/artist_controller.rb @@ -5,10 +5,12 @@ class ArtistController < ApplicationController if params[:name].nil? name = '' else - name = params[:name].gsub('+', ' ').gsub('%20', ' ') + if request.request_method == 'POST' + redirect_to :action => 'view', :name => params[:name].gsub(' ', '+') + end + name = params[:name].gsub('+', ' ') end @artist = Artist.getByName(name) - pp @artist end def autocomplete diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 4e284a5..022d486 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -7,11 +7,7 @@ class TrackController < ApplicationController pp album = Album.where(:id => release.album_id).first pp artist = Artist.where(:id => album.artist_id).first - data = Vkontakte.get(artist.name, track.name, (track.length / 1000).round) - #data = open('/Users/chez/Sites/beathaven/tmp/media.mp3').read - #send_data data, :type=>"audio/mp3" + url = Vkontakte.get(artist.name, track.name, (track.length / 1000).round) - #render :text => data - redirect_to data end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 42945f8..939b498 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,10 +1,12 @@ - BeatHaven - <%= stylesheet_link_tag :all %> - <%= javascript_include_tag :all %> - <%= csrf_meta_tag %> + BeatHaven + + + <%= stylesheet_link_tag :all %> + <%= javascript_include_tag :all %> + <%= csrf_meta_tag %>
diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index 2acb3cf..8634c2f 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -13,7 +13,6 @@ diff --git a/php-bak/favicon.ico b/php-bak/favicon.ico deleted file mode 100644 index 273bb046059943e4f30b2eb8c047c18e9bbe559b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67646 zcmeI52bdmZx%X#7?>z(pgwPU7=)Hx25C|Ov5jf!CgAYRaE)E?1rIR``#ly<=D zIvxQ*iXc&%bP^zB`(`%@qFx$%R3zW;H+k>Pvy*q1U9!6=%;vf?^Sm?fJSJz7<)+Be!XwMMY+wE z0Q;qpWh$~{g$s-FJ(YF;cn)jtV!a%)DzZAV8nObi6you+9T(3w2<*jrEo2z72{IfR zf~h^H z*pGem(MQi;W|?Iso_+S&w^BX`*$?r!=Xt*0^ZTVASajP!8`ht%i;P0{LH2*_vB%C^ zdF7QSvevE@X}a{%ORwYevB((2ykHn&|G++?@uTEG|FnVjrSw-Do6DKgt%q!j?2g_4 zzm-;6N$i`KUV7=eL4yW0u-|y?wbx$Baec$yh+G+p*e6g&iGSa=ftW9a#Q2MLrmglh z57cSwH?JG^qaXd~nezGc1=WI8|~be98i}$TjK7!?;g9{a?8CT_De3gWC!-a0sX=1tFQjXE3dqA zD(4#~>?3T1I7TE-`?6l2Mt>4mXpiE)0b;(btdBSjXFKZ~`m}v6x#W_)!TfbFZWa3! ze`7$1$G6&QtEb<8|NWz=gK@x^Vcp6&Fn^c?_O_$GcoW1t%YL_ZwguuCoZR>%_^Ur; z9_}1)zyW80?XSSSp@_fsANafFys5_>cig?`I{+!;!2IDZ7W#YbdS%2s+;Ns&ko}Oc z$Uew+h<0YK=K1qr*v)62-|bw^q)C&qb=Fzu3b36H{`Ex;r1-;!dd_RP=9+7+M6W); zKH+er><{z~m%!e*u5TCL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(uX^o-i|;TjAQ8+1a^s%O7PmA7#5{9TomCtNAe7b8dN7Rx>NxAj>YVTpm@kvQ_4m zCuB7+(mO1ZUCo{;UGH_(KR@&=vCt=zB;SX((hGaFVYuaY-l9JfJi;JM|MJC#4o zR<2EtQ!X4|rc-%VwoDE{==(>ZTs;0^;rN0s7wcE8oVJI@)AGzh`+QuvHQTxqKCRhS zoyrryUp!kg|F8$jzFlQ*`NX^o`SRnn@JoY>vV5})S@YxaQvvYhz#zuJz@P!dKp~(AL>x$gfiO1%0|>*w|Ns9PXn}#|Gr`P7 zX2Znr(2PL!j4*ka-rU?=@AC5UR+u;%&DhY;0J4t>rgzn!1tCy%(l$0W=0LfZ z&CSh0ATc0dMl%B*4)f;Ci`3E4c_}3;RRS{8&d%=IhOHZPfqK$RO-;{$#Grb??)>=i zqtKNrS4ln$?#!GyQxYh?4CtN;kT?*q zK;?@W85v&+3JPA8k&(GBD=T|dTul6>g@py!{z;Q2u`4Mloe2sGGS$$~XxG=*p9s|t zwjXG3nTUwU2cWxegY*N{UIDUS0^M8;QnzvAMqW)#%}dVC&U!#M^{cC^cO%;mbXyoJ zE9*&4PR_kRH$0M;m%py4sQBF4+PV~^uD!k80ch^+ZQHi-0sXm4Qc^M%SwAwHjg2iB z=>JA0ReqrI6eUCuY{_b z`{cjZA#0KH0sHjjWDXAAg|HXKGMt;Di2cHVRSt0RZWY3(o)m literal 0 HcmV?d00001 diff --git a/public/stylesheets/beathaven.css b/public/stylesheets/beathaven.css index be5e4cc..8f69b94 100644 --- a/public/stylesheets/beathaven.css +++ b/public/stylesheets/beathaven.css @@ -99,9 +99,9 @@ body { .search #name { width: 300px; - border: 1px solid ##bdbdbd; - background: #555555; - color: #ffffff; - font-size: 1.1em; + border: #AAA 3px solid; + border-radius: 7px; + font-size: 1.5em; + padding: 0.2em; } diff --git a/public/stylesheets/search-autocomplete.css b/public/stylesheets/search-autocomplete.css index ec11895..7ff5ef0 100644 --- a/public/stylesheets/search-autocomplete.css +++ b/public/stylesheets/search-autocomplete.css @@ -1,7 +1,35 @@ - -.autocomplete-w1 { background:url(../images/shadow.png) no-repeat bottom right; position:absolute; top:0px; left:0px; margin:8px 0 0 6px; /* IE6 fix: */ _background:none; _margin:0; } -.autocomplete { border:1px solid #999; background:#FFF; cursor:default; text-align:left; max-height:350px; overflow:auto; margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px; _margin:0; _overflow-x:hidden; } -.autocomplete .selected { background:#F0F0F0; } -.autocomplete div { padding:2px 5px; white-space:nowrap; } -.autocomplete strong { font-weight:normal; color:#3399FF; } +.autocomplete-w1 { + background: url(../images/shadow.png) no-repeat bottom right; + position: absolute; + top: 0px; + left: 0px; + margin: 8px 0 0 6px; + /* IE6 fix: */ + _background: none; + _margin: 0; +} +.autocomplete { + border:1px solid #999; + background:#FFF; + cursor:default; + text-align:left; + max-height:350px; + overflow:auto; + margin:-6px 6px 6px -6px; + /* IE6 specific: */ + _height: 350px; + _margin: 0; + _overflow-x: hidden; +} +.autocomplete .selected { + background: #F0F0F0; +} +.autocomplete div { + padding: 2px 5px; + white-space: nowrap; +} +.autocomplete strong { + font-weight: normal; + color: #3399FF; +}