Merge branch 'master' into working

This commit is contained in:
Rob H
2014-06-20 12:29:47 +10:00
25 changed files with 146 additions and 104 deletions

View File

@@ -0,0 +1,2 @@
Darkswarm.controller "AboutUsCtrl", ($scope, CurrentHub) ->
$scope.CurrentHub = CurrentHub

View File

@@ -1,5 +1,2 @@
Darkswarm.factory 'CurrentHub', ($location, $filter, currentHub) ->
new class CurrentHub
constructor: ->
@[k] = v for k, v of currentHub
Darkswarm.factory 'CurrentHub', ($location, $filter, currentHub, Enterprises) ->
Enterprises.enterprises_by_id[currentHub.id] || {}

View File

@@ -13,7 +13,7 @@
%h5.modal-header About
.about-container
%img.enterprise-logo{"bo-src" => "enterprise.logo", "bo-if" => "enterprise.logo"}
%p.modal-small{"ng-bind-html" => "enterprise.long_description"}
%p.text-small{"ng-bind-html" => "enterprise.long_description"}
.small-12.large-4.columns
%ng-include{src: "'partials/contact.html'"}
%ng-include{src: "'partials/follow.html'"}
@@ -43,7 +43,7 @@
%i.ofn-i_033-open-sign{"bo-if" => "enterprise.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!enterprise.active"}
{{enterprise.name}}
.button-address ( {{ enterprise.address.city }} , {{enterprise.address.state}} )
.button-address {{ enterprise.address.city }} , {{enterprise.address.state}}
%i.ofn-i_007-caret-right
%a.close-reveal-modal.outside{"ng-click" => "$close()"}

View File

@@ -13,7 +13,7 @@
%h5.modal-header About
.about-container
%img.enterprise-logo{"bo-src" => "enterprise.logo", "bo-if" => "enterprise.logo"}
%p.modal-small{"ng-bind-html" => "enterprise.long_description"}
%p.text-small{"ng-bind-html" => "enterprise.long_description"}
.small-12.large-4.columns
%ng-include{src: "'partials/contact.html'"}
%ng-include{src: "'partials/follow.html'"}

View File

@@ -52,14 +52,6 @@
border-left: 1px solid $dark-grey
border-right: 1px solid $dark-grey
border-bottom: 1px solid $dark-grey
// &:hover
// background-color: $disabled-dark
// a
// display: block
// padding: 0.8em 0.5em
// margin: 0 -0.9375rem
// &, & *
// color: white
p
padding-top: 1em

View File

@@ -18,6 +18,14 @@
max-height: 260px
overflow: hidden
.hero-img-small
background-color: #333
width: 100%
min-height: 60px
height: inherit
overflow: hidden
margin: 0 0 1rem 0 !important
.producer-logo
max-width: 220px

View File

@@ -9,6 +9,10 @@ nav
@include textpress
// Default overrides - big menu
.top-bar-section ul li.ofn-logo > a
display: table-cell
vertical-align: middle
.top-bar-section .has-dropdown > a
padding-right: 15px !important

View File

@@ -91,17 +91,9 @@
.cta-container
padding-bottom: 0.75rem
padding-top: 0.5rem
.button.hub
margin-bottom: 0.25rem
// Generic styles for use
.modal-small
font-size: 0.875rem
margin-bottom: 0.5rem
&, & *
font-size: 0.875rem
.modal-centered
text-align: center
p

View File

@@ -22,3 +22,18 @@ dialog .close-reveal-modal.outside, .reveal-modal .close-reveal-modal.outside
&:hover, &:active, &:focus
text-shadow: 0 1px 3px #333
border: 1px solid white
@media all and (max-width: 640px)
top: 0.5rem
right: 0.5rem
font-size: 2rem
color: white
text-shadow: none
padding: 0.25rem
background-color: rgba(150,150,150,0.85)
@include border-radius(999999)
border: 1px solid transparent
&:hover, &:active, &:focus
text-shadow: 0 1px 3px #333
border: 1px solid white

View File

@@ -16,6 +16,7 @@
.active_table_row:nth-child(2)
border-left: 1px solid $clr-turquoise
border-right: 1px solid $clr-turquoise
border-bottom: 1px solid $clr-turquoise
.active_table_row.link
border-left: 1px solid $clr-turquoise
border-right: 1px solid $clr-turquoise

View File

