Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

finishing poster

  • Loading branch information...
commit 5db2069bc52f4cde8dda08bc9a449cfe4cbfa60d 1 parent cd82a82
@danmelton authored
View
26 main.rb
@@ -18,9 +18,6 @@
get '/step2' do
session[:address] = params[:address]
- session[:date] = params[:date]
- session[:time1] = params[:time2]
- session[:time2] = params[:time2]
address = Geocoder.search(params[:address])
location = vip_object(address.first)
session[:polling_name] = location["Address"]["LocationName"]
@@ -32,10 +29,10 @@
end
get '/step3' do
-
+ session[:date] = params[:date]
+ session[:time1] = params[:time2]
+ session[:time2] = params[:time2]
session[:languages] = params[:language]
-
-
erb :step3
end
@@ -49,7 +46,6 @@
data[:page_1] = {}
data[:page_1][:vote] = { :value => translations[language]["vote"] }
data[:page_1][:election_date] = { :value => translations[language]["election_date"] }
- data[:page_1][:election_date_value] = { :value => session[:date] }
data[:page_1][:polling_place] = { :value => translations[language]["polling_place"]}
data[:page_1][:polling_place_value1] = { :value => session[:polling_name]}
data[:page_1][:polling_place_value2] = { :value => session[:polling_address1]}
@@ -57,11 +53,19 @@
data[:page_1][:sms] = { :value => translations[language]["sms"] + " 1-800-000-0000" }
pdf = Prawn::Document.generate "poster_#{language}_#{size}.pdf", :template => "public/pdfs/#{size}.pdf" do |pdf|
- pdf.move_down 300
- pdf.fill_form_with(data)
- pdf.image open(google_map(session[:polling_coordinates])), :fit => [250, 250]
+ pdf.text translations[language]["vote"], size: 150, style: :bold, :text_color => 'FFFFFF', :align => :center
+ pdf.text translations[language]["election_date"] + ": " + session[:date], size: 25, style: :bold, :text_color => 'FFFFFF', :align => :center
+ pdf.move_down 10
+ pdf.text translations[language]["polling_place"], size: 25, style: :bold, :text_color => 'FFFFFF', :align => :center
+ pdf.text session[:polling_name], size: 20, style: :bold, :text_color => 'FFFFFF', :align => :center
+ pdf.text session[:polling_address1], size: 20, style: :bold, :text_color => 'FFFFFF', :align => :center
+ pdf.move_down 10
+ pdf.image open(google_map(session[:polling_coordinates])), :fit => [250, 250], :position => :center
+ pdf.move_down 50
+ pdf.text translations[language]["more_info"] + " rockthevote.org", size: 20, style: :bold, :text_color => 'FFFFFF', :align => :center
+ pdf.text translations[language]["sms"] + " 1-800-000-0000", size: 20, style: :bold, :text_color => 'FFFFFF', :align => :center
end
-
+
end
def vip_object(geocoder_object)
View
BIN  poster_english_large.pdf
Binary file not shown
View
BIN  public/pdfs/large.pdf
Binary file not shown
View
10 views/step2.erb
@@ -18,14 +18,18 @@
</ul>
</li>
<li>
- <legend>When is your polling place open?</legend>
+ <legend>Details?</legend>
+ <div class="time">
+ <label>When is the election?</label>
+ <input type="text" value="11/04/2012" name="date">
+ </div>
<div class="time">
<label>What time does the Polling Location open?</label>
- <input type="text" value="8:00am">
+ <input type="text" value="8:00am" name="time1">
</div>
<div class="time">
<label>What time does the Polling Location close?</label>
- <input type="text" value="8:00pm">
+ <input type="text" value="8:00pm" name="time2">
</div>
</li>
<li>
Please sign in to comment.
Something went wrong with that request. Please try again.