72 lines
1.6 KiB
Plaintext
72 lines
1.6 KiB
Plaintext
|
|
|
|
|
|
-if params[:place_lat] and params[:place_lat] != ""
|
|
|
|
%script
|
|
="center = new google.maps.LatLng(#{params[:place_lat]},#{params[:place_lng]});"
|
|
|
|
-if false
|
|
-if params[:place_lat] and params[:place_lat] != ""
|
|
:javascript
|
|
marker.setPosition(center );
|
|
|
|
google.maps.event.trigger(map,'resize');
|
|
map.panTo(center);
|
|
%script
|
|
="radiusWidget.set('distance', #{params[:place_dist]});"
|
|
radiusWidget.center_changed();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-i = 0
|
|
-@annonces_small = @annonces.where("big_annonce_expire IS NULL or big_annonce_expire < ?", Date.today)
|
|
-@show_ids = []
|
|
-@sub_i = 0
|
|
-show_i = 0
|
|
-@annonces.each do |annonce|
|
|
-if @annonces[i] and !@show_ids.include?(@annonces[i].id)
|
|
=render @annonces[i]
|
|
-show_i = show_i + 1
|
|
-@show_ids << @annonces[i].id
|
|
|
|
|
|
-show_i = show_i + 1 if @annonces[i].big_annonce_expire? and @annonces[i].big_annonce_expire >= Date.today
|
|
|
|
-i = i+1
|
|
|
|
-if show_i.odd? and @annonces[i] and @annonces[i].big_annonce_expire? and @annonces[i].big_annonce_expire >= Date.today
|
|
-test= "test"
|
|
-next_small = @annonces_small.where("annonces.id NOT IN (?)",@show_ids).first
|
|
-if next_small
|
|
=render next_small
|
|
-@show_ids << next_small.id
|
|
-show_i = show_i + 1
|
|
-else
|
|
-i = i+1
|
|
-@sub_i = @sub_i + 1
|
|
|
|
|
|
|
|
|
|
.clear
|
|
-if !@no_paginate
|
|
.pagination= paginate @annonces, :remote => true
|
|
:javascript
|
|
init_radius_form();
|
|
-if false
|
|
-if @place_search
|
|
:javascript
|
|
$("#search_map").show();
|
|
google.maps.event.trigger(map,'resize');
|
|
|
|
-else
|
|
:javascript
|
|
$("#search_map").hide();
|
|
|
|
:javascript
|
|
|
|
init_radius_form(); |