Upgrading Foundation, starting to work through regression issues

This commit is contained in:
Will Marshall
2014-03-24 15:40:33 +11:00
parent 0690fcda48
commit bf7d12b40e
11 changed files with 88 additions and 94 deletions

View File

@@ -20,7 +20,7 @@ gem 'angularjs-rails'
gem 'bugsnag'
gem 'newrelic_rpm'
gem 'haml'
gem 'sass'
gem 'sass', "~> 3.2"
gem 'aws-sdk'
gem 'db2fog'
gem 'andand'
@@ -49,7 +49,7 @@ group :assets do
gem 'uglifier', '>= 1.0.3'
gem 'turbo-sprockets-rails3'
gem 'zurb-foundation', :github => 'zurb/foundation'
gem "foundation-rails"
end
gem 'foundation_rails_helper', github: 'willrjmarshall/foundation_rails_helper', branch: "rails3"

View File

@@ -103,13 +103,6 @@ GIT
activemodel (>= 3.0)
railties (>= 3.0)
GIT
remote: git://github.com/zurb/foundation.git
revision: a81d639847ba5fc2e324b749b8e409e31e8d83c9
specs:
zurb-foundation (4.3.1)
sass (>= 3.2.0)
PATH
remote: lib/chili/eaterprises_feature
specs:
@@ -197,7 +190,7 @@ GEM
timers (~> 1.1.0)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
chunky_png (1.2.8)
chunky_png (1.3.0)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.1)
@@ -216,10 +209,10 @@ GEM
active_link_to (~> 1.0.0)
paperclip (>= 2.3.0)
rails (>= 3.0.0)
compass (0.12.2)
compass (0.12.4)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
sass (~> 3.2.17)
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
crack (0.4.1)
@@ -273,6 +266,9 @@ GEM
nokogiri (~> 1.5)
ruby-hmac
formatador (0.2.4)
foundation-rails (5.2.1.0)
railties (>= 3.1.0)
sass (>= 3.2.0)
fssm (0.2.10)
geocoder (1.1.8)
gmaps4rails (1.5.6)
@@ -335,7 +331,7 @@ GEM
money (5.0.0)
i18n (~> 0.4)
json
multi_json (1.8.4)
multi_json (1.9.2)
multi_xml (0.5.5)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
@@ -373,7 +369,7 @@ GEM
rack (>= 0.4)
rack-livereload (0.3.15)
rack
rack-ssl (1.3.3)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
@@ -430,7 +426,7 @@ GEM
ruby-hmac (0.4.0)
rubyzip (0.9.9)
safe_yaml (0.9.5)
sass (3.2.12)
sass (3.2.18)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
@@ -461,7 +457,7 @@ GEM
therubyracer (0.12.0)
libv8 (~> 3.16.14.0)
ref
thor (0.18.1)
thor (0.19.0)
tilt (1.4.1)
timecop (0.6.2.2)
timers (1.1.0)
@@ -522,6 +518,7 @@ DEPENDENCIES
eaterprises_feature!
factory_girl_rails
faker
foundation-rails
foundation_rails_helper!
geocoder
gmaps4rails
@@ -547,7 +544,7 @@ DEPENDENCIES
rails (= 3.2.17)
representative_view
rspec-rails
sass
sass (~> 3.2)
sass-rails (~> 3.2.3)
shoulda-matchers
simple_form!
@@ -566,4 +563,3 @@ DEPENDENCIES
unicorn
unicorn-rails
webmock
zurb-foundation!

View File

@@ -13,4 +13,4 @@
$ ->
$(document).foundation()
$(document).foundation('reveal', {animation: 'fade'})
$(document).foundation({reveal: {animation: 'fade'}})

View File

@@ -1,20 +1,20 @@
Foundation.libs.section.toggle_active = (e)->
$this = $(this)
self = Foundation.libs.section
region = $this.parent()
content = $this.siblings(self.settings.content_selector)
section = region.parent()
settings = $.extend({}, self.settings, self.data_options(section))
prev_active_region = section.children(self.settings.region_selector).filter("." + self.settings.active_class)
#Foundation.libs.section.toggle_active = (e)->
#$this = $(this)
#self = Foundation.libs.section
#region = $this.parent()
#content = $this.siblings(self.settings.content_selector)
#section = region.parent()
#settings = $.extend({}, self.settings, self.data_options(section))
#prev_active_region = section.children(self.settings.region_selector).filter("." + self.settings.active_class)
#for anchors inside [data-section-title]
e.preventDefault() if not settings.deep_linking and content.length > 0
e.stopPropagation() #do not catch same click again on parent
unless region.hasClass(self.settings.active_class)
prev_active_region.removeClass self.settings.active_class
region.addClass self.settings.active_class
#force resize for better performance (do not wait timer)
self.resize region.find(self.settings.section_selector).not("[" + self.settings.resized_data_attr + "]"), true
else if not settings.one_up# and (self.small(section) or self.is_vertical_nav(section) or self.is_horizontal_nav(section) or self.is_accordion(section))
region.removeClass self.settings.active_class
settings.callback section
##for anchors inside [data-section-title]
#e.preventDefault() if not settings.deep_linking and content.length > 0
#e.stopPropagation() #do not catch same click again on parent
#unless region.hasClass(self.settings.active_class)
#prev_active_region.removeClass self.settings.active_class
#region.addClass self.settings.active_class
##force resize for better performance (do not wait timer)
#self.resize region.find(self.settings.section_selector).not("[" + self.settings.resized_data_attr + "]"), true
#else if not settings.one_up# and (self.small(section) or self.is_vertical_nav(section) or self.is_horizontal_nav(section) or self.is_accordion(section))
#region.removeClass self.settings.active_class
#settings.callback section

