Permalink
Browse files

Merge pull request #2 from finbarr/master

Fixed up formatting.
  • Loading branch information...
2 parents 614a3b1 + 13cee4f commit 4801cacae20ab0b5c9a2a7344708d694df82e220 @Jarred-Sumner Jarred-Sumner committed Oct 12, 2012
View
@@ -3,12 +3,12 @@ source 'https://rubygems.org'
gem 'rails', '3.2.8'
group :development do
- gem 'sqlite3'
+ gem 'sqlite3'
end
group :production do
- gem 'thin'
- gem 'pg'
+ gem 'thin'
+ gem 'pg'
end
# Gems used only for assets and not required
@@ -27,4 +27,4 @@ gem 'jquery-rails'
gem 'amazon_flex_pay'
# Configuration File
-gem 'rails_config'
+gem 'rails_config'
@@ -20,9 +20,3 @@ Selfstarter =
$ ->
Selfstarter.init()
$("#email").focus()
-
-
-
-
-
-
@@ -1,4 +1,4 @@
-#reserve_container
+#reserve_container
{
float: left;
padding-top: 20px;
@@ -8,13 +8,13 @@
box-shadow: 0 -1px 0 #cbcbcb; /* drop shadow */
margin-top: 30px;
text-align: center;
- p
+ p
{
color: #8b8a8a;
font-size: 18px;
line-height: 1.4;
}
- #ship_date
+ #ship_date
{
color: #4c4c4c;
font-size: 22px;
@@ -24,7 +24,7 @@
margin: 0 auto;
width: 300px;
}
- #price
+ #price
{
color: #4c4c4c;
font-size: 22px;
@@ -35,7 +35,7 @@
width: 300px;
}
}
-.reserve
+.reserve
{
margin: 0 auto;
margin-top: 20px;
@@ -45,12 +45,11 @@
font-size: 32px;
}
-#middle_reserve
+#middle_reserve
{
padding: 60px;
h2
{
margin-bottom: 26px;
}
}
-
@@ -4,7 +4,7 @@
-moz-box-shadow: 0px 1px 3px 0px #acacac;
-webkit-box-shadow: 0px 1px 3px 0px #acacac;
box-shadow: 0px 1px 3px 0px #acacac;
- li
+ li
{
float: left;
margin: 0 16px;
@@ -39,9 +39,3 @@
width: 81px;
}
}
-
-
-
-
-
-
@@ -1,47 +1,47 @@
-#backing
+#backing
{
float: left;
width: 383px;
margin: 20px 0 0 40px;
- #backers
- {
- border-left: none;
- padding-left: 0;
- ul
- {
- float: left;
- }
- }
- #days {
- border-right: none;
- padding-right: 0;
- }
- ul {
- text-align: center;
- }
- .stats
- {
- margin: 0 auto;
- color: #3f3f3f;
- font-size: 24px;
- display: block;
- display: inline-block;
- font-family: $primary_font, $secondary_font, $tertiary_font;
- border-right: 1px solid #cbcbcb;
- padding-right: 26px;
- padding-left: 26px;
- text-align: left;
- span
- {
- color: #868686;
- font-size: 18px;
- margin-top: 5px;
- display: block;
- font-family: $primary_font, $secondary_font, $tertiary_font;
- }
- }
+ #backers
+ {
+ border-left: none;
+ padding-left: 0;
+ ul
+ {
+ float: left;
+ }
+ }
+ #days {
+ border-right: none;
+ padding-right: 0;
+ }
+ ul {
+ text-align: center;
+ }
+ .stats
+ {
+ margin: 0 auto;
+ color: #3f3f3f;
+ font-size: 24px;
+ display: block;
+ display: inline-block;
+ font-family: $primary_font, $secondary_font, $tertiary_font;
+ border-right: 1px solid #cbcbcb;
+ padding-right: 26px;
+ padding-left: 26px;
+ text-align: left;
+ span
+ {
+ color: #868686;
+ font-size: 18px;
+ margin-top: 5px;
+ display: block;
+ font-family: $primary_font, $secondary_font, $tertiary_font;
+ }
+ }
}
-#progress_bg
+#progress_bg
{
margin-top: 20px;
float: left;
@@ -54,7 +54,7 @@
border-radius: 30px;
width: 383px;
background: #dbdbdb;
- #progress
+ #progress
{
height: 40px;
-moz-box-shadow: 0 1px 1px rgba(0,0,0,.59); /* drop shadow */
@@ -74,23 +74,23 @@
display: inline-block;
}
#progress_text
- {
- margin: 0 auto;
- width: 100%;
- font-size: 14pt;
- display: inline-block;
- color: white;
- text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.37);
- text-align: center;
- position: relative;
- top: -35px;
- }
+ {
+ margin: 0 auto;
+ width: 100%;
+ font-size: 14pt;
+ display: inline-block;
+ color: white;
+ text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.37);
+ text-align: center;
+ position: relative;
+ top: -35px;
+ }
}
.small
{
- height: 20px !important;
- #progress
- {
- height: 20px !important;
- }
-}
+ height: 20px !important;
+ #progress
+ {
+ height: 20px !important;
+ }
+}
@@ -2,41 +2,38 @@ class PreorderController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => :ipn
def index
-
end
def checkout
-
end
def prefill
- @user = User.find_or_create_by_email!(params[:email])
- @order = Order.prefill!(:name => Settings.product_name, :price => Settings.price, :user_id => @user.id)
+ @user = User.find_or_create_by_email!(params[:email])
+ @order = Order.prefill!(:name => Settings.product_name, :price => Settings.price, :user_id => @user.id)
- # This is where all the magic happens. We create a multi-use token with Amazon, letting us charge the user's Amazon account
- # Then, if they confirm the payment, Amazon POSTs us their shipping details and phone number
- # From there, we save it, and voila, we got ourselves a preorder!
+ # This is where all the magic happens. We create a multi-use token with Amazon, letting us charge the user's Amazon account
+ # Then, if they confirm the payment, Amazon POSTs us their shipping details and phone number
+ # From there, we save it, and voila, we got ourselves a preorder!
@pipeline = AmazonFlexPay.multi_use_pipeline(@order.uuid, :transaction_amount => Settings.price, :global_amount_limit => Settings.charge_limit, :collect_shipping_address => "True", :payment_reason => Settings.payment_description)
- redirect_to @pipeline.url("#{request.scheme}://#{request.host}/preorder/postfill")
+ redirect_to @pipeline.url("#{request.scheme}://#{request.host}/preorder/postfill")
end
def postfill
- unless params[:callerReference].blank?
- @order = Order.postfill!(params)
- end
- # "A" means the user cancelled the preorder before clicking "Confirm" on Amazon Payments.
- if params['status'] != 'A' && @order.present?
- redirect_to :action => :share, :uuid => @order.uuid
- else
- redirect_to root_url
- end
+ unless params[:callerReference].blank?
+ @order = Order.postfill!(params)
+ end
+ # "A" means the user cancelled the preorder before clicking "Confirm" on Amazon Payments.
+ if params['status'] != 'A' && @order.present?
+ redirect_to :action => :share, :uuid => @order.uuid
+ else
+ redirect_to root_url
+ end
end
def share
- @order = Order.find_by_uuid(params[:uuid])
+ @order = Order.find_by_uuid(params[:uuid])
end
def ipn
end
-
end
@@ -1,17 +1,17 @@
module PreorderHelper
- def like_button(width = 70, show_faces = false)
- raw "<div class=\"fb-like\" data-send=\"false\" data-width=\"#{width}\" data-layout=\"box_count\" data-show-faces=\"true\"></div>"
- end
- def pin_it_button
- image_url = URI.encode("#{request.scheme}://#{request.host}#{image_path(Settings.product_image_url)}")
- raw "<a href='http://pinterest.com/pin/create/button/?url=#{encoded_root_url}&media=#{image_url}' class='pin-it-button' count-layout='vertical'><img border='0' src='//assets.pinterest.com/images/PinExt.png' title='Pin It' /></a>"
- end
- def tweet_button
- tweet_text = "I'm #{Settings.primary_stat_verb} number #{number_with_delimiter @order.number, :delimiter => ","} #{Settings.tweet_text}!"
- raw "<a href='https://twitter.com/share?url=/' id='tweet_button' class='twitter-share-button twitter-button' data-url=#{request.scheme}//#{request.host}' data-via='#{Settings.product_name}' data-lang='en' data-count='vertical' data-text=\"#{tweet_text}\">Tweet</a>"
- end
+ def like_button(width = 70, show_faces = false)
+ raw "<div class=\"fb-like\" data-send=\"false\" data-width=\"#{width}\" data-layout=\"box_count\" data-show-faces=\"true\"></div>"
+ end
+ def pin_it_button
+ image_url = URI.encode("#{request.scheme}://#{request.host}#{image_path(Settings.product_image_url)}")
+ raw "<a href='http://pinterest.com/pin/create/button/?url=#{encoded_root_url}&media=#{image_url}' class='pin-it-button' count-layout='vertical'><img border='0' src='//assets.pinterest.com/images/PinExt.png' title='Pin It' /></a>"
+ end
+ def tweet_button
+ tweet_text = "I'm #{Settings.primary_stat_verb} number #{number_with_delimiter @order.number, :delimiter => ","} #{Settings.tweet_text}!"
+ raw "<a href='https://twitter.com/share?url=/' id='tweet_button' class='twitter-share-button twitter-button' data-url=#{request.scheme}//#{request.host}' data-via='#{Settings.product_name}' data-lang='en' data-count='vertical' data-text=\"#{tweet_text}\">Tweet</a>"
+ end
- def encoded_root_url
- raw URI.encode "#{request.scheme}://#{request.host}/preorder"
- end
+ def encoded_root_url
+ raw URI.encode "#{request.scheme}://#{request.host}/preorder"
+ end
end
Oops, something went wrong.

0 comments on commit 4801cac

Please sign in to comment.