Skip to content
Browse files

Disclaimer changes and top ten fix.

  • Loading branch information...
1 parent 6812502 commit d529bbf7427b109c689166f41f64df2ee5e1a1dd @paulmwatson committed Mar 18, 2009
Showing with 8 additions and 6 deletions.
  1. +1 −1 app/controllers/cities_controller.rb
  2. +7 −5 app/views/cities/index.html.erb
View
2 app/controllers/cities_controller.rb
@@ -3,7 +3,7 @@ class CitiesController < ApplicationController
def index
@cities = City.find :all, :order => 'country, name', :conditions => {:hidden => false}
- @topten_cities = Mention.find :all, :group => 'city_id', :select => 'count(id) as city_mentions, city_id', :order => 'city_mentions DESC', :limit => 10
+ @topten_cities = Mention.find :all, :group => 'city_id', :select => 'count(id) as city_mentions, city_id', :order => 'city_mentions DESC', :limit => 20
@mentions = Mention.find :all, :conditions => {:mentioned_at => ("#{Date.today.year}-#{Date.today.month.to_s.rjust(2, '0')}-#{Date.today.day.to_s.rjust(2, '0')} 00:00".."#{Date.today.year}-#{Date.today.month.to_s.rjust(2, '0')}-#{Date.today.day.to_s.rjust(2, '0')} 23:59")}, :order => :mentioned_at
View
12 app/views/cities/index.html.erb
@@ -4,16 +4,18 @@
<p>Realtime disease detection for your city from messages on <em>Twitter</em> (and soon <em>Facebook</em>)</p>
<p>&nbsp;</p>
<p<span class="phrase">flu</span>, <span class="phrase">food poisoning</span>, <span class="phrase">headcolds</span>, <span class="phrase">chicken pox</span> &amp; <span class="phrase">sore throats</span></p>
- <p>&nbsp;</p>
- <p>*Some cities are still coming online</p>
</div>
-<h1>SickCity's Ten Sickest Cities</h1>
+<h1>SickCity's Ten Sickest Cities*</h1>
+<p style="font-size: 11px; text-align: center">*Some cities are still coming online</p>
<ol class="list">
<% i = 0 %>
<% @topten_cities.each do |mention|%>
- <% i = i + 1%>
<%- city = mention.city -%>
- <li><a href="/<%= city.country %>/<%= city.name.gsub('.','%2E') %>"><span class="city"><span class="toptencount"><%= "%02d" % i %></span> <%= city.name %></span> <span id="city_graph_<%= city.id %>" class="tiny_graph"><% @trend[city.id].each do |hour| %><%= hour %>,<% end %></span></a></li>
+ <%- if !city.hidden %>
+ <% i = i + 1%>
+ <li><a href="/<%= city.country %>/<%= city.name.gsub('.','%2E') %>"><span class="city"><span class="toptencount"><%= "%02d" % i %></span> <%= city.name %></span> <span id="city_graph_<%= city.id %>" class="tiny_graph"><% @trend[city.id].each do |hour| %><%= hour %>,<% end %></span></a></li>
+ <% end %>
+ <% break if i > 9 %>
<% end %>
</ol>
<h1>All Cities</h1>

0 comments on commit d529bbf

Please sign in to comment.
Something went wrong with that request. Please try again.