@@ -6,22 +6,38 @@
display: inline-block
line-height: 1
margin-right: 0.5rem
margin-bottom: 0.2rem
margin-bottom: 0.35rem
text-transform: uppercase
font-size: 1rem
// border: 1px solid $disabled-bright
padding: 0.25rem 0.5rem 0.25rem 0.35rem
font-weight: 300
font-size: 0.875rem
background: rgba(235,235,235,0.5)
color: #555
@include border-radius(3px)
padding: 0.25rem 0.5rem 0.35rem 0.35rem
render-svg
svg
width: 16px
height: 16px
path
fill: $dark-grey
fill: #555
&, &*
display: inline-block
color: $dark-grey
color: #555
// &:hover, &.hover, &:active
// background: rgba(255,255,255,0.5)
.product-header
render-svg
svg
width: 32px
height: 32px
path
fill: black
@media all and (max-width: 640px)
render-svg
svg
width: 24px
height: 24px
.summary-header
@include csstrans

View File

@@ -29,6 +29,12 @@ a
small, .small
font-size: 0.75rem
.text-small
font-size: 0.875rem
margin-bottom: 0.5rem
&, & *
font-size: 0.875rem
@mixin avenir
font-family: "AvenirBla_IE", "AvenirBla"

View File

@@ -1,3 +1,5 @@
= inject_enterprises
.darkswarm
- content_for :order_cycle_form do
%strong.avenir

View File

@@ -1,28 +1,34 @@
.row.active_table_row{"ng-show" => "open()"}
.columns.small-4
%h5
%i.ofn-i_029-shopping-basket
Shop for
%p.trans-sentence
%span.fat-taxons{"ng-repeat" => "taxon in hub.taxons"}
%render-svg{path: "{{taxon.icon}}"}
{{taxon.name}}
.columns.small-4
%h5 Delivery options
%ol
%li.pickup{"bo-if" => "hub.pickup"}
%i.ofn-i_038-takeaway
Pickup
%li.delivery{"bo-if" => "hub.delivery"}
%i.ofn-i_039-delivery
Delivery
.columns.small-4
%h5
%i.ofn-i_036-producers
Our producers
%ul.bullet-list
%li{"ng-repeat" => "producer in hub.producers"}
= render partial: "modals/producer"
.columns.small-12.large-4
 
%div{"bo-if" => "hub.taxons"}
%h5
%i.ofn-i_029-shopping-basket
Shop for
%p.trans-sentence
%span.fat-taxons{"ng-repeat" => "taxon in hub.taxons"}
%render-svg{path: "{{taxon.icon}}"}
{{taxon.name}}
.columns.small-12.large-4
 
%div{"bo-if" => "hub.pickup || hub.delivery"}
%h5 Delivery options
%ol
%li.pickup{"bo-if" => "hub.pickup"}
%i.ofn-i_038-takeaway
Pickup
%li.delivery{"bo-if" => "hub.delivery"}
%i.ofn-i_039-delivery
Delivery
.columns.small-12.large-4
 
%div{"bo-if" => "hub.producers"}
%h5
%i.ofn-i_036-producers
Our producers
%ul.bullet-list
%li{"ng-repeat" => "enterprise in hub.producers"}
= render partial: "modals/producer"
.row.active_table_row.link{"ng-show" => "open()", "bo-if" => "hub.active"}
.cta-container.columns.small-12
@@ -38,5 +44,5 @@
%i.ofn-i_033-open-sign{"bo-if" => "hub.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!hub.active"}
{{hub.name}}
.button-address ({{ [hub.address.city, hub.address.state] | printArray }})
.button-address {{ [hub.address.city, hub.address.state] | printArray }}
%i.ofn-i_007-caret-right

View File

@@ -1,6 +1,5 @@
= inject_enterprises
#hubs.hubs{"ng-controller" => "HubsCtrl"}
= inject_enterprises
.row
.small-12.columns.text-center
%h1 Ready to shop?

View File

@@ -1,8 +1,2 @@
object current_distributor
attributes :name, :id
if current_distributor
child suppliers: :producers do
extends "json/producer"
end
end
attributes :id

View File

@@ -1,5 +1,3 @@
= inject_enterprises
.map-container{"fill-vertical" => true}
%map{"ng-controller" => "MapCtrl"}
%google-map{options: "map.additional_options", center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}

View File

@@ -2,7 +2,7 @@
.row
.columns.small-12.large-6
%img.product-img{"ng-src" => "{{product.master.images[0].large_url}}", "ng-if" => "product.master.images[0]"}
.columns.small-12.large-6
.columns.small-12.large-6.product-header
%h2
%render-svg{path: "{{product.primary_taxon.icon}}"}
{{product.name}}

View File

@@ -1,25 +1,36 @@
.row.active_table_row{"ng-show" => "open()"}
.columns.small-4
%strong Shop for
%p.trans-sentence
{{ producer.taxons | printArrayOfObjects }}
.columns.small-8
%strong About us
%p
{{ producer.description }}
.columns.small-12.large-4
 
