Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

UI tweaks.

  • Loading branch information...
commit 946245489b0368c58a0226e9b74452c5c243e854 1 parent cbc56d8
@pwnall authored
View
5 app/helpers/listings_helper.rb
@@ -8,7 +8,8 @@ def emphasize_listing_search
enable_listing_search && ListingPin.where('score > 0').count == 0
end
- def google_maps_link(location)
- link_to location, "http://maps.google.com?q=loc:#{URI.encode location}"
+ def google_maps_link(location, caption = nil)
+ link_to caption || location,
+ "http://maps.google.com?q=loc:#{URI.encode location}"
end
end
View
5 app/models/listing.rb
@@ -9,6 +9,11 @@ def location=(new_location)
self.lat, self.lng = geocode[:lat], geocode[:lng]
end
+ def location_query
+ return location if / us^/ =~ location
+ [location, city].join ' near '
+ end
+
def self.for_url(url)
where(:cl_url => url).first || new(:cl_url => url)
end
View
4 app/views/listings/_search_result.html.erb
@@ -2,7 +2,9 @@
<div class="header">
<span class="price">$<%= listing.price %></span>
<span class="rooms"><%= pluralize listing.rooms, 'room' %></span>
- <span class="location"><%= google_maps_link listing.location %></span>
+ <span class="location">
+ <%= google_maps_link listing.location_query, listing.location %>
+ </span>
</div>
<div class="description">
<%= listing.title %>
View
2  app/views/listings/pin.js.rjs
@@ -1 +1 @@
-page['search_result_listing_' + @listing.id.to_s].fade
+page['search_result_listing_' + @listing.id.to_s].fade :duration => 0.3
Please sign in to comment.
Something went wrong with that request. Please try again.