<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -168,11 +168,11 @@ class Report &lt; ActiveRecord::Base
     else
       html &lt;&lt; %Q{&lt;br /&gt;&lt;img src=&quot;#{self.reporter.icon}&quot; class=&quot;profile&quot; /&gt;}
     end
-    if(item.rating.nil?)
+    if(self.rating.nil?)
       rating_icon = &quot;/images/rating_none.png&quot;
-    elsif(item.rating &lt;= 30)
+    elsif(self.rating &lt;= 30)
       rating_icon = &quot;/images/rating_bad.png&quot;
-    elsif (item.rating &lt;= 70)
+    elsif (self.rating &lt;= 70)
       rating_icon = &quot;/images/rating_medium.png&quot;
     else
       rating_icon = &quot;/images/rating_good.png&quot;</diff>
      <filename>app/models/report.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,10 @@
 	&lt;div class=&quot;filters&quot;&gt;
 	&lt;h2&gt;Available filters:&lt;/h2&gt;
 	&lt;ul class=&quot;nobullets&quot;&gt;
+		&lt;li&gt;View state-by-state: &lt;%= state_select %&gt;&lt;/li&gt;
 		&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;return updateMap('count=100')&quot;&gt;Show last 100 reports&lt;/a&gt;&lt;/li&gt;
 		&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;return updateMap('wait_time=90')&quot;&gt;Show wait time &gt; 90 minutes&lt;/a&gt;&lt;/li&gt;
 		&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;return updateMap('rating=30')&quot;&gt;Show only bad ratings&lt;/a&gt;&lt;/li&gt;
-		&lt;li&gt;View state-by-state: &lt;%= state_select %&gt;&lt;/li&gt;
 	&lt;/ul&gt;
 	&lt;/div&gt;
 	</diff>
      <filename>app/views/reports/_legend.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -27,8 +27,8 @@ ActionController::Routing::Routes.draw do |map|
   map.connect 'local/:filter', :controller =&gt; &quot;reports&quot;, :action =&gt; &quot;index&quot;
 
   map.kml_feed 'feeds/:count.kml', :controller =&gt; &quot;reports&quot;, :action =&gt; &quot;index&quot;, :format =&gt; :kml
-  map.json_feed 'feeds/:page.json', :controller =&gt; &quot;reports&quot;, :action =&gt; &quot;index&quot;
-  map.json_state_feed 'feeds/:state/:page.json', :controller =&gt; &quot;reports&quot;, :action =&gt; &quot;index&quot;
+  map.json_feed 'feeds/:page.json', :controller =&gt; &quot;reports&quot;, :action =&gt; &quot;index&quot;, :format =&gt; :jso
+  map.json_state_feed 'feeds/state/:state/:page.json', :controller =&gt; &quot;reports&quot;, :action =&gt; &quot;index&quot;
 
   map.resources :reports, 
     :collection =&gt; {</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,7 +60,7 @@ function initMapJS(map_filters){
 
     $(&quot;#filter_state&quot;).change(function () { 
         state = $(&quot;#filter_state&quot;).val();
-        updateMap(&quot;state/&quot;+state);
+        updateState(state);
     });
     // display the map centered on a latitude and longitude (Google zoom levels)
     var myPoint = new LatLonPoint(38, -90);
@@ -74,6 +74,21 @@ function initMapJS(map_filters){
 
 }
 
+function updateState(state, page) {
+    var current_filter = &quot;&quot;;
+    if(page == null)
+        page = 1;
+    hideMessage();
+
+    mapstraction.removeAllMarkers();
+    fadeMap();
+    gmarkers = [];
+    filters = current_filter = &quot;state=&quot; + state;
+        
+    $(&quot;#update_status&quot;).show();
+    $.getJSON(&quot;/feeds/state/&quot;+state+&quot;/&quot; + page +&quot;.json&quot;, &quot;&quot;);
+    return false;
+}
 function updateMap(map_filter) {
     var current_filter = &quot;&quot;;
     hideMessage();
@@ -88,7 +103,7 @@ function updateMap(map_filter) {
     }
         
     $(&quot;#update_status&quot;).show();
-    $.getJSON(&quot;/feeds/json/&quot;+current_filter+&quot;/1/200/0.json&quot;, &quot;&quot;);
+    $.getJSON(&quot;/reports.json?&quot;+current_filter+&quot;&amp;page=1&amp;count=200&amp;callback=updateJSON&quot;, &quot;&quot;);
     return false;
 }
 function showMessage(message) {</diff>
      <filename>public/javascripts/mapping.js</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,15 @@ while (1)
 	open(ATOM, &quot;&gt;reports.atom&quot;);
 	print ATOM $content;
 	close(ATOM);
-	move(&quot;reports.atom&quot;, &quot;public/feeds/reports.atom&quot;);
+	move(&quot;reports.atom&quot;, &quot;/home/votereport/current/public/reports.atom&quot;);
+
+	$res = $ua-&gt;get(&quot;http://votereport.us/reports.kml&quot;);
+	$content = $res-&gt;content;
+	open(ATOM, &quot;&gt;reports.kml&quot;);
+	print ATOM $content;
+	close(ATOM);
+	move(&quot;reports.atom&quot;, &quot;/home/votereport/current/public/reports.kml&quot;);
+
 	#print &quot;KML and Atom fetched.\n&quot;;
 	for (my $i=0;$i&lt;scalar @abbr;$i++)
 	{
@@ -50,7 +58,7 @@ sub state
 		my $res = $ua-&gt;get(&quot;http://votereport.us/reports.json?state=$state&amp;wait_time=0&amp;per_page=200&amp;callback=updateJSON&amp;page=$i&quot;);
 		print STATE $res-&gt;content;
 		close STATE;
-		my $fdir = &quot;/home/votereport/current/public/feeds/json&quot;;
+		my $fdir = &quot;/home/votereport/current/public/feeds/state&quot;;
 		mkdir($fdir) unless (-d $fdir);
 		mkdir(&quot;$fdir/$state&quot;) unless (-d &quot;$fdir/$state&quot;);
 		move(&quot;$i.json&quot;, &quot;$fdir/$state/$i.json&quot;);</diff>
      <filename>script/cachefiles</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>94ed1d3f6643dbc3353f551a779536b1ec377e71</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Turner</name>
    <email>ajturner@highearthorbit.com</email>
  </author>
  <url>http://github.com/davetroy/votereport/commit/65712c1bb8e92eac5cfddb3e55474161bc0ef0c6</url>
  <id>65712c1bb8e92eac5cfddb3e55474161bc0ef0c6</id>
  <committed-date>2008-11-04T05:36:37-08:00</committed-date>
  <authored-date>2008-11-04T05:36:37-08:00</authored-date>
  <message>Changed cache location for states. Fixed state loading of cache</message>
  <tree>3ea0dc23ae75e2eb3e9e187c234ff6c5d201ca80</tree>
  <committer>
    <name>Andrew Turner</name>
    <email>ajturner@highearthorbit.com</email>
  </committer>
</commit>