%div{"bo-if" => "producer.taxons"}
%h5
%i.ofn-i_029-shopping-basket
Shop for
%p.trans-sentence
%span.fat-taxons{"ng-repeat" => "taxon in producer.taxons"}
%render-svg{path: "{{taxon.icon}}"}
{{taxon.name}}
.columns.small-12.large-3
 
%img{src: "{{ producer.logo }}" }
.columns.small-12.large-5
 
%div{"bo-if" => "producer.description"}
%h5 About us
%p.text-small
{{ producer.description }}
.row.active_table_row.link{"ng-show" => "open()"}
.columns.small-11
Shop for {{ producer.name }} products at:
%a{"ng-repeat" => "hub in producer.hubs",
"bo-href" => "hub.path", "ofn-empties-cart" => "hub",
"bo-class" => "{primary: hub.active, secondary: !hub.active}"}
%i.ofn-i_033-open-sign{"bo-if" => "hub.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!hub.active"}
{{hub.name}}
( {{ hub.address.city }} , {{hub.address.state}} )
.columns.small-1.text-right
%a{"bo-href" => "hub.path"}
%i.ofn-i_007-caret-right
.row.active_table_row.link{"ng-show" => "open()", "bo-if" => "producer.hubs"}
.cta-container.columns.small-12
.row
.columns.small-12
%h5 Shop for {{ producer.name }} products at:
.row
.columns.small-12
%a.button.hub{"ng-repeat" => "hub in producer.hubs",
"bo-href" => "hub.path", "ofn-empties-cart" => "hub",
"bo-class" => "{primary: hub.active, secondary: !hub.active}"}
%i.ofn-i_033-open-sign{"bo-if" => "hub.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!hub.active"}
{{hub.name}}
.button-address {{ [hub.address.city, hub.address.state] | printArray }}
%i.ofn-i_007-caret-right

View File

@@ -1,6 +1,5 @@
= inject_enterprises
.producers{"ng-controller" => "ProducersCtrl"}
= inject_enterprises
.row
.small-12.columns.text-center.pad-top
%h1 Producers

View File

@@ -1,9 +1,7 @@
%products.small-12.columns{"ng-controller" => "ProductsCtrl", "ng-show" => "order_cycle.order_cycle_id != null",
"infinite-scroll" => "incrementLimit()", "infinite-scroll-distance" => "1"}
= inject_enterprises
= form_for :order, :url => populate_orders_path, html: {:class => "custom"} do
.row
.small-6.columns
%input#search.text{"ng-model" => "query",

View File

@@ -1,3 +1,5 @@
= inject_enterprises
%shop.darkswarm
- content_for :order_cycle_form do

View File

@@ -1,9 +1,9 @@
.content#about
.content#about{"ng-controller" => "AboutUsCtrl", bindonce: true}
.row
.small-12.large-9.columns
%p= current_distributor.long_description.andand.html_safe
-#- if current_distributor.promo_image.exists?
-#.small-12.large-3.columns
-#%img.about.right{src: current_distributor.promo_image.url(:large)}
.small-12.large-6.columns
%img.hero-img-small{"bo-src" => "CurrentHub.promo_image"}
%p.small-text{"bo-html" => "CurrentHub.long_description"}
.small-12.large-3.columns
 
.small-12.large-3.columns
%img{"bo-src" => "CurrentHub.logo", "bo-if" => "CurrentHub.logo"}

View File

@@ -4,5 +4,5 @@
%h5
= "#{current_distributor.name}'s producers:"
%ul.bullet-list
%li{"ng-repeat" => "producer in CurrentHub.producers"}
%li{"ng-repeat" => "enterprise in CurrentHub.producers"}
= render partial: "modals/producer"

View File

@@ -89,7 +89,7 @@ module Openfoodnetwork
# Instead, they must be explicitly included below
# http://stackoverflow.com/questions/8012434/what-is-the-purpose-of-config-assets-precompile
config.assets.initialize_on_precompile = true
config.assets.precompile += ['store/all.css', 'store/all.js', 'store/shop_front.js']
config.assets.precompile += ['store/all.css', 'store/all.js', 'store/shop_front.js', 'iehack.js']
config.assets.precompile += ['admin/all.css', 'admin/restore_spree_from_cms.css', 'admin/*.js', 'admin/**/*.js']
config.assets.precompile += ['darkswarm/all.css', 'darkswarm/all.js']
config.assets.precompile += ['comfortable_mexican_sofa/*']