diff --git a/app/models/quantity.rb b/app/models/quantity.rb
index a72c8ef..80feafc 100644
--- a/app/models/quantity.rb
+++ b/app/models/quantity.rb
@@ -1,6 +1,7 @@
module Quantity
def self.quantities
[ "12 pack",
+ "2L",
"30 pack",
"baker's dozen",
"bottle",
@@ -14,7 +15,9 @@ def self.quantities
"half gallon",
"jar",
"jumbo",
+ "loaf",
"six pack",
+ "slice",
"quart" ]
end
diff --git a/app/views/purchases/stores/_index.html.erb b/app/views/purchases/stores/_index.html.erb
index a27b5aa..a088b67 100644
--- a/app/views/purchases/stores/_index.html.erb
+++ b/app/views/purchases/stores/_index.html.erb
@@ -1,11 +1,14 @@
-
+
+ <% content_tag_for :div, @purchase, :map_for,
+ :style => "width: 400px; height: 160px;",
+ :class => 'map' do end %>
-
- <% @stores.each do |store| -%>
- <% content_tag_for :li, store do %>
- <%=h store.name %>
- <%= number_to_formatted_currency(@item.purchases.cheapest.price) %>
+
+ <% @stores.each do |store| -%>
+ <% content_tag_for :li, store do %>
+ <%=h store.name %>
+ <%= number_to_formatted_currency(@item.purchases.cheapest.price) %>
+ <% end -%>
<% end -%>
- <% end -%>
-
-
+
+
diff --git a/app/views/purchases/stores/index.js.rjs b/app/views/purchases/stores/index.js.rjs
index d974c47..a66403e 100644
--- a/app/views/purchases/stores/index.js.rjs
+++ b/app/views/purchases/stores/index.js.rjs
@@ -1,3 +1,12 @@
page.replace_html dom_id(@purchase, :stores_for),
:partial => 'index'
-page.visual_effect :blind_down, dom_id(@purchase, :stores_for)
+page << <<-END
+ new Effect.BlindDown(#{dom_id(@purchase, :stores_for).inspect}, {
+ afterFinish: function() {
+ new StoreViewer({
+ mapContainer: #{dom_id(@purchase, :map_for).inspect},
+ stores: #{@stores.to_json}
+ });
+ }
+ });
+END
diff --git a/design/home 03 - title top corner.psd b/design/home 03 - title top corner.psd
index 0102f56..dd8e41c 100644
Binary files a/design/home 03 - title top corner.psd and b/design/home 03 - title top corner.psd differ
diff --git a/design/mockups/header-text.psd b/design/mockups/header-text.psd
index 7026de4..a93dfe1 100644
Binary files a/design/mockups/header-text.psd and b/design/mockups/header-text.psd differ
diff --git a/public/images/black-grad.png b/public/images/black-grad.png
new file mode 100644
index 0000000..09253a9
Binary files /dev/null and b/public/images/black-grad.png differ
diff --git a/public/javascripts/map.js b/public/javascripts/map.js
index 898f482..430987f 100644
--- a/public/javascripts/map.js
+++ b/public/javascripts/map.js
@@ -235,8 +235,8 @@ StoreViewer = Class.create({
centerOnStore:
function(store) {
if (this.centered) {
- this.map.panTo(new GLatLng(store.latitude, store.longitude));
this.map.setZoom(this.options.zoom);
+ this.map.panTo(new GLatLng(store.latitude, store.longitude));
} else {
this.map.setCenter(new GLatLng(store.latitude, store.longitude), this.options.zoom);
this.centered = true;
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index fe096d6..00e6b89 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -1,3 +1,5 @@
+/* @override http://localhost:3000/stylesheets/main.css?1224445200 */
+
html {
}
@@ -87,7 +89,7 @@ h1 {
color: white;
}
-body.purchase-new li#purchases-new,
+body.purchases-index li#purchases-index,
body.stores-index li#stores-index,
body.sessions-new li#sessions-new,
body.users-new li#users-new,
@@ -95,7 +97,7 @@ body.users-new li#users-new,
padding-bottom: 14px;
border-style: none;
background: #91cfd3 url(../images/active-tab-top.png) no-repeat 0 0;
- width: 87px;
+ width: 94px;
margin-top: -8px;
height: 21px;
padding-left: 35px;
@@ -188,9 +190,10 @@ ul#purchases {
border-left: 1px solid #dae4e5;
border-top: 1px solid #dae4e5;
padding: 5px;
+ color: #57999d;
}
-#new-item-name input {
+input#purchase_item_name {
width: 455px;
margin-right: 20px;
color: #57999d;
@@ -198,14 +201,14 @@ ul#purchases {
font-weight: bold;
}
-#new-item-price input {
+input#purchase_price {
width: 107px;
margin-right: 20px;
color: #57999d;
font-size: 3em;
}
-#new-item-qty input {
+input#purchase_quantity {
width: 130px;
margin-right: 20px;
color: #57999d;
@@ -418,6 +421,13 @@ li.purchase {
#purchases .more-info {
margin-top: 0px;
+ padding: 0px;
+ height: 220px;
+}
+
+#purchases .stores_container {
+ padding: 30px;
+ height: 160px;
}
.more-info .map {
@@ -434,24 +444,23 @@ li.purchase {
width: 390px;
}
-ul.other-stores li {
+ol.other-stores li {
color: #88e197;
-clear: both;
-float: right;
+ clear: both;
+ float: right;
margin-top: 10px;
padding: 10px;
display: block;
width: 100%;
font-size: 1em;
- border-bottom: 1px dotted #aadde0;
-
+ border-bottom: 1px dotted #aadde0;
}
-ul.other-stores li:last-child {
+ol.other-stores li:last-child {
border-bottom-style: none;
}
-ul.other-stores li:hover {
+ol.other-stores li:hover {
color: #41c037;
}
@@ -898,6 +907,7 @@ body.items-index .copy li {
float: right;
margin-top: 3px;
margin-right: 412px;
+ padding-right: 18px;
}
.reminder input {
@@ -939,4 +949,62 @@ body.error .copy p {
margin-top: 20px;
}
+/* @end */
+
+/* @group flashes */
+
+#flash_notice {
+ background-color: #f9eeb3;
+ padding: 10px;
+ color: #57999d;
+ margin-bottom: 20px;
+ background-image: url(../images/white-grad-small.png);
+}
+
+#errorExplanation {
+ color: #fff;
+ padding: 10px 30px;
+ background: rgba(255,0,4,0.65) url(../images/black-grad.png) repeat-x;
+ line-height: 1.5;
+ position: fixed;
+ top: 0;
+ width: 100%;
+ left: 0;
+}
+
+.fieldWithErrors input#purchase_quantity {
+ border-bottom: 4px solid #ff595c;
+}
+
+.fieldWithErrors input#purchase_item_name {
+ border-bottom: 4px solid #ff595c;
+}
+
+.fieldWithErrors input#purchase_price {
+ border-bottom: 4px solid #ff595c;
+}
+
+#errorExplanation h2 {
+ color: #651516;
+ font-size: 2em;
+}
+
+#errorExplanation p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+ margin-left: 10px;
+ color: #901d1f;
+}
+
+.errorExplanation ul {
+ margin-left: 20px;
+}
+
+.errorExplanation li {
+ list-style-type: disc;
+ list-style-position: outside;
+}
+
+
+
/* @end */
diff --git a/test/functional/purchases_controller_test.rb b/test/functional/purchases_controller_test.rb
index 97875b0..70b418f 100644
--- a/test/functional/purchases_controller_test.rb
+++ b/test/functional/purchases_controller_test.rb
@@ -36,7 +36,7 @@ class PurchasesControllerTest < ActionController::TestCase
end
before_should "paginate the purchases" do
- @purchases.expects(:paginate).with().returns(@purchases)
+ @purchases.expects(:paginate).returns(@purchases)
end
should_eventually "paginate purchases" do
diff --git a/test/functional/stores_controller_test.rb b/test/functional/stores_controller_test.rb
index d20356c..2663e29 100644
--- a/test/functional/stores_controller_test.rb
+++ b/test/functional/stores_controller_test.rb
@@ -77,8 +77,8 @@ class StoresControllerTest < ActionController::TestCase
context "on JS POST to create with valid params" do
setup do
- @latitude = 42.3971
- @longitude = -71.126
+ @latitude = '42.3971'
+ @longitude = '-71.126'
post :create, :store => { :name => "store",
:location => 'Fairy land',
:latitude => @latitude,
@@ -93,11 +93,11 @@ class StoresControllerTest < ActionController::TestCase
should_change "Store.count", :by => 1
should "keep the passed latitude" do
- assert_equal @latitude, assigns(:store).latitude
+ assert_equal BigDecimal.new(@latitude), assigns(:store).latitude
end
should "keep the passed longitude" do
- assert_equal @longitude, assigns(:store).longitude
+ assert_equal BigDecimal.new(@longitude), assigns(:store).longitude
end
should "set the store id on the form" do