Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lat/Lon decimal fix, remove kml before render, updated index and info…

…window
  • Loading branch information...
commit 1e0691e7f98949f85c21995b7728517a7ebc0f0f 1 parent 718f9f2
@kunaldi kunaldi authored
View
8 app/assets/javascripts/main.js.erb
@@ -11,6 +11,7 @@ $(function() {
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var isWindowOpen = false;
+ var sidewalks_kml;
var activeObjectId;
var activeMarker;
var activeInfoWindow = new google.maps.InfoWindow({
@@ -51,9 +52,12 @@ $(function() {
});
function renderKML(lat, lng) {
- console.debug("Rendering sidewalks of [%s, %s]", lat, lng);
+ console.info("Rendering sidewalks of [%s, %s]", lat, lng);
var url = 'http://167.165.233.18/sidewalks.kml?lat=' + lat + '&lng=' + lng;
- var sidewalks_kml = new google.maps.KmlLayer(url, {suppressInfoWindows: true, map: map});
+ if (sidewalks_kml != undefined) {
+ sidewalks_kml.setMap(null);
+ }
+ sidewalks_kml = new google.maps.KmlLayer(url, {suppressInfoWindows: true, map: map});
google.maps.event.addListener(sidewalks_kml, 'click', function(e) {
isWindowOpen = true;
View
9 app/assets/stylesheets/application.css
@@ -444,3 +444,12 @@ ul.actions_menu li:hover {
position:relative;
top:1px;
}
+div.legend {
+ width: 50px;
+ height: 15px;
+}
+.red {color: #bb0000;}
+.blue {color: #0000bb;}
+.green {color: #00bb00;}
+.yellow {color: #bbbb00;}
+.white {color: #bbbbbb;}
View
8 app/helpers/sidewalks_helper.rb
@@ -1,13 +1,13 @@
module SidewalksHelper
def format_color(s)
if s.cleared
- '#linestyle_blue'
+ "#cleared"
elsif s.num_adopted > 0
- '#linestyle_yellow'
+ "#adopted"
elsif s.need_help
- '#linestyle_red'
+ "#needs_help"
else
- '#linestyle_white'
+ "#unclear"
end
end
end
View
4 app/models/user.rb
@@ -4,6 +4,10 @@ class User < ActiveRecord::Base
validates_presence_of :first_name, :last_name
has_many :sidewalk_claims
+ def short_name
+ "#{first_name} #{last_name.chr}."
+ end
+
def fullname
first_name + ' ' + last_name
end
View
48 app/views/main/index.html.haml
@@ -16,25 +16,33 @@
%div{:id => key}
= message
- #scrollup.font_1
- %div.headline
- "Adopt-a-sidewalk" near your home by "claiming" it on a map.
- %br
- %br
- By doing this, you let neighbors know you can help clear snow.
- %div.headline
- You can see at-a-glance which sidewalks are claimed and connect with your less-abled neighbors to help keep their sidewalks clear.
- %div.headline
- You can enlist your friends to help on Facebook and Twitter.
- %div.headline
- To sign up for our text messaging service, text the word "Chicago" to "311311" for all major cell phone carriers.
- %br
- %br
- Message and data rates may apply.
- %div.headline
- = image_tag "logos/ChicagoShovelsHOME.jpg"
- %div.headline
- = image_tag "logos/SignUpSMSAlerts.jpg"
+ .font_1
+ %p
+ Welcome to Chicago Shovel's Adopt-a-Sidewalk!
+ %p
+ You may know that you're required to shovel the sidewalk in front of your home or business,
+ but how about helping others out?
+ %p
+ Claim the sidewalks that you'll shovel this winter.
+ Share supplies like snowblowers, shovels and salt with your neighbors.
+ Ask for help if you need an extra hand this winter.
+ Let everyone know you've cleared your sidewalk.
+ %p
+ Don't see your sidewalk on this map?
+ Help add your sidewalk by letting us know here.
+
+ %p
+ Sidewalk colors
+ %p
+ .red= 'Needs help'
+ .blue= 'Cleared'
+ .yellow= 'Adopted'
+ .white= 'Uncleared'
+
+ = image_tag "logos/ChicagoShovelsHOME.jpg"
+ = image_tag "logos/SignUpSMSAlerts.jpg"
+ = image_tag "logos/SignUpSMSAlerts.jpg"
+ = image_tag "logos/SignUpSMSAlerts.jpg"
#register
%p#register-text
@@ -66,7 +74,7 @@
= render :partial => 'facebook_button'
= render :partial => 'twitter_button'
- #osw_widget{:style => "position: absolute; left: 20px; bottom: 0px; z-index: 9999"}
+ #xosw_widget{:style => "position: absolute; left: 20px; bottom: 0px; z-index: 9999"}
#feedback
= link_to t("links.terms"), '/tos'
View
8 app/views/sidewalk_claims/show.html.haml
@@ -34,9 +34,9 @@
- if @shoveled_by_me
%li.snowed
%a{:href => "#", :id => "snowed_link", :data => {:moid => @my_sidewalk.id}}
- %h1 Snowed?
+ %h1 Shoveled?
.btn_image
- .label It snowed again, this sidewalk needs to be shoveled.
+ .label Unclear.
- else
%li.shoveled
%a{:href => "#", :id => "shoveled_link", :data => {:moid => @my_sidewalk.id}}
@@ -53,7 +53,7 @@
%a{:href => "#", :id => "share_link"}
%h1 Share
.btn_image
- .label I need supplies or have some to share.
+ .label I need supplies or can share.
- else
#need_register.link_1
@@ -70,4 +70,4 @@
- else
%h1= 'Adopted by'
#people_list
- = @claims.map{|c| c.user.fullname}.join(', ')
+ = @claims.map{|c| c.user.short_name}.join(', ')
View
8 app/views/sidewalks/index.kml.erb
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
- <Style id="linestyle_red">
+ <Style id="needs_help">
<LineStyle>
<width>4</width>
</LineStyle>
@@ -10,7 +10,7 @@
</PolyStyle>
</Style>
- <Style id="linestyle_white">
+ <Style id="unclear">
<LineStyle>
<width>4</width>
</LineStyle>
@@ -19,7 +19,7 @@
</PolyStyle>
</Style>
- <Style id="linestyle_yellow">
+ <Style id="adopted">
<LineStyle>
<width>4</width>
</LineStyle>
@@ -28,7 +28,7 @@
</PolyStyle>
</Style>
- <Style id="linestyle_blue">
+ <Style id="cleared">
<LineStyle>
<width>4</width>
</LineStyle>
View
4 db/migrate/20120108164400_add_sidewalk_attributes.rb
@@ -1,8 +1,8 @@
class AddSidewalkAttributes < ActiveRecord::Migration
def change
change_table :chicagosidewalks do |t|
- t.integer :lat, :default => nil, :precision => 16, :scale => 14
- t.integer :lon, :default => nil, :precision => 16, :scale => 14
+ t.decimal :lat, :default => nil, :precision => 16, :scale => 14
+ t.decimal :lon, :default => nil, :precision => 16, :scale => 14
t.boolean :cleared
t.boolean :need_help
t.string :zipcode
Please sign in to comment.
Something went wrong with that request. Please try again.