Skip to content

Commit

Permalink
Merge 07490b8 into c20139f
Browse files Browse the repository at this point in the history
  • Loading branch information
monfresh committed Apr 20, 2014
2 parents c20139f + 07490b8 commit f0f650c
Show file tree
Hide file tree
Showing 201 changed files with 10,178 additions and 13,332 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Expand Up @@ -17,3 +17,12 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

# Ignore .rvmrc
.rvmrc

# Ignore .env
.env

# Ignore secret token
/config/app_environment_variables.rb
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -13,6 +13,7 @@ gem 'pg'
gem 'rails_12factor'
gem 'rails_admin'
gem 'validates_formatting_of'
gem 'newrelic_rpm'

platforms :ruby_18 do
gem 'fastercsv'
Expand All @@ -32,7 +33,7 @@ group :development, :test do
end

group :production do
gem 'puma'
gem 'thin'
end

group :test do
Expand Down
12 changes: 9 additions & 3 deletions Gemfile.lock
Expand Up @@ -48,6 +48,7 @@ GEM
thor
crack (0.4.2)
safe_yaml (~> 1.0.0)
daemons (1.1.9)
devise (3.2.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
Expand All @@ -56,6 +57,7 @@ GEM
warden (~> 1.2.3)
docile (1.1.3)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (2.0.2)
fastercsv (1.5.5)
font-awesome-rails (4.0.3.1)
Expand Down Expand Up @@ -85,6 +87,7 @@ GEM
minitest (5.3.3)
multi_json (1.9.2)
nested_form (0.3.2)
newrelic_rpm (3.7.3.204)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
orm_adapter (0.5.0)
Expand All @@ -98,8 +101,6 @@ GEM
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
puma (2.8.2)
rack (>= 1.1, < 2.0)
rack (1.5.2)
rack-pjax (0.7.0)
nokogiri (~> 1.5)
Expand Down Expand Up @@ -178,6 +179,10 @@ GEM
sqlite3 (1.3.9)
term-ansicolor (1.3.0)
tins (~> 1.0)
thin (1.6.2)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thor (0.19.1)
thread_safe (0.3.3)
tilt (1.4.1)
Expand Down Expand Up @@ -209,10 +214,10 @@ DEPENDENCIES
geokit
haml
http_accept_language
newrelic_rpm
nokogiri
pg
pry
puma
rails (~> 4.1.0)
rails_12factor
rails_admin
Expand All @@ -221,6 +226,7 @@ DEPENDENCIES
simplecov
spring
sqlite3
thin
uglifier
validates_formatting_of
webmock
2 changes: 1 addition & 1 deletion Procfile
@@ -1 +1 @@
web: bundle exec puma -p $PORT
web: bundle exec rails server thin -p $PORT -e $RACK_ENV
22 changes: 18 additions & 4 deletions README.md
Expand Up @@ -15,15 +15,16 @@ Claim responsibility for shoveling out a fire hydrant after it snows.

## Demo
You can see a running version of the application at
[http://adopt-a-hydrant.herokuapp.com/][demo].
[http://hydrants.codefordc.org/][demo].

[demo]: http://adopt-a-hydrant.herokuapp.com/
[demo]: http://hydrants.codefordc.org/

## Installation
This application requires [Postgres](http://www.postgresql.org/) to be installed
This application requires [Postgres](http://www.postgresql.org/) to be installed. The easiest way to install Postgres on a Mac is with Homebrew, as detailed in this [Postgres installation guide](http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/).

git clone git://github.com/codeforamerica/adopt-a-hydrant.git
cd adopt-a-hydrant
gem update bundler
bundle install

bundle exec rake db:create
Expand Down Expand Up @@ -66,7 +67,20 @@ A successful deployment to Heroku requires a few setup steps:

`heroku run bundle exec rake db:seed`

6. Keep in mind that the Heroku free Postgres plan only allows up to 10,000 rows, so if your city has more than 10,000 fire hydrants (or other thing to be adopted), you will need to upgrade to the $9/month plan.
Keep in mind that the Heroku free Postgres plan only allows up to 10,000 rows,
so if your city has more than 10,000 fire hydrants (or other thing to be
adopted), you will need to upgrade to the $9/month plan.

### Google Analytics
If you have a Google Analytics account you want to use to track visits to your
deployment of this app, just set your ID and your domain name as environment
variables:

heroku config:set GOOGLE_ANALYTICS_ID=your_id
heroku config:set GOOGLE_ANALYTICS_DOMAIN=your_domain_name

An example ID is `UA-12345678-9`, and an example domain is `adoptahydrant.org`.


## Contributing
In the spirit of [free software][free-sw], **everyone** is encouraged to help
Expand Down
Binary file added app/assets/images/logos/dc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/logos/dc_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions app/assets/javascripts/main.js.erb
@@ -1,8 +1,7 @@
$(function() {
var center = new google.maps.LatLng(42.358431, -71.059773);
var center = new google.maps.LatLng(38.908934, -77.025833);
var mapOptions = {
center: center,
disableDoubleClickZoom: true,
keyboardShortcuts: false,
mapTypeControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP,
Expand All @@ -11,7 +10,7 @@ $(function() {
panControl: false,
rotateControl: false,
scaleControl: false,
scrollwheel: false,
scrollwheel: true,
streetViewControl: true,
zoom: 15,
zoomControl: true
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/thing_mailer.rb
@@ -1,5 +1,5 @@
class ThingMailer < ActionMailer::Base
default from: 'adoptahydrant@cityofboston.gov'
default from: "adoptahydrant@codefordc.org"

def reminder(thing)
@thing = thing
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/_footer.html.haml
@@ -0,0 +1,3 @@
<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init(100545358); }catch(e){}</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/100545358ns.gif" /></p></noscript>
11 changes: 9 additions & 2 deletions app/views/layouts/application.html.haml
Expand Up @@ -12,8 +12,15 @@
= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"
= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"
= javascript_include_tag "application"
%script{:type => "text/javascript"}
var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-20825280-2"]),_gaq.push(["_setDomainName",".adoptahydrant.org"]),_gaq.push(["_trackPageview"]),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}();
= stylesheet_link_tag "application"
- if Rails.env.production? && ENV['GOOGLE_ANALYTICS_ID'].present?
%script{:type => "text/javascript"}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '#{ENV['GOOGLE_ANALYTICS_ID']}', '#{ENV['GOOGLE_ANALYTICS_DOMAIN']}');
ga('send', 'pageview');
%body
= yield
19 changes: 6 additions & 13 deletions app/views/main/index.html.haml
Expand Up @@ -11,25 +11,18 @@
= render :partial => "sidebar/search"
- else
= render :partial => "sidebar/combo_form"

#logos
#col1
%br
%a{:href => "http://codeforamerica.org/"}
= image_tag "logos/cfa.png", :alt => t("sponsors.cfa"), :title => t("sponsors.cfa")
%br
%a{:href => "http://bostonbuilt.org/"}
= image_tag "logos/bostonbuilt.png", :alt => t("sponsors.built"), :title => t("sponsors.built")
#col2
%a{:href => "http://www.cityofboston.gov/"}
= image_tag "logos/boston.png", :alt => t("sponsors.city"), :title => t("sponsors.city")
%p#mayor
%a{:href => "http://www.cityofboston.gov/mayor/"}
= "#{t("sponsors.mayor.name")},"
%em
= t("sponsors.mayor.title")


#feedback
%p
%a{:href => URI.escape("mailto:adoptahydrant@cityofboston.gov?subject=#{t("titles.main", :thing => t("defaults.thing").titleize)} - #{t("links.feedback").titleize}")}
%a{:href => URI.escape("mailto:moncef@codeforamerica.org?subject=#{t("titles.main", :thing => t("defaults.thing").titleize)} - #{t("links.feedback").titleize}")}
= t("links.feedback")
.table-cell.map-container
#map
&nbsp;
= render :partial => 'layouts/footer'
4 changes: 2 additions & 2 deletions app/views/sidebar/_tos.html.haml
Expand Up @@ -10,7 +10,7 @@
%h3
Acceptance of Terms
%p
The City of Boston (&quot;City&quot;) provides the Adopt-a-Hydrant program (&quot;AAH&quot;) to you subject to the following Terms of Service Agreement (&quot;Agreement&quot;) which may be updated by us from time to time without notice to you. By accessing and using AAH, you accept and agree to be bound by the terms and provision of this Agreement.
The District of Columbia (&quot;City&quot;) provides the Adopt-a-Hydrant program (&quot;AAH&quot;) to you subject to the following Terms of Service Agreement (&quot;Agreement&quot;) which may be updated by us from time to time without notice to you. By accessing and using AAH, you accept and agree to be bound by the terms and provision of this Agreement.
%li
%h3
Description of Adopt-a-Hydrant
Expand Down Expand Up @@ -230,7 +230,7 @@
%h3
Governing Law and Venue
%p
This Agreement is governed by the laws of the Commonwealth of Massachusetts without regard to any conflict of law provisions. You agree that any claim or dispute with the City relating in any way to your use of AAH shall be brought exclusively before a state or federal court sitting in Boston, Massachusetts, and you irrevocably waive any jurisdictional, venue, or inconvenient forum objections to such courts.
This Agreement is governed by the laws of the District of Columbia without regard to any conflict of law provisions. You agree that any claim or dispute with the City relating in any way to your use of AAH shall be brought exclusively before a state or federal court sitting in Washington, D.C., and you irrevocably waive any jurisdictional, venue, or inconvenient forum objections to such courts.
%li
%h3
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions config/database.yml
Expand Up @@ -12,3 +12,4 @@ test:

production:
<<: *DEVELOPMENT
database: adopt_a_thing_production
2 changes: 1 addition & 1 deletion config/environments/production.rb
Expand Up @@ -65,7 +65,7 @@
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = {host: 'adoptahydrant.org'}
config.action_mailer.default_url_options = {:host => 'hydrants.codefordc.org'}

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
Expand Down
5 changes: 2 additions & 3 deletions config/initializers/devise.rb
Expand Up @@ -8,9 +8,8 @@

# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = 'noreply@adoptahydrant.com'
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = "noreply@codefordc.org"

# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'
Expand Down
1 change: 1 addition & 0 deletions config/initializers/secret_token.rb
Expand Up @@ -5,6 +5,7 @@

# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.

# You can use `rake secret` to generate a secure secret key.

if Rails.env.production? && ENV['SECRET_TOKEN'].blank?
Expand Down
22 changes: 11 additions & 11 deletions config/locales/de.yml
Expand Up @@ -22,19 +22,19 @@ de:
required: "(erforderlich)"
defaults:
address: "Adresse"
address_1: "1 City Hall Plaza"
address_1: "1600 Pennsylvania Ave NW"
address_2: "Suite 500"
city: "Boston"
city_state: "Boston, Massachusetts"
city: "Washington"
city_state: "Washington, D.C."
neighborhood: "Downtown"
sms_number: "857-555-1212"
state: "MA"
thing: "Hydrant"
sms_number: "202-555-1212"
state: "DC"
thing: "Hydranten"
this_thing: "Dieser %{thing}"
tagline: "Verantwortung dafür übernehmen, einen Hydranten auszubuddeln, nachdem es geschneit hat."
tos: "Mit der Anmeldung erklären Sie sich mit den %{tos} einverstanden."
voice_number: "617-555-1212"
zip: "02201-2013"
tagline: "Claim Verantwortung für schaufeln ein Feuer Hydrant, nachdem es schneit."
tos: "Mit der Anmeldung erklären Sie sich mit den %{tos}."
voice_number: "202-555-1212"
zip: "20500"
errors:
password: "Sie müssen sich einloggen oder registrieren, um fortzufahren."
not_found: "%{thing} konnte nicht gefunden werden."
Expand Down Expand Up @@ -87,5 +87,5 @@ de:
cfa: "Code for Amerika"
city: "City of Boston"
mayor:
name: "Thomas M. Menino"
name: "Vincent C. Gray"
title: "Mayor"
18 changes: 9 additions & 9 deletions config/locales/en.yml
Expand Up @@ -22,19 +22,19 @@ en:
required: "(required)"
defaults:
address: "address"
address_1: "1 City Hall Plaza"
address_1: "1600 Pennsylvania Ave NW"
address_2: "Suite 500"
city: "Boston"
city_state: "Boston, Massachusetts"
city: "Washington"
city_state: "Washington, D.C."
neighborhood: "Downtown"
sms_number: "857-555-1212"
state: "MA"
sms_number: "202-555-1212"
state: "DC"
thing: "hydrant"
this_thing: "This %{thing}"
tagline: "Claim responsibility for shoveling out a fire hydrant after it snows."
tos: "By signing up, you agree to the %{tos}."
voice_number: "617-555-1212"
zip: "02201-2013"
voice_number: "202-555-1212"
zip: "20500"
errors:
password: "You need to sign in or sign up before continuing."
not_found: "Could not find %{thing}."
Expand Down Expand Up @@ -83,9 +83,9 @@ en:
thank_you: "Thank you for adopting this %{thing}!"
tos: "Terms of Service"
sponsors:
built: "Built in Boston"
built: "Built in DC"
cfa: "Code for America"
city: "City of Boston"
mayor:
name: "Thomas M. Menino"
name: "Vincent C. Gray"
title: "Mayor"
16 changes: 8 additions & 8 deletions config/locales/es.yml
Expand Up @@ -22,19 +22,19 @@ es:
required: "(necesario)"
defaults:
address: "dirección"
address_1: "1 City Hall Plaza"
address_1: "1600 Pennsylvania Ave NW"
address_2: "Suite 500"
city: "Boston"
city_state: "Boston, Massachusetts"
city: "Washington"
city_state: "Washington, D.C."
neighborhood: "Downtown"
sms_number: "857-555-1212"
state: "MA"
sms_number: "202-555-1212"
state: "DC"
thing: "boca de incendio"
this_thing: "Esta %{thing}"
tagline: "Reclamar la responsabilidad para palear un hidrante de incendios después de que las nieves."
tos: "Al registrarse, usted está de acuerdo con los %{tos}."
voice_number: "617-555-1212"
zip: "02201-2013"
voice_number: "202-555-1212"
zip: "20500"
errors:
password: "Es necesario iniciar sesión o registrarse antes de continuar."
not_found: "No se pudo encontrar %{thing}."
Expand Down Expand Up @@ -87,5 +87,5 @@ es:
cfa: "Código de los Estados Unidos"
city: "Ciudad de Boston"
mayor:
name: "Thomas M. Menino"
name: "Vincent C. Gray"
title: "Mayor"

0 comments on commit f0f650c

Please sign in to comment.