Skip to content
Browse files

Merge branch 'master' of git@github.com:railsrumble/giant-robots

  • Loading branch information...
2 parents 8d6f944 + 9a8c3a4 commit 62a13bbe6cd37695241dd7f724c4e4f67ccbafc1 @mike-burns mike-burns committed
View
2 app/models/user.rb
@@ -12,6 +12,8 @@ class User < ActiveRecord::Base
has_many :purchases
+ before_validation_on_update :auto_geocode_address
+
def self.find_or_create_by_openid(openid_identity, registration, user)
User.find_by_openid_identity(openid_identity) ||
User.new(:openid_identity => openid_identity,
View
2 app/views/stores/_winning_store.html.erb
@@ -1,4 +1,4 @@
<% content_tag_for :li, store do -%>
- <h2><%= link_to %{#{h(store.name)}<span class="gradient"/><span class="crown"/>}, '#' %></h2>
+ <h2><%= link_to %{#{h(store.name)}<span class="gradient"></span><span class="crown"></span>}, '#' %></h2>
<h4><%=h store.location %></h4>
<% end -%>
View
35 public/stylesheets/main.css
@@ -1,4 +1,7 @@
-/* @override http://localhost:3000/stylesheets/main.css?1224445200 */
+/* @override
+ http://localhost:3000/stylesheets/main.css?1224445200
+ http://localhost:3000/stylesheets/main.css?1224455654
+*/
html {
}
@@ -244,11 +247,13 @@ input#purchase_quantity {
/* @group pick location */
#pick-location {
+ background-color: white;
clear: both;
margin-bottom: 20px;
border: 1px solid #dae4e5;
padding: 20px 0 20px 20px;
margin-left: -21px;
+ z-index: 9;
}
#new-item-location {
@@ -519,6 +524,7 @@ ol#best-stores a, h2 a {
}
ol#best-stores {
+ width: 960px;
}
ol#best-stores li {
@@ -551,7 +557,7 @@ ol#best-stores h2 {
.gradient {
width: 100%;
- z-index: 10;
+ z-index: 9;
position: absolute;
left: 0;
display: block;
@@ -562,7 +568,7 @@ ol#best-stores h2 {
.gradient-small {
width: 100%;
- z-index: 10;
+ z-index: 9;
position: absolute;
left: 0;
display: block;
@@ -579,6 +585,7 @@ ol#best-stores h2 {
position: absolute;
left: -50px;
top: -20px;
+ z-index: 10;
}
ol#best-stores h3 {
@@ -625,11 +632,8 @@ ol#best-stores h4 {
#account-menu li {
display: inline;
- border-right: 1px solid #fff;
-}
-
-#account-menu li:last-child {
- border-right-style: none;
+ padding-right: 2px;
+ padding-left: 2px;
}
#account-menu li a {
@@ -979,13 +983,22 @@ body.error .copy p {
display: block;
}
+#flash_warning {
+ background-color: #ff595c;
+ padding: 10px;
+ color: white;
+ margin-bottom: 20px;
+ background-image: url(../images/white-grad-small.png);
+ display: block;
+}
+
#flash {
display: block;
}
#errorExplanation {
color: #fff;
- padding: 10px 30px;
+ padding: 10px 30px 20px;
background: rgba(255,0,4,0.65) url(../images/black-grad.png) repeat-x;
line-height: 1.5;
position: fixed;
@@ -1056,3 +1069,7 @@ h2#login {
background: url(../images/login.png) no-repeat 109px 0;
height: 52px;
}
+
+body.stores #map {
+ margin-top: 10px;
+}
View
10 public/stylesheets/maps.css
@@ -1,3 +1,5 @@
+/* @override http://localhost:3000/stylesheets/maps.css?1224445200 */
+
#location-field {
height: 51px;
}
@@ -26,6 +28,14 @@
font-size: 18pt;
}
+#new-item input.gsc-search-button {
+ background-color: transparent;
+ border-style: none;
+ font-size: 1em;
+ text-decoration: underline;
+ cursor: pointer;
+}
+
.gmls-search-form {
position: absolute;
bottom: 260px !important;
View
18 test/unit/user_test.rb
@@ -16,6 +16,11 @@ class UserTest < Test::Unit::TestCase
assert_equal "Joe", @user.first_name
end
+ should "geocode when saving with a new location" do
+ @user.expects(:auto_geocode_address)
+ @user.update_attributes!(:location => '100 Commonwealth Ave, Boston, MA')
+ end
+
context "with some Purchases" do
setup do
[:month,:week,:day,:hour].each do |time_ago|
@@ -138,7 +143,18 @@ class UserTest < Test::Unit::TestCase
@user = Factory(:user, :openid_identity => nil, :email => 'foo@example.com')
end
- should_require_attributes :email, :location, :latitude, :longitude
+ should_require_attributes :email, :location
+
+ [:latitude, :longitude].each do |field|
+ should "require #{field}" do
+ assert_valid @user
+
+ @user.send(:"#{field}=", nil)
+ @user.location = nil
+
+ assert !@user.valid?
+ end
+ end
end
context "an OpenID and location" do

0 comments on commit 62a13bb

Please sign in to comment.
Something went wrong with that request. Please try again.