]> git.openstreetmap.org Git - rails.git/commitdiff
Add recent nodes to start of tab, and return false from onclick actions
authorChristopher Schmidt <crschmidt@crschmidt.net>
Tue, 22 Apr 2008 04:28:37 +0000 (04:28 +0000)
committerChristopher Schmidt <crschmidt@crschmidt.net>
Tue, 22 Apr 2008 04:28:37 +0000 (04:28 +0000)
app/controllers/browse_controller.rb
app/views/browse/_start.rhtml
app/views/browse/start.rjs

index b56e4f17e7214437be98d431399fac0b4be30a72..a6c0e0ae205fb8d745078053df7e2a1ce0f51812 100644 (file)
@@ -2,7 +2,8 @@ class BrowseController < ApplicationController
   before_filter :authorize_web  
   layout 'site'
 
   before_filter :authorize_web  
   layout 'site'
 
-  def start
+  def start 
+    @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)  
   end
   def index
     @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)  
   end
   def index
     @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)  
index 616cd7d024c11a9631274edc393a1d3fe701c5c4..10316c3833b565c3b0543c0922090f684508ee24 100644 (file)
   </div>
 
 <div id="status"></div>
   </div>
 
 <div id="status"></div>
-<div id="object"></div>
+<div id="object">
+<h3>Recent Changes</h3>
+<ul>
+<% @nodes.each do |node| %>
+<li><%= node.id %> @ <a href="#" onclick="setMapCenter(new OpenLayers.LonLat(<%= node.lon.to_s %>, <%= node.lat.to_s %>), 16); return false;"><%= node.lat.to_s %>,<%= node.lon.to_s %></a></li>
+<% end %>
+</ul>
+</div>
 </div>
 </div>
index 0b0681ce5ab4f7705cb2a9972d0509a1b0f02391..0d8b3288c5002bb5d14c6b9b4ecdf8be802cd2c6 100644 (file)
@@ -47,7 +47,8 @@ page << <<EOJ
     function useMap() {
         var bounds = map.getExtent();
         setBounds(bounds);
     function useMap() {
         var bounds = map.getExtent();
         setBounds(bounds);
-        getData(bounds); 
+        getData(bounds);
+        return false;
     }
     $("use_map").onclick = useMap;
     
     }
     $("use_map").onclick = useMap;
     
@@ -136,6 +137,7 @@ page << <<EOJ
     function loadObjList() {
         $("object").innerHTML="";
         $("object").appendChild(objList);
     function loadObjList() {
         $("object").innerHTML="";
         $("object").appendChild(objList);
+        return false;
     }
       
     function onFeatureSelect(feature) {
     }
       
     function onFeatureSelect(feature) {