1
0
Fork 0

Search fix

This commit is contained in:
magnolia-fan 2011-04-11 07:12:06 +04:00
parent b5e2563bf9
commit 242c170a41
8 changed files with 49 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -1,10 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>BeatHaven</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :all %>
<%= csrf_meta_tag %>
<title>BeatHaven</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :all %>
<%= csrf_meta_tag %>
</head>
<body>
<div id="contents">

View File

@ -13,7 +13,6 @@
</script>
<div class="search">
<h1>SEARCH</h1>
<%= form_tag('/artist', :method => 'post') %>
<%= text_field_tag 'name', nil %>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -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;
}

View File

@ -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;
}