View File

@@ -11,5 +11,8 @@
//= require spin
//= require foundation
//= require_tree .
//
// Hacky fix for issue - http://foundation.zurb.com/forum/posts/2112-foundation-5100-syntax-error-in-js
Foundation.set_namespace = function() {};
$(function(){ $(document).foundation(); });

View File

@@ -1,7 +1,16 @@
%tabs
.row
.section-container.auto{"data-section" => "", "data-options" => "one_up: false"}
= render 'shop/shop/about_us'
= render 'shop/shop/producers'
= render 'shop/shop/groups'
= render 'shop/shop/contact'
%dl.tabs{"data-tab" => ""}
%dd
%a{href: "#about"} About Us
%dd
%a{href: "#producers"} Our Producers
%dd
%a{href: "#groups"} Our Groups
%dd
%a{href: "#contact"} Contact
.tabs-content
-#.section-container.auto{"data-section" => "", "data-options" => "one_up: false"}
= render 'shop/shop/about_us'
= render 'shop/shop/producers'
= render 'shop/shop/groups'
= render 'shop/shop/contact'

View File

@@ -1,10 +1,3 @@
%section#about{class: current_order_cycle ? nil : "active" }
%p.title.avenir{"data-section-title" => ""}
%a{href: "#about"} About Us
.content{"data-section-content" => ""}
%img.about.right{src: current_distributor.promo_image.url(:large)}
%p= current_distributor.long_description.andand.html_safe
-#.panel
-#= @distributor.distributor_info.andand.html_safe
.content#about
%img.about.right{src: current_distributor.promo_image.url(:large)}
%p= current_distributor.long_description.andand.html_safe

View File

@@ -1,18 +1,15 @@
%section
%p.title.avenir{"data-section-title" => ""}
%a{href: "#contact"} Contact
.content{"data-section-content" => ""}
.panel
%p
%strong E
%a{href: "mailto:#{current_distributor.email}"}= current_distributor.email
- unless current_distributor.website.blank?
%br
%strong W
%a{href: current_distributor.website}= current_distributor.website
.content#contact
.panel
%p
%strong E
%a{href: "mailto:#{current_distributor.email}"}= current_distributor.email
- unless current_distributor.website.blank?
%br
= [current_distributor.address.address1, current_distributor.address.address2].join ", "
%br
= current_distributor.address.city
= current_distributor.address.state
= current_distributor.address.zipcode
%strong W
%a{href: current_distributor.website}= current_distributor.website
%br
= [current_distributor.address.address1, current_distributor.address.address2].join ", "
%br
= current_distributor.address.city
= current_distributor.address.state
= current_distributor.address.zipcode

View File

@@ -1,13 +1,10 @@
%section
%p.title.avenir{"data-section-title" => ""}
%a{href: "#groups"} Our Groups
.content{"data-section-content" => ""}
%ul
- for group in current_distributor.groups
%li
%h4= group.name
%ul
- for sibling in group.enterprises.except(current_distributor)
%li
%a{"data-reveal-id" => "sibling_details_#{sibling.id}"}
= sibling.name
.content#groups
%ul
- for group in current_distributor.groups
%li
%h4= group.name
%ul
- for sibling in group.enterprises.except(current_distributor)
%li
%a{"data-reveal-id" => "sibling_details_#{sibling.id}"}
= sibling.name

View File

@@ -1,9 +1,6 @@
%section
%p.title.avenir{"data-section-title" => ""}
%a{href: "#producers"} Our Producers
.content{"data-section-content" => ""}
%ul
- for producer in current_producers
%li
%a{"data-reveal-id" => "producer_details_#{producer.id}"}
= producer.name
.content#producers
%ul
- for producer in current_producers
%li
%a{"data-reveal-id" => "producer_details_#{producer.id}"}
= producer.name

View File

@@ -10,6 +10,8 @@ feature "As a consumer I want to shop with a distributor", js: true do
before do #temporarily using the old way to select distributor
create_enterprise_group_for distributor
visit "/"
save_and_open_page
binding.pry
click_link distributor.name
end