mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-31 06:31:41 +00:00
Merge branch 'master' into units
This commit is contained in:
35
app/assets/images/map-icon-both.svg
Normal file
35
app/assets/images/map-icon-both.svg
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="30.194px" height="40px" viewBox="72.098 -63.317 30.194 40" enable-background="new 72.098 -63.317 30.194 40"
|
||||
xml:space="preserve">
|
||||
<g id="Layer_1">
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#A84333" d="M87.195-23.817c-0.114,0-0.229-0.039-0.322-0.117c-0.582-0.49-14.274-12.143-14.274-24.259
|
||||
c0-8.063,6.548-14.624,14.597-14.624s14.597,6.561,14.597,14.624c0,12.331-13.695,23.78-14.278,24.262
|
||||
C87.421-23.855,87.308-23.817,87.195-23.817z"/>
|
||||
<path fill="#E5E5E5" d="M87.195-62.317c8.012,0,14.097,6.536,14.097,14.124c0,12.237-14.097,23.876-14.097,23.876
|
||||
S73.098-36.17,73.098-48.193C73.098-55.781,79.184-62.317,87.195-62.317 M87.195-63.317c-8.324,0-15.097,6.785-15.097,15.124
|
||||
c0,12.346,13.863,24.145,14.453,24.641c0.186,0.156,0.415,0.235,0.644,0.235c0.226,0,0.452-0.076,0.637-0.229
|
||||
c0.59-0.487,14.46-12.083,14.46-24.647C102.292-56.532,95.519-63.317,87.195-63.317L87.195-63.317z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#186D5D" d="M87.195-30.817c-0.114,0-0.229-0.039-0.322-0.117c-0.37-0.312-9.081-7.726-9.081-15.462
|
||||
c0-5.194,4.219-9.42,9.403-9.42s9.403,4.226,9.403,9.42c0,7.874-8.714,15.159-9.085,15.465
|
||||
C87.421-30.855,87.308-30.817,87.195-30.817z"/>
|
||||
<path fill="#E5E5E5" d="M87.195-55.317c5.06,0,8.903,4.128,8.903,8.92c0,7.729-8.903,15.08-8.903,15.08
|
||||
s-8.903-7.487-8.903-15.08C78.292-51.189,82.135-55.317,87.195-55.317 M87.195-56.317c-5.461,0-9.903,4.45-9.903,9.92
|
||||
c0,7.967,8.882,15.527,9.26,15.845c0.186,0.156,0.415,0.235,0.644,0.235c0.226,0,0.452-0.076,0.637-0.229
|
||||
c0.378-0.312,9.267-7.744,9.267-15.851C97.098-51.866,92.656-56.317,87.195-56.317L87.195-56.317z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="source_files" display="none">
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
35
app/assets/images/map-icon-hub.svg
Normal file
35
app/assets/images/map-icon-hub.svg
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="30.194px" height="40px" viewBox="-27.975 -63.317 30.194 40" enable-background="new -27.975 -63.317 30.194 40"
|
||||
xml:space="preserve">
|
||||
<g id="Layer_1">
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#A84333" d="M-12.878-23.817c-0.114,0-0.229-0.039-0.322-0.117c-0.583-0.49-14.275-12.143-14.275-24.259
|
||||
c0-8.063,6.548-14.624,14.597-14.624S1.719-56.256,1.719-48.193c0,12.331-13.696,23.78-14.279,24.262
|
||||
C-12.652-23.855-12.766-23.817-12.878-23.817z"/>
|
||||
<path fill="#E5E5E5" d="M-12.878-62.317c8.012,0,14.097,6.536,14.097,14.124c0,12.237-14.097,23.876-14.097,23.876
|
||||
S-26.975-36.17-26.975-48.193C-26.975-55.781-20.89-62.317-12.878-62.317 M-12.878-63.317c-8.324,0-15.097,6.785-15.097,15.124
|
||||
c0,12.346,13.863,24.145,14.453,24.641c0.186,0.156,0.415,0.235,0.644,0.235c0.226,0,0.452-0.076,0.637-0.229
|
||||
c0.59-0.487,14.46-12.083,14.46-24.647C2.219-56.532-4.554-63.317-12.878-63.317L-12.878-63.317z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path fill="#FFFFFF" d="M-11.075-41.6c1.854-3.218,3.932-7.308,3.932-9.517c-0.001-3.161-2.574-5.734-5.736-5.734
|
||||
c-3.162,0-5.735,2.573-5.735,5.735c0,2.212,2.076,6.301,3.932,9.517c-2.107,0.338-3.493,1.226-3.493,2.297
|
||||
c-0.001,1.397,2.276,2.451,5.296,2.451s5.296-1.054,5.296-2.452C-7.583-40.375-8.969-41.262-11.075-41.6z M-15.734-51.117
|
||||
c0-1.575,1.281-2.854,2.855-2.854c1.575,0,2.856,1.28,2.856,2.854c0,1.576-1.281,2.858-2.856,2.858
|
||||
C-14.453-48.259-15.734-49.541-15.734-51.117z M-12.879-37.583c-2.69,0-4.565-0.905-4.565-1.72c0-0.607,1.174-1.363,3.151-1.621
|
||||
c0.095,0.163,0.175,0.294,0.261,0.439c0.047,0.079,0.097,0.161,0.141,0.237c0.109,0.179,0.201,0.329,0.288,0.472
|
||||
c0.028,0.044,0.057,0.094,0.083,0.134c0.094,0.155,0.167,0.272,0.223,0.363c0.006,0.007,0.014,0.022,0.02,0.031
|
||||
c0.056,0.09,0.089,0.141,0.089,0.141l0.308,0.487l0.311-0.487c0,0,0.029-0.046,0.084-0.132c0.013-0.02,0.031-0.051,0.047-0.077
|
||||
c0.055-0.086,0.119-0.189,0.204-0.329c0.02-0.031,0.042-0.069,0.064-0.101c0.091-0.151,0.191-0.314,0.308-0.508
|
||||
c0.039-0.066,0.085-0.143,0.127-0.215c0.089-0.148,0.173-0.287,0.271-0.454c1.978,0.258,3.15,1.013,3.15,1.621
|
||||
C-8.315-38.488-10.19-37.583-12.879-37.583z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="source_files" display="none">
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
39
app/assets/images/map-icon-producer.svg
Normal file
39
app/assets/images/map-icon-producer.svg
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="30.194px" height="40px" viewBox="22.265 -63.317 30.194 40" enable-background="new 22.265 -63.317 30.194 40"
|
||||
xml:space="preserve">
|
||||
<g id="Layer_1">
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#186D5D" d="M37.362-23.817c-0.114,0-0.229-0.039-0.322-0.117c-0.583-0.49-14.275-12.143-14.275-24.259
|
||||
c0-8.063,6.548-14.624,14.597-14.624s14.597,6.561,14.597,14.624c0,12.331-13.695,23.78-14.278,24.262
|
||||
C37.588-23.855,37.475-23.817,37.362-23.817z"/>
|
||||
<path fill="#E5E5E5" d="M37.362-62.317c8.012,0,14.097,6.536,14.097,14.124c0,12.237-14.097,23.876-14.097,23.876
|
||||
S23.265-36.17,23.265-48.193C23.265-55.781,29.351-62.317,37.362-62.317 M37.362-63.317c-8.324,0-15.097,6.785-15.097,15.124
|
||||
c0,12.346,13.863,24.145,14.453,24.641c0.186,0.156,0.415,0.235,0.644,0.235c0.226,0,0.452-0.076,0.637-0.229
|
||||
c0.59-0.487,14.46-12.083,14.46-24.647C52.459-56.532,45.687-63.317,37.362-63.317L37.362-63.317z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M30.582-48.026c2.868-0.803,5.752,1.237,6.111,4.19c0.013,0.119,0.031,0.239,0.051,0.388
|
||||
c0.127,0.016,0.245,0.045,0.36,0.041c2.406-0.062,4.816-0.066,7.22-0.187c-1.002,0.278-1.741,1.196-1.741,2.285
|
||||
c0,1.31,1.064,2.374,2.375,2.374c1.309,0,2.375-1.064,2.375-2.374c0-1.184-0.874-2.165-2.008-2.343
|
||||
c1.773-0.112,1.43-0.058,1.727-1.654c0.144-0.77,0.235-1.551,0.299-2.331c0.061-0.729-0.124-0.9-0.838-0.928
|
||||
c-1.063-0.038-2.043-0.078-3.105-0.121c-0.032-0.001-0.085-0.024-0.085-0.066c0-0.801,0.041-2.747,0.041-2.747
|
||||
s-0.43-0.316-0.925-0.039c0,0.908,0,1.829,0,2.794c0,0-1.296-0.034-3.144-0.072c-0.082-0.002-0.31-0.141-0.418-0.433
|
||||
c-0.278-0.767-0.885-2.262-1.681-4.562c0,0-0.412-0.982-1.455-0.982c-0.863,0-5.174,0-5.174,0v5.749c0,0-0.39,0.164-0.717,0.197
|
||||
C29.711-48.005,29.798-47.807,30.582-48.026z M46.205-41.308c0,0.688-0.56,1.248-1.247,1.248c-0.687,0-1.247-0.56-1.247-1.248
|
||||
c0-0.687,0.56-1.246,1.247-1.246C45.645-42.554,46.205-41.995,46.205-41.308z M31.835-52.03l0.004-1.072l4.376-0.007l1.397,4.217
|
||||
l0.05,0.02c-1.906-0.026-4.042,0.002-5.83,0.067L31.835-52.03z"/>
|
||||
<path fill="#FFFFFF" d="M31.661-47.507c-2.371,0-4.299,1.928-4.299,4.298c0,2.37,1.928,4.298,4.299,4.298
|
||||
c2.369,0,4.296-1.928,4.296-4.298C35.958-45.579,34.03-47.507,31.661-47.507z M31.661-40.823c-1.317,0-2.387-1.07-2.387-2.386
|
||||
c0-1.316,1.07-2.387,2.387-2.387c1.316,0,2.387,1.071,2.387,2.387C34.048-41.893,32.977-40.823,31.661-40.823z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="source_files" display="none">
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -7,6 +7,8 @@
|
||||
#= require angular-cookies
|
||||
#= require angular-sanitize
|
||||
#= require angular-resource
|
||||
#= require lodash.underscore.js
|
||||
#= require angular-google-maps.min.js
|
||||
#= require ../shared/mm-foundation-tpls-0.2.0-SNAPSHOT
|
||||
#= require ../shared/bindonce.min.js
|
||||
#= require ../shared/ng-infinite-scroll.min.js
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
Darkswarm.controller "AccordionCtrl", ($scope, storage, $timeout) ->
|
||||
Darkswarm.controller "AccordionCtrl", ($scope, storage, $timeout, CurrentHub) ->
|
||||
$scope.accordion =
|
||||
details: true
|
||||
shipping: false
|
||||
payment: false
|
||||
billing: false
|
||||
storage.bind $scope, "accordion", {storeName: "accordion_#{$scope.order.id}"}
|
||||
storage.bind $scope, "accordion", {storeName: "accordion_#{$scope.order.id}#{CurrentHub.id}#{$scope.order.user_id}"}
|
||||
|
||||
$scope.show = (name)->
|
||||
$scope.accordion[name] = true
|
||||
|
||||
$timeout =>
|
||||
if $scope.checkout.$valid
|
||||
for k, v of $scope.accordion
|
||||
$scope.accordion[k] = false
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "BillingCtrl", ($scope) ->
|
||||
Darkswarm.controller "BillingCtrl", ($scope, $timeout) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
$scope.name = "billing"
|
||||
$scope.nextPanel = "shipping"
|
||||
@@ -8,3 +8,4 @@ Darkswarm.controller "BillingCtrl", ($scope) ->
|
||||
$scope.order.bill_address.city,
|
||||
$scope.order.bill_address.zipcode]
|
||||
|
||||
$timeout $scope.onTimeout
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
Darkswarm.controller "CheckoutCtrl", ($scope, storage, CheckoutFormState, Order, CurrentUser) ->
|
||||
Darkswarm.controller "CheckoutCtrl", ($scope, storage, Order, CurrentUser) ->
|
||||
$scope.Order = Order
|
||||
storage.bind $scope, "Order.order", {storeName: "order_#{Order.order.id}#{Order.order.user_id}"}
|
||||
Order.bindFieldsToLocalStorage($scope)
|
||||
|
||||
$scope.order = Order.order # Ordering is important
|
||||
$scope.secrets = Order.secrets
|
||||
|
||||
$scope.enabled = if CurrentUser then true else false
|
||||
|
||||
$scope.purchase = (event)->
|
||||
event.preventDefault()
|
||||
$scope.Order.submit()
|
||||
|
||||
$scope.CheckoutFormState = CheckoutFormState
|
||||
storage.bind $scope, "CheckoutFormState.ship_address_same_as_billing", { defaultValue: true}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Darkswarm.controller "DetailsCtrl", ($scope) ->
|
||||
Darkswarm.controller "DetailsCtrl", ($scope, $timeout) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
|
||||
$scope.name = "details"
|
||||
$scope.nextPanel = "billing"
|
||||
|
||||
@@ -12,3 +11,5 @@ Darkswarm.controller "DetailsCtrl", ($scope) ->
|
||||
$scope.fullName = ->
|
||||
[$scope.order.bill_address.firstname ? null,
|
||||
$scope.order.bill_address.lastname ? null].join(" ").trim()
|
||||
|
||||
$timeout $scope.onTimeout
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
Darkswarm.controller "PaymentCtrl", ($scope) ->
|
||||
Darkswarm.controller "PaymentCtrl", ($scope, $timeout) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
$scope.name = "payment"
|
||||
|
||||
$scope.months = {1: "January", 2: "February", 3: "March", 4: "April", 5: "May", 6: "June", 7: "July", 8: "August", 9: "September", 10: "October", 11: "November", 12: "December"}
|
||||
$scope.years = [moment().year()..(moment().year()+15)]
|
||||
$scope.secrets.card_month = "1"
|
||||
$scope.secrets.card_year = moment().year()
|
||||
$timeout $scope.onTimeout
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Darkswarm.controller "ShippingCtrl", ($scope) ->
|
||||
Darkswarm.controller "ShippingCtrl", ($scope, $timeout) ->
|
||||
angular.extend(this, new FieldsetMixin($scope))
|
||||
$scope.name = "shipping"
|
||||
$scope.nextPanel = "payment"
|
||||
|
||||
$timeout $scope.onTimeout
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Darkswarm.controller "MapCtrl", ($scope, MapConfiguration, OfnMap)->
|
||||
$scope.OfnMap = OfnMap
|
||||
$scope.map =
|
||||
center:
|
||||
latitude: -37.4713077
|
||||
longitude: 144.7851531
|
||||
zoom: 12
|
||||
styles: MapConfiguration.options
|
||||
@@ -6,6 +6,7 @@ window.Darkswarm = angular.module("Darkswarm", ["ngResource",
|
||||
'angular-flash.service',
|
||||
'templates',
|
||||
'ngSanitize',
|
||||
'google-maps',
|
||||
'backstretch']).config ($httpProvider, $tooltipProvider, $locationProvider, $anchorScrollProvider) ->
|
||||
$httpProvider.defaults.headers.post['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
|
||||
$httpProvider.defaults.headers.put['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.directive "ofnEmptiesCart", (CurrentHub, CurrentOrder, Navigation) ->
|
||||
Darkswarm.directive "ofnEmptiesCart", (CurrentHub, CurrentOrder, Navigation, storage) ->
|
||||
restrict: "A"
|
||||
scope:
|
||||
hub: '=ofnEmptiesCart'
|
||||
@@ -10,6 +10,7 @@ Darkswarm.directive "ofnEmptiesCart", (CurrentHub, CurrentOrder, Navigation) ->
|
||||
elm.bind 'click', (ev)->
|
||||
ev.preventDefault()
|
||||
if confirm "Are you sure? This will change your selected Hub and remove any items in you shopping cart."
|
||||
storage.clearAll() # One day this will have to be moar GRANULAR
|
||||
Navigation.go scope.hub.path
|
||||
else
|
||||
scope.action = attr.shop
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
Darkswarm.directive "fillVertical", ($window)->
|
||||
restrict: 'A'
|
||||
|
||||
link: (scope, element, attrs)->
|
||||
setSize = ->
|
||||
element.css "height", ($window.innerHeight - element.offset().top)
|
||||
setSize()
|
||||
|
||||
angular.element($window).bind "resize", ->
|
||||
setSize()
|
||||
@@ -1,15 +1,25 @@
|
||||
Darkswarm.directive "ofnFlash", (flash, $timeout)->
|
||||
Darkswarm.directive "ofnFlash", (flash, $timeout, RailsFlashLoader)->
|
||||
# Mappings between flash types (left) and Foundation classes
|
||||
typePairings =
|
||||
info: "info"
|
||||
error: "alert"
|
||||
success: "success"
|
||||
scope: {}
|
||||
restrict: 'AE'
|
||||
template: "<alert ng-repeat='flash in flashes' type='flash.type'>{{flash.message}}</alert>"
|
||||
restrict: 'E'
|
||||
templateUrl: "flash.html"
|
||||
controller: ($scope)->
|
||||
$scope.closeAlert = (index)->
|
||||
$scope.flashes.splice(index, 1)
|
||||
|
||||
link: ($scope, element, attr) ->
|
||||
$scope.flashes = []
|
||||
show = (message, type)->
|
||||
show = (message, type)=>
|
||||
if message
|
||||
$scope.flashes.push({message: message, type: type})
|
||||
$scope.flashes.push({message: message, type: typePairings[type]})
|
||||
$timeout($scope.delete, 5000)
|
||||
|
||||
$scope.delete = ->
|
||||
$scope.flashes.shift()
|
||||
|
||||
flash.subscribe(show)
|
||||
RailsFlashLoader.initFlash()
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
window.FieldsetMixin = ($scope)->
|
||||
$scope.next = (event)->
|
||||
event.preventDefault()
|
||||
$scope.next = (event = false)->
|
||||
event.preventDefault() if event
|
||||
$scope.show $scope.nextPanel
|
||||
|
||||
$scope.onTimeout = ->
|
||||
if $scope[$scope.name].$valid
|
||||
$scope.next()
|
||||
|
||||
$scope.valid = ->
|
||||
$scope.form().$valid
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Darkswarm.factory 'CheckoutFormState', ()->
|
||||
# Just a singleton place to store data about the form state
|
||||
new class CheckoutFormState
|
||||
@@ -2,6 +2,7 @@ Darkswarm.factory 'CurrentOrder', (currentOrder) ->
|
||||
new class CurrentOrder
|
||||
constructor: ->
|
||||
@[k] = v for k, v of currentOrder
|
||||
|
||||
@cart_count ?= 0
|
||||
|
||||
empty: =>
|
||||
@line_items.length == 0
|
||||
|
||||
12
app/assets/javascripts/darkswarm/services/map.js.coffee
Normal file
12
app/assets/javascripts/darkswarm/services/map.js.coffee
Normal file
@@ -0,0 +1,12 @@
|
||||
Darkswarm.factory "OfnMap", (enterprisesForMap, MapModal)->
|
||||
new class OfnMap
|
||||
constructor: ->
|
||||
@enterprises = (@extend(enterprise) for enterprise in enterprisesForMap)
|
||||
|
||||
# Adding methods to each enterprise
|
||||
extend: (enterprise)->
|
||||
new class MapMarker
|
||||
constructor: ->
|
||||
@[k] = v for k, v of enterprise
|
||||
reveal: =>
|
||||
MapModal.open @
|
||||
@@ -0,0 +1,5 @@
|
||||
Darkswarm.factory "MapConfiguration", ->
|
||||
new class MapConfiguration
|
||||
# From http://snazzymaps.com/style/15/subtle-grayscale
|
||||
options: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}]
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Darkswarm.factory "MapModal", ($modal, $rootScope)->
|
||||
new class MapModal
|
||||
open: (enterprise)->
|
||||
scope = $rootScope.$new(true) # Spawn an isolate to contain the enterprise
|
||||
scope.enterprise = enterprise
|
||||
$modal.open(templateUrl: "map_modal.html", scope: scope)
|
||||
@@ -1,17 +1,31 @@
|
||||
Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, Navigation)->
|
||||
Darkswarm.factory 'Order', ($resource, order, $http, Navigation, storage, CurrentHub, RailsFlashLoader)->
|
||||
new class Order
|
||||
errors: {}
|
||||
secrets: {}
|
||||
order: order
|
||||
ship_address_same_as_billing: true
|
||||
|
||||
constructor: ->
|
||||
@order = order
|
||||
#Whitelist of fields from Order.order to bind into localStorage
|
||||
fieldsToBind: ["bill_address", "email", "payment_method_id", "shipping_method_id", "ship_address"]
|
||||
|
||||
# Bind all the fields from fieldsToBind, + anything on the Order class
|
||||
bindFieldsToLocalStorage: (scope)=>
|
||||
prefix = "order_#{@order.id}#{@order.user_id}#{CurrentHub.id}"
|
||||
for field in @fieldsToBind
|
||||
storage.bind scope, "Order.order.#{field}",
|
||||
storeName: "#{prefix}_#{field}"
|
||||
|
||||
storage.bind scope, "Order.ship_address_same_as_billing",
|
||||
storeName: "#{prefix}_sameasbilling"
|
||||
defaultValue: true
|
||||
|
||||
submit: ->
|
||||
$http.put('/checkout', {order: @preprocess()}).success (data, status)=>
|
||||
Navigation.go data.path
|
||||
.error (response, status)=>
|
||||
@errors = response.errors
|
||||
flash.error = response.flash?.error
|
||||
flash.success = response.flash?.notice
|
||||
RailsFlashLoader.loadFlash(response.flash)
|
||||
|
||||
|
||||
# Rails wants our Spree::Address data to be provided with _attributes
|
||||
preprocess: ->
|
||||
@@ -24,12 +38,25 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, N
|
||||
munged_order["ship_address_attributes"] = value
|
||||
when "payment_method_id"
|
||||
munged_order["payments_attributes"] = [{payment_method_id: value}]
|
||||
|
||||
when "form_state" # don't keep this shit
|
||||
else
|
||||
munged_order[name] = value
|
||||
|
||||
if CheckoutFormState.ship_address_same_as_billing
|
||||
if @ship_address_same_as_billing
|
||||
munged_order.ship_address_attributes = munged_order.bill_address_attributes
|
||||
|
||||
if @paymentMethod()?.method_type == 'gateway'
|
||||
angular.extend munged_order.payments_attributes[0], {
|
||||
source_attributes:
|
||||
number: @secrets.card_number
|
||||
month: @secrets.card_month
|
||||
year: @secrets.card_year
|
||||
verification_value: @secrets.card_verification_value
|
||||
first_name: @order.bill_address.firstname
|
||||
last_name: @order.bill_address.lastname
|
||||
}
|
||||
|
||||
munged_order
|
||||
|
||||
shippingMethod: ->
|
||||
@@ -39,7 +66,7 @@ Darkswarm.factory 'Order', ($resource, order, $http, CheckoutFormState, flash, N
|
||||
@shippingMethod()?.require_ship_address
|
||||
|
||||
shippingPrice: ->
|
||||
@shippingMethod()?.price
|
||||
@shippingMethod()?.price || 0.0
|
||||
|
||||
paymentMethod: ->
|
||||
@order.payment_methods[@order.payment_method_id]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Darkswarm.factory 'RailsFlashLoader', (flash, railsFlash)->
|
||||
new class RailsFlashLoader
|
||||
initFlash: ->
|
||||
@loadFlash railsFlash
|
||||
loadFlash: (rails_flash)->
|
||||
for type, message of rails_flash
|
||||
flash[type] = message
|
||||
@@ -3,4 +3,5 @@
|
||||
%ng-include{src: "'login.html'"}
|
||||
%ng-include{src: "'signup.html'"}
|
||||
%ng-include{src: "'forgot.html'"}
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"} ×
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
2
app/assets/javascripts/templates/flash.html.haml
Normal file
2
app/assets/javascripts/templates/flash.html.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
%alert{close: "closeAlert($index)", "ng-repeat" => "flash in flashes", type: "flash.type"}
|
||||
{{ flash.message }}
|
||||
49
app/assets/javascripts/templates/map_modal.html.haml
Normal file
49
app/assets/javascripts/templates/map_modal.html.haml
Normal file
@@ -0,0 +1,49 @@
|
||||
.row
|
||||
.small-12.columns.producer-hero
|
||||
%h3.producer-name
|
||||
%i.ofn-i_036-producers
|
||||
{{ enterprise.name }}
|
||||
{{ enterprise.id }}
|
||||
%img.producer-hero-img{"ng-src" => "{{enterprise.promo_image}}"}
|
||||
|
||||
.row
|
||||
.small-12.large-6.columns
|
||||
%p{"ng-bind-html" => "enterprise.long_description"}
|
||||
.small-12.large-6.columns
|
||||
%img.producer-logo{"ng-src" => "{{enterprise.logo}}", "ng-if" => "enterprise.logo"}
|
||||
%h5 Stay in touch with {{ enterprise.name }}
|
||||
|
||||
%ul.small-block-grid-1{bindonce: true}
|
||||
|
||||
%li{"ng-if" => "enterprise.website"}
|
||||
%a{"ng-href" => "http://{{enterprise.website | stripUrl}}", target: "_blank" }
|
||||
%i.ofn-i_049-web
|
||||
{{ enterprise.website | stripUrl }}
|
||||
|
||||
%li{"ng-if" => "enterprise.email"}
|
||||
%a{"ng-href" => "mailto:{{enterprise.email | stripUrl}}", target: "_blank" }
|
||||
%i.ofn-i_050-mail-circle
|
||||
{{ enterprise.email | stripUrl }}
|
||||
|
||||
%li{"ng-if" => "enterprise.twitter"}
|
||||
%a{"ng-href" => "http://twitter.com/{{enterprise.twitter}}", target: "_blank"}
|
||||
%i.ofn-i_041-twitter
|
||||
{{ enterprise.twitter }}
|
||||
|
||||
%li{"ng-if" => "enterprise.facebook"}
|
||||
%a{"ng-href" => "http://{{enterprise.facebook | stripUrl}}", target: "_blank"}
|
||||
%i.ofn-i_044-facebook
|
||||
{{ enterprise.facebook | stripUrl }}
|
||||
|
||||
%li{"ng-if" => "enterprise.linkedin"}
|
||||
%a{"ng-href" => "http://{{enterprise.linkedin | stripUrl}}", target: "_blank"}
|
||||
%i.ofn-i_042-linkedin
|
||||
{{ enterprise.linkedin | stripUrl }}
|
||||
|
||||
%li{"ng-if" => "enterprise.instagram"}
|
||||
%a{"ng-href" => "http://instagram.com/{{enterprise.instagram}}", target: "_blank"}
|
||||
%i.ofn-i_043-instagram
|
||||
{{ enterprise.instagram }}
|
||||
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
@@ -1,6 +1,19 @@
|
||||
@import mixins
|
||||
|
||||
#active-table-search
|
||||
input
|
||||
font-size: 2em
|
||||
@include big-input
|
||||
position: relative
|
||||
|
||||
i.ofn-i_020-search
|
||||
position: absolute
|
||||
left: 26px
|
||||
top: 12px
|
||||
font-size: 1.6em
|
||||
z-index: 999
|
||||
color: #b2b2b2
|
||||
|
||||
input[type="text"]
|
||||
font-size: 2em
|
||||
@include csstrans
|
||||
@include big-input
|
||||
padding-left: 44px
|
||||
|
||||
@@ -20,6 +20,10 @@ checkout
|
||||
padding: 0.65em
|
||||
background: #f7f7f7
|
||||
|
||||
.label
|
||||
font-size: 1em
|
||||
padding: 0.3rem 0.35rem 0.275rem
|
||||
|
||||
// Logic to turn on & off the alerts for success against each fieldset
|
||||
|
||||
label, label.alert, label.success, &.valid label.alert, &.dirty label.success
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
//Open row
|
||||
&.open
|
||||
.fat-taxons
|
||||
margin-right: 0.5rem
|
||||
.active_table_row:first-child
|
||||
border-top: 1px solid $clr-brick
|
||||
border-left: 1px solid $clr-brick
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
.producer-hero-img
|
||||
background-color: #999
|
||||
width: 100%
|
||||
min-height: 160px
|
||||
height: inherit
|
||||
max-height: 260px
|
||||
overflow: hidden
|
||||
|
||||
7
app/assets/stylesheets/darkswarm/map.css.sass
Normal file
7
app/assets/stylesheets/darkswarm/map.css.sass
Normal file
@@ -0,0 +1,7 @@
|
||||
// Place all the styles related to the map controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
.ofn-map-container
|
||||
map, .angular-google-map-container, google-map, .angular-google-map
|
||||
display: block
|
||||
height: 100%
|
||||
@@ -1,11 +1,25 @@
|
||||
@import branding
|
||||
@import mixins
|
||||
|
||||
.top-bar
|
||||
|
||||
.fixed .top-bar
|
||||
@include box-shadow(0 2px 3px 0 rgba(0,0,0,0.25))
|
||||
|
||||
nav
|
||||
@include textpress
|
||||
|
||||
// Default overrides - big menu
|
||||
|
||||
.top-bar-section .has-dropdown > a
|
||||
padding-right: 15px !important
|
||||
|
||||
i.ofn-i_022-cog
|
||||
font-size: 24px
|
||||
line-height: 45px
|
||||
|
||||
.top-bar-section .has-dropdown > a:after
|
||||
display: none
|
||||
|
||||
.top-bar-section ul li > a
|
||||
font-size: 0.75rem
|
||||
height: 45px
|
||||
@@ -13,16 +27,40 @@ nav
|
||||
opacity: 0.8
|
||||
&:hover, &:focus, &:active
|
||||
opacity: 1
|
||||
|
||||
.nav-branded
|
||||
color: $clr-brick-light-bright
|
||||
span
|
||||
font-size: 13px
|
||||
.nav-primary
|
||||
@include avenir
|
||||
font-size: 0.875rem
|
||||
|
||||
nav.top-bar a.icon i
|
||||
font-size: 22px
|
||||
|
||||
// Mobile Menu
|
||||
|
||||
.off-canvas-wrap.move-right .tab-bar .menu-icon
|
||||
@include box-shadow(inset 0 0 6px 2px rgba(0,0,0,0.5))
|
||||
|
||||
.off-canvas-wrap .tab-bar .menu-icon
|
||||
@include csstrans
|
||||
@include box-shadow(none)
|
||||
|
||||
.off-canvas-wrap.move-right .tab-bar .menu-icon span
|
||||
-moz-box-shadow: 0 0px 0 1px #666, 0 7px 0 1px #666, 0 14px 0 1px #666
|
||||
-webkit-box-shadow: 0 0px 0 1px #666, 0 7px 0 1px #666, 0 14px 0 1px #666
|
||||
box-shadow: 0 0px 0 1px #666, 0 7px 0 1px #666, 0 14px 0 1px #666
|
||||
|
||||
.off-canvas-wrap.move-right ul.off-canvas-list
|
||||
font-size: 0.875rem
|
||||
|
||||
.off-canvas-wrap.move-right ul.off-canvas-list i
|
||||
font-size: 1.5rem
|
||||
margin-right: 0.25rem
|
||||
|
||||
|
||||
// Responsive
|
||||
|
||||
@media screen and (min-width: 1025px)
|
||||
body.off-canvas
|
||||
// padding required to placehold for fixed menu bar
|
||||
|
||||
@@ -12,9 +12,14 @@
|
||||
border: 1px solid #999
|
||||
font-size: 18px
|
||||
@extend .avenir
|
||||
box-shadow: 0
|
||||
padding: 0.75em 1em
|
||||
height: auto
|
||||
margin-bottom: 1em
|
||||
background: rgba(255,255,255,0.65)
|
||||
&:active, &:hover, &:focus
|
||||
background: rgba(255,255,255,1)
|
||||
border-color: #888
|
||||
|
||||
@mixin disabled
|
||||
color: $disabled-bright
|
||||
@@ -49,13 +54,12 @@
|
||||
// Assign content: "string"
|
||||
|
||||
@mixin icon-font
|
||||
font-family: "foundation-icons"
|
||||
font-family: "OFN"
|
||||
display: inline-block
|
||||
font-weight: normal
|
||||
font-style: normal
|
||||
font-variant: normal
|
||||
text-transform: none
|
||||
font-size: 80%
|
||||
|
||||
|
||||
// Background options \\
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
.producers
|
||||
@include fullwidthbg
|
||||
background-image: url("/assets/producers/producers-pg-bg.jpg")
|
||||
background-repeat: no-repeat
|
||||
background-repeat: no-repeat
|
||||
@@ -1,6 +1,11 @@
|
||||
@import mixins
|
||||
@import branding
|
||||
|
||||
#cart-detail
|
||||
.cart-item-delete
|
||||
a.delete
|
||||
font-size: 1.125em
|
||||
|
||||
#edit-cart
|
||||
button, .button
|
||||
margin: 0
|
||||
|
||||
190
app/assets/stylesheets/darkswarm/style.css
Executable file
190
app/assets/stylesheets/darkswarm/style.css
Executable file
@@ -0,0 +1,190 @@
|
||||
@font-face {
|
||||
font-family: 'OFN';
|
||||
src:url('/OFN.eot?-zgemuq');
|
||||
src:url('/OFN.eot?#iefix-zgemuq') format('embedded-opentype'),
|
||||
url('/OFN.woff?-zgemuq') format('woff'),
|
||||
url('/OFN.ttf?-zgemuq') format('truetype'),
|
||||
url('/OFN.svg?-zgemuq#OFN') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
[class^="ofn-"], [class*=" ofn-"] {
|
||||
font-family: 'OFN';
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.ofn-i_055-point-left:before {
|
||||
content: "\e600";
|
||||
}
|
||||
.ofn-i_054-point-right:before {
|
||||
content: "\e601";
|
||||
}
|
||||
.ofn-i_053-point-up:before {
|
||||
content: "\e602";
|
||||
}
|
||||
.ofn-i_052-point-down:before {
|
||||
content: "\e603";
|
||||
}
|
||||
.ofn-i_051-check-big:before {
|
||||
content: "\e604";
|
||||
}
|
||||
.ofn-i_050-mail-circle:before {
|
||||
content: "\e605";
|
||||
}
|
||||
.ofn-i_049-web:before {
|
||||
content: "\e606";
|
||||
}
|
||||
.ofn-i_048-play-video:before {
|
||||
content: "\e607";
|
||||
}
|
||||
.ofn-i_047-youtube:before {
|
||||
content: "\e608";
|
||||
}
|
||||
.ofn-i_046-g:before {
|
||||
content: "\e609";
|
||||
}
|
||||
.ofn-i_045-pintrest:before {
|
||||
content: "\e60a";
|
||||
}
|
||||
.ofn-i_044-facebook:before {
|
||||
content: "\e60b";
|
||||
}
|
||||
.ofn-i_043-instagram:before {
|
||||
content: "\e60c";
|
||||
}
|
||||
.ofn-i_042-linkedin:before {
|
||||
content: "\e60d";
|
||||
}
|
||||
.ofn-i_041-twitter:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
.ofn-i_040-hub:before {
|
||||
content: "\e60f";
|
||||
}
|
||||
.ofn-i_039-delivery:before {
|
||||
content: "\e610";
|
||||
}
|
||||
.ofn-i_038-takeaway:before {
|
||||
content: "\e611";
|
||||
}
|
||||
.ofn-i_037-map:before {
|
||||
content: "\e612";
|
||||
}
|
||||
.ofn-i_036-producers:before {
|
||||
content: "\e613";
|
||||
}
|
||||
.ofn-i_035-groups:before {
|
||||
content: "\e614";
|
||||
}
|
||||
.ofn-i_034-timer:before {
|
||||
content: "\e615";
|
||||
}
|
||||
.ofn-i_033-open-sign:before {
|
||||
content: "\e616";
|
||||
}
|
||||
.ofn-i_032-closed-sign:before {
|
||||
content: "\e617";
|
||||
}
|
||||
.ofn-i_031-alarm-clock:before {
|
||||
content: "\e618";
|
||||
}
|
||||
.ofn-i_030-money:before {
|
||||
content: "\e619";
|
||||
}
|
||||
.ofn-i_029-shopping-basket:before {
|
||||
content: "\e61a";
|
||||
}
|
||||
.ofn-i_028-barcode:before {
|
||||
content: "\e61b";
|
||||
}
|
||||
.ofn-i_027-shopping-cart:before {
|
||||
content: "\e61c";
|
||||
}
|
||||
.ofn-i_026-trash:before {
|
||||
content: "\e61d";
|
||||
}
|
||||
.ofn-i_025-notepad:before {
|
||||
content: "\e61e";
|
||||
}
|
||||
.ofn-i_024-mail:before {
|
||||
content: "\e61f";
|
||||
}
|
||||
.ofn-i_023-refresh:before {
|
||||
content: "\e620";
|
||||
}
|
||||
.ofn-i_022-cog:before {
|
||||
content: "\e621";
|
||||
}
|
||||
.ofn-i_021-tools:before {
|
||||
content: "\e622";
|
||||
}
|
||||
.ofn-i_020-search:before {
|
||||
content: "\e623";
|
||||
}
|
||||
.ofn-i_019-map-pin:before {
|
||||
content: "\e624";
|
||||
}
|
||||
.ofn-i_018-unlocked:before {
|
||||
content: "\e625";
|
||||
}
|
||||
.ofn-i_017-locked:before {
|
||||
content: "\e626";
|
||||
}
|
||||
.ofn-i_016-group:before {
|
||||
content: "\e627";
|
||||
}
|
||||
.ofn-i_015-user:before {
|
||||
content: "\e628";
|
||||
}
|
||||
.ofn-i_014-menu:before {
|
||||
content: "\e629";
|
||||
}
|
||||
.ofn-i_013-help:before {
|
||||
content: "\e62a";
|
||||
}
|
||||
.ofn-i_012-warning:before {
|
||||
content: "\e62b";
|
||||
}
|
||||
.ofn-i_011-spinner:before {
|
||||
content: "\e62c";
|
||||
}
|
||||
.ofn-i_010-bullet:before {
|
||||
content: "\e62d";
|
||||
}
|
||||
.ofn-i_009-close:before {
|
||||
content: "\e62e";
|
||||
}
|
||||
.ofn-i_008-caret-left:before {
|
||||
content: "\e62f";
|
||||
}
|
||||
.ofn-i_007-caret-right:before {
|
||||
content: "\e630";
|
||||
}
|
||||
.ofn-i_006-caret-up:before {
|
||||
content: "\e631";
|
||||
}
|
||||
.ofn-i_005-caret-down:before {
|
||||
content: "\e632";
|
||||
}
|
||||
.ofn-i_004-x:before {
|
||||
content: "\e633";
|
||||
}
|
||||
.ofn-i_003-check:before {
|
||||
content: "\e634";
|
||||
}
|
||||
.ofn-i_002-arrow-right:before {
|
||||
content: "\e635";
|
||||
}
|
||||
.ofn-i_001-arrow-left:before {
|
||||
content: "\e636";
|
||||
}
|
||||
@@ -33,9 +33,12 @@
|
||||
border-top: 4px solid transparent
|
||||
a:after
|
||||
padding-left: 8px
|
||||
content: "\f109"
|
||||
content: "\e632"
|
||||
visibility: hidden
|
||||
@include icon-font
|
||||
dd:hover
|
||||
a:after
|
||||
visibility: visible
|
||||
|
||||
// active nav link
|
||||
|
||||
@@ -45,7 +48,7 @@
|
||||
a
|
||||
color: $clr-brick-bright
|
||||
a:after
|
||||
content: "\f10c"
|
||||
content: "\e631"
|
||||
visibility: visible
|
||||
@include icon-font
|
||||
|
||||
|
||||
@@ -37,18 +37,20 @@ h1, h2, h3, h4, h5, h6, .avenir
|
||||
padding: 0px
|
||||
|
||||
ul.ofn-list
|
||||
margin-left: 0.5em
|
||||
margin: 0
|
||||
li
|
||||
list-style: none
|
||||
line-height: 1.5
|
||||
height: inherit
|
||||
li:before
|
||||
content: "\f112"
|
||||
font-family: "foundation-icons"
|
||||
content: "\e62d"
|
||||
font-family: "OFN"
|
||||
display: inline-block
|
||||
font-weight: normal
|
||||
font-style: normal
|
||||
font-variant: normal
|
||||
text-transform: none
|
||||
font-size: 80%
|
||||
|
||||
|
||||
.light-grey
|
||||
color: #666666
|
||||
@@ -70,7 +72,6 @@ table tr th, table tr td
|
||||
table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td
|
||||
color: #333333
|
||||
|
||||
|
||||
span.email
|
||||
direction: rtl
|
||||
unicode-bidi: bidi-override
|
||||
|
||||
@@ -37,7 +37,7 @@ class ApplicationController < ActionController::Base
|
||||
session[:expired_order_cycle_id] = current_order_cycle.id
|
||||
current_order.empty!
|
||||
current_order.set_order_cycle! nil
|
||||
flash[:notice] = "The order cycle you've selected has just closed. Please try again!"
|
||||
flash[:info] = "The order cycle you've selected has just closed. Please try again!"
|
||||
redirect_to root_url
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,7 +15,6 @@ class CheckoutController < Spree::CheckoutController
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
if @order.update_attributes(params[:order])
|
||||
fire_event('spree.checkout.update')
|
||||
while @order.state != "complete"
|
||||
@@ -26,7 +25,7 @@ class CheckoutController < Spree::CheckoutController
|
||||
if @order.next
|
||||
state_callback(:after)
|
||||
else
|
||||
unless @order.errors.empty?
|
||||
if @order.errors.present?
|
||||
flash[:error] = @order.errors.full_messages.to_sentence
|
||||
else
|
||||
flash[:error] = t(:payment_processing_failed)
|
||||
@@ -36,7 +35,7 @@ class CheckoutController < Spree::CheckoutController
|
||||
end
|
||||
end
|
||||
if @order.state == "complete" || @order.completed?
|
||||
flash.notice = t(:order_processed_successfully)
|
||||
flash[:success] = t(:order_processed_successfully)
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
respond_with(@order, :location => order_path(@order))
|
||||
|
||||
6
app/controllers/map_controller.rb
Normal file
6
app/controllers/map_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class MapController < BaseController
|
||||
layout 'darkswarm'
|
||||
def index
|
||||
@enterprises = Enterprise.visible
|
||||
end
|
||||
end
|
||||
@@ -356,19 +356,12 @@ Spree::Admin::ReportsController.class_eval do
|
||||
end
|
||||
params[:q][:meta_sort] ||= "completed_at.desc"
|
||||
|
||||
q = params[:q].dup
|
||||
if q[:order_cycle_id_eq] == '-1'
|
||||
q[:order_cycle_id_null] = true
|
||||
q[:order_cycle_id_eq] = nil
|
||||
end
|
||||
|
||||
# -- Search
|
||||
@search = Spree::Order.complete.not_state(:canceled).managed_by(spree_current_user).search(q)
|
||||
|
||||
@search = Spree::Order.complete.not_state(:canceled).managed_by(spree_current_user).search(params[:q])
|
||||
orders = @search.result
|
||||
@line_items = orders.map do |o|
|
||||
lis = o.line_items.managed_by(spree_current_user)
|
||||
lis = lis.supplied_by(params[:supplier_id]) if params[:supplier_id].present?
|
||||
lis = lis.supplied_by_any(params[:supplier_id_in]) if params[:supplier_id_in].present?
|
||||
lis
|
||||
end.flatten
|
||||
#payments = orders.map { |o| o.payments.select { |payment| payment.completed? } }.flatten # Only select completed payments
|
||||
@@ -393,7 +386,7 @@ Spree::Admin::ReportsController.class_eval do
|
||||
table_items = @line_items
|
||||
@include_blank = 'All'
|
||||
|
||||
header = ["Supplier", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"]
|
||||
header = ["Producer", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"]
|
||||
|
||||
columns = [ proc { |line_items| line_items.first.variant.product.supplier.name },
|
||||
proc { |line_items| line_items.first.variant.product.name },
|
||||
@@ -415,7 +408,7 @@ Spree::Admin::ReportsController.class_eval do
|
||||
table_items = @line_items
|
||||
@include_blank = 'All'
|
||||
|
||||
header = ["Supplier", "Product", "Variant", "To Distributor", "Amount", "Curr. Cost per Unit", "Total Cost", "Shipping Method"]
|
||||
header = ["Producer", "Product", "Variant", "To Hub", "Amount", "Curr. Cost per Unit", "Total Cost", "Shipping Method"]
|
||||
|
||||
columns = [ proc { |line_items| line_items.first.variant.product.supplier.name },
|
||||
proc { |line_items| line_items.first.variant.product.name },
|
||||
@@ -447,7 +440,7 @@ Spree::Admin::ReportsController.class_eval do
|
||||
table_items = @line_items
|
||||
@include_blank = 'All'
|
||||
|
||||
header = ["Distributor", "Supplier", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Total Shipping Cost", "Shipping Method"]
|
||||
header = ["Hub", "Producer", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Total Shipping Cost", "Shipping Method"]
|
||||
|
||||
columns = [ proc { |line_items| line_items.first.order.distributor.name },
|
||||
proc { |line_items| line_items.first.variant.product.supplier.name },
|
||||
@@ -481,12 +474,16 @@ Spree::Admin::ReportsController.class_eval do
|
||||
table_items = @line_items
|
||||
@include_blank = 'All'
|
||||
|
||||
header = ["Distributor", "Customer", "Email", "Phone", "Product", "Variant", "Amount", "Item ($)", "Ship ($)", "Total ($)", "Paid?", "Packed?", "Shipped?"]
|
||||
header = ["Hub", "Customer", "Email", "Phone", "Producer", "Product", "Variant", "Amount", "Item ($)", "Dist ($)", "Ship ($)", "Total ($)", "Paid?",
|
||||
"Shipping", "Delivery?", "Ship street", "Ship street 2", "Ship city", "Ship postcode", "Ship state"]
|
||||
|
||||
rsa = proc { |line_items| line_items.first.order.shipping_method.andand.require_ship_address }
|
||||
|
||||
columns = [ proc { |line_items| line_items.first.order.distributor.name },
|
||||
proc { |line_items| line_items.first.order.bill_address.firstname + " " + line_items.first.order.bill_address.lastname },
|
||||
proc { |line_items| line_items.first.order.email },
|
||||
proc { |line_items| line_items.first.order.bill_address.phone },
|
||||
proc { |line_items| line_items.first.variant.product.supplier.name },
|
||||
proc { |line_items| line_items.first.variant.product.name },
|
||||
proc { |line_items| line_items.first.variant.options_text },
|
||||
proc { |line_items| line_items.sum { |li| li.quantity } },
|
||||
@@ -495,13 +492,21 @@ Spree::Admin::ReportsController.class_eval do
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" } ]
|
||||
|
||||
proc { |line_items| line_items.first.order.shipping_method.andand.name },
|
||||
proc { |line_items| rsa.call(line_items) ? 'Y' : 'N' },
|
||||
proc { |line_items| line_items.first.order.ship_address.andand.address1 if rsa.call(line_items) },
|
||||
proc { |line_items| line_items.first.order.ship_address.andand.address2 if rsa.call(line_items) },
|
||||
proc { |line_items| line_items.first.order.ship_address.andand.city if rsa.call(line_items) },
|
||||
proc { |line_items| line_items.first.order.ship_address.andand.zipcode if rsa.call(line_items) },
|
||||
proc { |line_items| line_items.first.order.ship_address.andand.state if rsa.call(line_items) }]
|
||||
|
||||
rules = [ { group_by: proc { |line_item| line_item.order.distributor },
|
||||
sort_by: proc { |distributor| distributor.name } },
|
||||
{ group_by: proc { |line_item| line_item.order },
|
||||
sort_by: proc { |order| order.bill_address.lastname + " " + order.bill_address.firstname },
|
||||
summary_columns: [ proc { |line_items| "" },
|
||||
summary_columns: [ proc { |line_items| line_items.first.order.distributor.name },
|
||||
proc { |line_items| line_items.first.order.bill_address.firstname + " " + line_items.first.order.bill_address.lastname },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
@@ -509,11 +514,19 @@ Spree::Admin::ReportsController.class_eval do
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| line_items.sum { |li| li.quantity * li.price } },
|
||||
proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.distribution_total } },
|
||||
proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.ship_total } },
|
||||
proc { |line_items| line_items.map { |li| li.order }.uniq.sum { |o| o.total } },
|
||||
proc { |line_items| line_items.map { |li| li.order.paid? }.all? { |paid| paid == true } ? "Yes" : "No" },
|
||||
proc { |line_items| line_items.all? { |li| li.order.paid? } ? "Yes" : "No" },
|
||||
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" },
|
||||
proc { |line_items| "" } ] },
|
||||
|
||||
{ group_by: proc { |line_item| line_item.variant.product },
|
||||
sort_by: proc { |product| product.name } },
|
||||
{ group_by: proc { |line_item| line_item.variant },
|
||||
@@ -523,7 +536,7 @@ Spree::Admin::ReportsController.class_eval do
|
||||
table_items = @line_items
|
||||
@include_blank = 'All'
|
||||
|
||||
header = ["Supplier", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"]
|
||||
header = ["Producer", "Product", "Variant", "Amount", "Curr. Cost per Unit", "Total Cost", "Status", "Incoming Transport"]
|
||||
|
||||
columns = [ proc { |line_items| line_items.first.variant.product.supplier.name },
|
||||
proc { |line_items| line_items.first.variant.product.name },
|
||||
|
||||
@@ -5,7 +5,7 @@ class UserPasswordsController < Spree::UserPasswordsController
|
||||
self.resource = resource_class.send_reset_password_instructions(params[resource_name])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message(:notice, :send_instructions) if is_navigational_format?
|
||||
set_flash_message(:success, :send_instructions) if is_navigational_format?
|
||||
respond_with resource, :location => spree.login_path
|
||||
else
|
||||
respond_to do |format|
|
||||
|
||||
@@ -4,7 +4,7 @@ class UserRegistrationsController < Spree::UserRegistrationsController
|
||||
def create
|
||||
@user = build_resource(params[:spree_user])
|
||||
if resource.save
|
||||
set_flash_message(:notice, :signed_up)
|
||||
set_flash_message(:success, :signed_up)
|
||||
sign_in(:spree_user, @user)
|
||||
session[:spree_user_signup] = true
|
||||
associate_user
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
module CheckoutHelper
|
||||
def checkout_adjustments_for_summary(order)
|
||||
def checkout_adjustments_for_summary(order, opts={})
|
||||
adjustments = order.adjustments.eligible
|
||||
|
||||
# Remove empty tax adjustments and (optionally) shipping fees
|
||||
adjustments.reject! { |a| a.originator_type == 'Spree::TaxRate' && a.amount == 0 }
|
||||
adjustments.reject! { |a| a.originator_type == 'Spree::ShippingMethod' } if opts[:exclude_shipping]
|
||||
|
||||
enterprise_fee_adjustments = adjustments.select { |a| a.originator_type == 'EnterpriseFee' }
|
||||
adjustments.reject! { |a| a.originator_type == 'EnterpriseFee' }
|
||||
|
||||
2
app/helpers/map_helper.rb
Normal file
2
app/helpers/map_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module MapHelper
|
||||
end
|
||||
@@ -1,7 +1,7 @@
|
||||
module SharedHelper
|
||||
|
||||
def inject_json(name, partial)
|
||||
render "json/injection", name: name, partial: partial
|
||||
def inject_json(name, partial, opts = {})
|
||||
render "json/injection", {name: name, partial: partial}.merge(opts)
|
||||
end
|
||||
|
||||
def distributor_link_class(distributor)
|
||||
|
||||
11
app/helpers/spree/reports_helper.rb
Normal file
11
app/helpers/spree/reports_helper.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module Spree
|
||||
module ReportsHelper
|
||||
def report_order_cycle_options(order_cycles)
|
||||
order_cycles.map do |oc|
|
||||
orders_open_at = oc.orders_open_at.andand.to_s(:short) || 'NA'
|
||||
orders_close_at = oc.orders_close_at.andand.to_s(:short) || 'NA'
|
||||
[ "#{oc.name} (#{orders_open_at} - #{orders_close_at})".html_safe, oc.id ]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -149,6 +149,16 @@ class Enterprise < ActiveRecord::Base
|
||||
self.relatives.is_distributor
|
||||
end
|
||||
|
||||
def website
|
||||
strip_url read_attribute(:website)
|
||||
end
|
||||
def facebook
|
||||
strip_url read_attribute(:facebook)
|
||||
end
|
||||
def linkedin
|
||||
strip_url read_attribute(:linkedin)
|
||||
end
|
||||
|
||||
def suppliers
|
||||
self.relatives.is_primary_producer
|
||||
end
|
||||
@@ -180,6 +190,10 @@ class Enterprise < ActiveRecord::Base
|
||||
|
||||
private
|
||||
|
||||
def strip_url(url)
|
||||
url.andand.sub /(https?:\/\/)?(www\.)?/, ''
|
||||
end
|
||||
|
||||
def initialize_country
|
||||
self.address ||= Spree::Address.new
|
||||
self.address.country = Spree::Country.find_by_id(Spree::Config[:default_country_id]) if self.address.new_record?
|
||||
|
||||
@@ -18,4 +18,8 @@ Spree::LineItem.class_eval do
|
||||
joins(:product).
|
||||
where('spree_products.supplier_id = ?', enterprise)
|
||||
}
|
||||
scope :supplied_by_any, lambda { |enterprises|
|
||||
joins(:product).
|
||||
where('spree_products.supplier_id IN (?)', enterprises)
|
||||
}
|
||||
end
|
||||
|
||||
@@ -75,6 +75,13 @@ Spree::Order.class_eval do
|
||||
errors.add(:distributor_id, "cannot supply the products in your cart") unless DistributionChangeValidator.new(self).can_change_to_distributor?(distributor)
|
||||
end
|
||||
end
|
||||
|
||||
def empty_with_clear_shipping_and_payments!
|
||||
empty_without_clear_shipping_and_payments!
|
||||
payments.clear
|
||||
update_attributes(shipping_method_id: nil)
|
||||
end
|
||||
alias_method_chain :empty!, :clear_shipping_and_payments
|
||||
|
||||
def set_order_cycle!(order_cycle)
|
||||
unless self.order_cycle == order_cycle
|
||||
@@ -127,7 +134,11 @@ Spree::Order.class_eval do
|
||||
end
|
||||
|
||||
def line_item_variants
|
||||
line_items.map { |li| li.variant }
|
||||
line_items.map(&:variant)
|
||||
end
|
||||
|
||||
def distribution_total
|
||||
adjustments.eligible.where(originator_type: 'EnterpriseFee').sum(&:amount)
|
||||
end
|
||||
|
||||
# Show payment methods for this distributor
|
||||
@@ -140,6 +151,8 @@ Spree::Order.class_eval do
|
||||
def available_shipping_methods(display_on = nil)
|
||||
Spree::ShippingMethod.all_available(self, display_on)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def shipping_address_from_distributor
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
%h5{"ng-class" => "{valid: billing.$valid, dirty: billing.$dirty}"}
|
||||
%span.right
|
||||
%label.label.round.alert
|
||||
%i.fi-x
|
||||
%label.label.round.success
|
||||
%i.fi-check
|
||||
%label.label.round.alert.right
|
||||
%i.ofn-i_009-close
|
||||
%label.label.round.success.right
|
||||
%i.ofn-i_051-check-big
|
||||
Billing info
|
||||
|
||||
%accordion-group{"is-open" => "accordion.billing",
|
||||
@@ -19,9 +19,9 @@
|
||||
{{ summary() | printArray }}
|
||||
.small-1.columns.right
|
||||
%span.accordion-up.right
|
||||
%i.fi-arrow-up
|
||||
%i.ofn-i_006-caret-up
|
||||
%span.accordion-down.right
|
||||
%i.fi-arrow-down
|
||||
%i.ofn-i_005-caret-down
|
||||
|
||||
= f.fields_for :bill_address, @order.bill_address do |ba|
|
||||
.row
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
%h5{"ng-class" => "{valid: details.$valid, dirty: details.$dirty}"}
|
||||
%span.right
|
||||
%label.label.round.alert
|
||||
%i.fi-x
|
||||
%label.label.round.success
|
||||
%i.fi-check
|
||||
%label.label.round.alert.right
|
||||
%i.ofn-i_009-close
|
||||
%label.label.round.success.right
|
||||
%i.ofn-i_051-check-big
|
||||
Your details
|
||||
|
||||
%accordion-group{"is-open" => "accordion.details",
|
||||
@@ -19,9 +19,9 @@
|
||||
{{ summary() | printArray }}
|
||||
.small-1.columns.right
|
||||
%span.accordion-up.right
|
||||
%i.fi-arrow-up
|
||||
%i.ofn-i_006-caret-up
|
||||
%span.accordion-down.right
|
||||
%i.fi-arrow-down
|
||||
%i.ofn-i_005-caret-down
|
||||
|
||||
.row
|
||||
.small-6.columns
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
-#%pre
|
||||
-#{{ Order.order}}
|
||||
|
||||
.small-12.columns
|
||||
%div
|
||||
%h3.text-center.pad-top
|
||||
Checkout from
|
||||
= current_distributor.name
|
||||
@@ -20,7 +20,8 @@
|
||||
= render partial: "checkout/shipping", locals: {f: f}
|
||||
= render partial: "checkout/payment", locals: {f: f}
|
||||
%p
|
||||
%input.button.primary{type: :submit,
|
||||
value: "Place order now",
|
||||
"ng-click" => "purchase($event)",
|
||||
"ng-show" => "checkout.$valid"}
|
||||
%button.button.primary{type: :submit,
|
||||
"ng-click" => "purchase($event)",
|
||||
"ng-disabled" => "checkout.$invalid"}
|
||||
Place order now
|
||||
/ {{ checkout.$valid }}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#NOTE: when adding new fields for user input, it may want to be cached in localStorage
|
||||
# If so, make sure to add it to Order.attributes_to_cache
|
||||
|
||||
object current_order
|
||||
attributes :id, :email, :shipping_method_id, :user_id
|
||||
|
||||
@@ -18,7 +21,7 @@ child current_order.ship_address => :ship_address do
|
||||
end
|
||||
|
||||
node :shipping_methods do
|
||||
Hash[current_order.available_shipping_methods("front_end").collect { |method|
|
||||
Hash[current_distributor.shipping_methods.uniq.collect { |method|
|
||||
[method.id, {
|
||||
require_ship_address: method.require_ship_address,
|
||||
price: method.compute_amount(current_order).to_f,
|
||||
@@ -30,7 +33,8 @@ end
|
||||
node :payment_methods do
|
||||
Hash[current_order.available_payment_methods.collect {
|
||||
|method| [method.id, {
|
||||
name: method.name
|
||||
name: method.name,
|
||||
method_type: method.method_type
|
||||
}]
|
||||
}]
|
||||
end
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
%h5{"ng-class" => "{valid: payment.$valid, dirty: payment.$dirty}"}
|
||||
%span.right
|
||||
%label.label.round.alert
|
||||
%i.fi-x
|
||||
%label.label.round.success
|
||||
%i.fi-check
|
||||
%label.label.round.alert.right
|
||||
%i.ofn-i_009-close
|
||||
%label.label.round.success.right
|
||||
%i.ofn-i_051-check-big
|
||||
Payment
|
||||
|
||||
%accordion-group{"is-open" => "accordion.payment",
|
||||
@@ -19,9 +19,9 @@
|
||||
{{ Order.paymentMethod().name }}
|
||||
.small-1.columns.right
|
||||
%span.accordion-up.right
|
||||
%i.fi-arrow-up
|
||||
%i.ofn-i_006-caret-up
|
||||
%span.accordion-down.right
|
||||
%i.fi-arrow-down
|
||||
%i.ofn-i_005-caret-down
|
||||
|
||||
- current_order.available_payment_methods.each do |method|
|
||||
.row
|
||||
@@ -31,7 +31,7 @@
|
||||
required: true,
|
||||
"ng-model" => "order.payment_method_id"
|
||||
= method.name
|
||||
.row{"ng-show" => "order.payment_method_id == #{method.id}"}
|
||||
.row{"ng-if" => "order.payment_method_id == #{method.id}"}
|
||||
.small-12.columns
|
||||
= render partial: "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method }
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
%h5{"ng-class" => "{valid: shipping.$valid, dirty: shipping.$dirty}"}
|
||||
%span.right
|
||||
%label.label.round.alert
|
||||
%i.fi-x
|
||||
%label.label.round.success
|
||||
%i.fi-check
|
||||
%label.label.round.alert.right
|
||||
%i.ofn-i_009-close
|
||||
%label.label.round.success.right
|
||||
%i.ofn-i_051-check-big
|
||||
Shipping info
|
||||
|
||||
%accordion-group{"is-open" => "accordion.shipping",
|
||||
@@ -19,9 +19,9 @@
|
||||
{{ Order.shippingMethod().name }}
|
||||
.small-1.columns.right
|
||||
%span.accordion-up.right
|
||||
%i.fi-arrow-up
|
||||
%i.ofn-i_006-caret-up
|
||||
%span.accordion-down.right
|
||||
%i.fi-arrow-down
|
||||
%i.ofn-i_005-caret-down
|
||||
|
||||
- for ship_method, i in current_distributor.shipping_methods.uniq
|
||||
.row
|
||||
@@ -42,10 +42,10 @@
|
||||
= f.fields_for :ship_address, @order.ship_address do |sa|
|
||||
#ship_address{"ng-if" => "Order.requireShipAddress()"}
|
||||
%label
|
||||
%input{type: :checkbox, "ng-model" => "CheckoutFormState.ship_address_same_as_billing"}
|
||||
%input{type: :checkbox, "ng-model" => "Order.ship_address_same_as_billing"}
|
||||
Shipping address same as billing address?
|
||||
|
||||
%div.visible{"ng-if" => "!CheckoutFormState.ship_address_same_as_billing"}
|
||||
%div.visible{"ng-if" => "!Order.ship_address_same_as_billing"}
|
||||
.row
|
||||
.small-12.columns
|
||||
= validated_input "Address", "order.ship_address.address1", "ofn-focus" => "accordion['shipping']"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
%th Produce
|
||||
%td= current_order.display_item_total
|
||||
|
||||
- checkout_adjustments_for_summary(current_order).each do |adjustment|
|
||||
- checkout_adjustments_for_summary(current_order, exclude_shipping: true).each do |adjustment|
|
||||
%tr
|
||||
%th= adjustment.label
|
||||
%td= adjustment.display_amount.to_html
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
//= f.submit "Purchase", class: "button", "ng-disabled" => "checkout.$invalid", "ofn-focus" => "accordion['payment']"
|
||||
%a.button.secondary{href: cart_url}
|
||||
%i.fi-arrow-left
|
||||
%i.ofn-i_008-caret-left
|
||||
Back to Cart
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
= render partial: "shopping_shared/details"
|
||||
|
||||
%accordion.row{"close-others" => "true"}
|
||||
%checkout{"ng-controller" => "CheckoutCtrl"}
|
||||
%accordion{"close-others" => "true"}
|
||||
%checkout.row{"ng-controller" => "CheckoutCtrl"}
|
||||
.small-9.columns
|
||||
- unless spree_current_user
|
||||
= render partial: "checkout/authentication"
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
.group-hero
|
||||
%img.group-hero-img{"bo-src" => "group.promo_image"}
|
||||
%img.group-logo{"bo-src" => "group.logo", "bo-if" => "group.logo"}
|
||||
%h3.group-name {{ group.name }}
|
||||
%h3.group-name
|
||||
%i.ofn-i_035-groups
|
||||
{{ group.name }}
|
||||
%h5.group-description {{ group.description }}
|
||||
|
||||
.row.pad-top{bindonce: true}
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
.row.active_table_row{"ng-show" => "open()"}
|
||||
.columns.small-4
|
||||
%strong Shop for
|
||||
%h5
|
||||
%i.ofn-i_029-shopping-basket
|
||||
Shop for
|
||||
%p.trans-sentence
|
||||
%img{"ng-repeat" => "taxon in hub.taxons", "bo-src" => "taxon.icon",
|
||||
name: "{{taxon.name}}", alt: "{{taxon.name}}"}
|
||||
%span.fat-taxons{"ng-repeat" => "taxon in hub.taxons"}
|
||||
%img{"bo-src" => "taxon.icon",
|
||||
name: "{{taxon.name}}", alt: "{{taxon.name}}"}
|
||||
{{taxon.name}}
|
||||
.columns.small-4
|
||||
%strong Delivery options
|
||||
%h5 Delivery options
|
||||
%ol
|
||||
%li.pickup{"bo-if" => "hub.pickup"} Pickup
|
||||
%li.delivery{"bo-if" => "hub.delivery"} Delivery
|
||||
%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
|
||||
%strong Our producers
|
||||
%ul
|
||||
%h5
|
||||
%i.ofn-i_036-producers
|
||||
Our producers
|
||||
%ul.ofn-list
|
||||
%li{"ng-repeat" => "producer in hub.producers"}
|
||||
= render partial: "modals/producer"
|
||||
|
||||
@@ -22,4 +32,4 @@
|
||||
|
||||
.columns.small-1.text-right
|
||||
%a{"bo-href" => "hub.path"}
|
||||
%i.fi-arrow-right
|
||||
%i.ofn-i_007-caret-right
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
%h5 See all the groups & regions on the Open Food Network
|
||||
%p
|
||||
%a.neutral-btn.light{href: "/groups"}
|
||||
%i.fi-torsos-all
|
||||
%i.ofn-i_035-groups
|
||||
View groups & regions
|
||||
@@ -10,10 +10,10 @@
|
||||
%ofn-modal{title: "food hub"}
|
||||
= render partial: "modals/food_hub"
|
||||
from the list below:
|
||||
%p
|
||||
|
||||
#active-table-search.row
|
||||
#active-table-search.row.pad-top
|
||||
.small-12.columns
|
||||
%i.ofn-i_020-search
|
||||
%input{type: :text,
|
||||
"ng-model" => "query",
|
||||
placeholder: "Search postcode, suburb or hub name...",
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
%h5 of all our food hubs and producers
|
||||
%p
|
||||
%button.neutral-btn.light
|
||||
%i.fi-map
|
||||
%i.ofn-i_037-map
|
||||
View map
|
||||
@@ -6,5 +6,5 @@
|
||||
%h5 Looking for a specific producer or farmer?
|
||||
%p
|
||||
%a.neutral-btn.turquoise{href: "/producers"}
|
||||
%i.fi-trees
|
||||
%i.ofn-i_036-producers
|
||||
View all producers
|
||||
@@ -1,13 +1,18 @@
|
||||
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"}
|
||||
.columns.small-4
|
||||
%i.ofn-i_040-hub
|
||||
%strong {{ hub.name }}
|
||||
.columns.small-3
|
||||
{{ hub.address.city }}
|
||||
.columns.small-1
|
||||
{{ hub.address.state | uppercase }}
|
||||
|
||||
.columns.small-3{"bo-if" => "hub.active"}
|
||||
{{ hub.orders_close_at | sensible_timeframe }}
|
||||
|
||||
.columns.small-3{"bo-if" => "!hub.active"}
|
||||
%i.ofn-i_032-closed-sign
|
||||
Orders closed
|
||||
|
||||
.columns.small-1.text-right
|
||||
%i{"ng-class" => "{'fi-arrow-down' : !open(), 'fi-arrow-up' : open()}"}
|
||||
%i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"}
|
||||
|
||||
20
app/views/json/_enterprises_for_map.rabl
Normal file
20
app/views/json/_enterprises_for_map.rabl
Normal file
@@ -0,0 +1,20 @@
|
||||
collection @enterprises
|
||||
extends 'json/enterprises'
|
||||
attributes :latitude, :longitude, :long_description, :website, :instagram, :linkedin, :twitter, :facebook
|
||||
|
||||
node :logo do |enterprise|
|
||||
enterprise.logo(:medium) if enterprise.logo.exists?
|
||||
end
|
||||
node :promo_image do |enterprise|
|
||||
enterprise.promo_image(:large) if enterprise.promo_image.exists?
|
||||
end
|
||||
|
||||
node :icon do |e|
|
||||
if e.is_primary_producer? and e.is_distributor?
|
||||
image_path "map-icon-both.svg"
|
||||
elsif e.is_primary_producer?
|
||||
image_path "map-icon-producer.svg"
|
||||
else
|
||||
image_path "map-icon-hub.svg"
|
||||
end
|
||||
end
|
||||
2
app/views/json/_flash.rabl
Normal file
2
app/views/json/_flash.rabl
Normal file
@@ -0,0 +1,2 @@
|
||||
object OpenStruct.new(flash)
|
||||
attributes :info, :success, :error
|
||||
@@ -1,4 +1,4 @@
|
||||
attributes :name, :id, :description, :long_description
|
||||
attributes :id, :name, :description, :long_description, :website, :instagram, :facebook, :linkedin, :twitter
|
||||
|
||||
node :promo_image do |producer|
|
||||
producer.promo_image.url
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
= text_area_tag :email_body, "", :input_html => { :rows => 10 }
|
||||
= submit_tag "Submit", class: "button"
|
||||
|
||||
= link_to "×".html_safe, "#", class: "close-reveal-modal"
|
||||
= link_to "×".html_safe, "#", class: "close-reveal-modal"
|
||||
@@ -8,9 +8,12 @@
|
||||
= favicon_link_tag "favicon.png"
|
||||
%link{href: "http://fonts.googleapis.com/css?family=Open+Sans:400,700", rel: "stylesheet", type: "text/css"}/
|
||||
|
||||
= yield :scripts
|
||||
%script{src: "//maps.googleapis.com/maps/api/js?sensor=false"}
|
||||
= stylesheet_link_tag "darkswarm/all"
|
||||
= javascript_include_tag "darkswarm/all"
|
||||
|
||||
|
||||
= render "layouts/bugherd_script"
|
||||
= csrf_meta_tags
|
||||
|
||||
@@ -18,16 +21,15 @@
|
||||
= inject_json "currentHub", "current_hub"
|
||||
= inject_json "currentOrder", "current_order"
|
||||
= inject_json "user", "current_user"
|
||||
= inject_json "railsFlash", "flash"
|
||||
|
||||
.off-canvas-wrap{offcanvas: true}
|
||||
.inner-wrap
|
||||
= render partial: "shared/menu/menu"
|
||||
|
||||
= display_flash_messages
|
||||
%ofn-flash
|
||||
|
||||
%section{ role: "main" }
|
||||
= yield
|
||||
|
||||
#footer
|
||||
= yield :scripts
|
||||
|
||||
9
app/views/map/index.html.haml
Normal file
9
app/views/map/index.html.haml
Normal file
@@ -0,0 +1,9 @@
|
||||
= inject_json "enterprisesForMap" , "enterprises_for_map", collection: @enterprises
|
||||
|
||||
.ofn-map-container{"fill-vertical" => true}
|
||||
%map{"ng-controller" => "MapCtrl"}
|
||||
%google-map{center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"}
|
||||
%markers{models: "OfnMap.enterprises", fit: "true",
|
||||
coords: "'self'", icon: "'icon'", click: "'reveal'"}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
%h2 Food Hubs
|
||||
%h2
|
||||
%i.ofn-i_040-hub>
|
||||
Food Hubs
|
||||
%h5 Our food hubs are the point of contact between you and the people who make your food!
|
||||
%p You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logistics - so variations between hubs are to be expected.
|
||||
%p You can only shop at one food hub at a time.
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"} ×
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
%h2 Groups / Regions
|
||||
%h2
|
||||
%i.ofn-i_035-groups
|
||||
Groups / Regions
|
||||
%p These are the organisations and relationships between hubs which make up the Open Food Network.
|
||||
%p Some groups are clustered by location or council, others by non-geographic similarities.
|
||||
%a.close-reveal-modal{"ng-click" => "cancel()"} ×
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
@@ -6,4 +6,5 @@
|
||||
%h5 Learn more
|
||||
%p If you want to learn more about the Open Food Network, how it works, and get involved, check out:
|
||||
%a.button.neutral-btn.dark{:href => "http://www.openfoodnetwork.org" , :target => "_blank" } Open Food Network
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"} ×
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
|
||||
@@ -1,39 +1,49 @@
|
||||
%ofn-modal{title: "{{producer.name}}"}
|
||||
.row
|
||||
.columns.small-12.producer-hero
|
||||
.small-12.columns.producer-hero
|
||||
%h3.producer-name
|
||||
%i.ofn-i_036-producers
|
||||
{{ producer.name }}
|
||||
%img.producer-hero-img{"ng-src" => "{{producer.promo_image}}"}
|
||||
/ Will - scale large images down to 1200px wide, crop in to img aspect ratio 60W:13H
|
||||
%h3.producer-name {{ producer.name }}
|
||||
|
||||
.row
|
||||
.columns.small-12.large-6{"ng-bind-html" => "producer.long_description"}
|
||||
.columns.small-12.large-6
|
||||
.small-12.large-6.columns
|
||||
%p{"ng-bind-html" => "producer.long_description"}
|
||||
.small-12.large-6.columns
|
||||
%img.producer-logo{"ng-src" => "{{producer.logo}}", "ng-if" => "producer.logo"}
|
||||
%h4 Stay in touch with {{ producer.name }}
|
||||
%h5 Stay in touch with {{ producer.name }}
|
||||
|
||||
%ul.small-block-grid-1{bindonce: true}
|
||||
|
||||
%li{"ng-if" => "producer.website"}
|
||||
%a{"ng-href" => "http://{{producer.website | stripUrl}}", target: "_blank" }
|
||||
%i.fi-web
|
||||
%i.ofn-i_049-web
|
||||
{{ producer.website | stripUrl }}
|
||||
|
||||
|
||||
%li{"ng-if" => "producer.email"}
|
||||
%a{"ng-href" => "mailto:{{producer.email | stripUrl}}", target: "_blank" }
|
||||
%i.ofn-i_050-mail-circle
|
||||
{{ producer.email | stripUrl }}
|
||||
|
||||
%li{"ng-if" => "producer.twitter"}
|
||||
%a{"ng-href" => "http://twitter.com/{{producer.twitter}}", target: "_blank"}
|
||||
%i.fi-social-twitter
|
||||
%i.ofn-i_041-twitter
|
||||
{{ producer.twitter }}
|
||||
|
||||
|
||||
%li{"ng-if" => "producer.facebook"}
|
||||
%a{"ng-href" => "http://{{producer.facebook | stripUrl}}", target: "_blank"}
|
||||
%i.fi-social-facebook
|
||||
%i.ofn-i_044-facebook
|
||||
{{ producer.facebook | stripUrl }}
|
||||
|
||||
|
||||
%li{"ng-if" => "producer.linkedin"}
|
||||
%a{"ng-href" => "http://{{producer.linkedin | stripUrl}}", target: "_blank"}
|
||||
%i.fi-social-linkedin
|
||||
%i.ofn-i_042-linkedin
|
||||
{{ producer.linkedin | stripUrl }}
|
||||
|
||||
|
||||
%li{"ng-if" => "producer.instagram"}
|
||||
%a{"ng-href" => "http://instagram.com/{{producer.instagram}}", target: "_blank"}
|
||||
%i.fi-social-instagram
|
||||
%i.ofn-i_043-instagram
|
||||
{{ producer.instagram }}
|
||||
|
||||
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"} ×
|
||||
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
%h2 Producers
|
||||
%h5 Our producers make the food! All the delicious!
|
||||
%p More text goes here.
|
||||
%a.close-reveal-modal{"ng-click" => "cancel()"} ×
|
||||
%h2
|
||||
%i.ofn-i_036-producers
|
||||
Producers
|
||||
%p Our producers make all the delicious food you can shop for on the Open Food Network.
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
@@ -7,4 +7,5 @@
|
||||
%img{"ng-src" => "{{product.primary_taxon.icon}}"}
|
||||
{{product.name}}
|
||||
%p {{product.description}}
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"} ×
|
||||
%a.close-reveal-modal{"ng-click" => "$close()"}
|
||||
%i.ofn-i_009-close
|
||||
|
||||
@@ -15,4 +15,4 @@
|
||||
|
||||
.columns.small-1.text-right
|
||||
%a{"bo-href" => "hub.path"}
|
||||
%i.fi-arrow-right
|
||||
%i.ofn-i_007-caret-right
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"}
|
||||
.columns.small-4
|
||||
%i.ofn-i_036-producers
|
||||
%strong {{ producer.name }}
|
||||
.columns.small-3
|
||||
{{ producer.address.city }}
|
||||
.columns.small-4
|
||||
{{ producer.address.state | uppercase }}
|
||||
.columns.small-1.text-right
|
||||
%i{"ng-class" => "{'fi-arrow-down' : !open(), 'fi-arrow-up' : open()}"}
|
||||
%i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"}
|
||||
@@ -4,17 +4,18 @@
|
||||
-#%pre
|
||||
-#{{ Producers.producers | json }}
|
||||
|
||||
#active-table-search.row
|
||||
.small-12.columns.text-center
|
||||
%p
|
||||
.row
|
||||
.small-12.columns.text-center.pad-top
|
||||
%h1 Producers
|
||||
%div
|
||||
Select a
|
||||
%ofn-modal{title: "producer"}
|
||||
= render partial: "modals/producers"
|
||||
from the list below:
|
||||
%p
|
||||
|
||||
#active-table-search.row.pad-top
|
||||
.small-12.columns
|
||||
%i.ofn-i_020-search
|
||||
%input{type: :text,
|
||||
"ng-model" => "query",
|
||||
placeholder: "Search postcode, suburb or hub name...",
|
||||
|
||||
@@ -9,25 +9,25 @@
|
||||
%h4 Follow us
|
||||
%p
|
||||
%a{title:'Follow us on Facebook', href: 'https://www.facebook.com/OpenFoodNet', target: '_blank'}
|
||||
%i.fi-social-facebook
|
||||
%i.ofn-i_044-facebook
|
||||
Facebook
|
||||
%a{title:'Follow us on Twitter', href: 'https://twitter.com/OpenFoodNet', target: '_blank'}
|
||||
%i.fi-social-twitter
|
||||
%i.ofn-i_041-twitter
|
||||
Twitter
|
||||
%a{title:'Join our group on LinkedIn', href: 'http://www.linkedin.com/groups/Open-Food-Foundation-4743336', target: '_blank'}
|
||||
%i.fi-social-linkedin
|
||||
%i.ofn-i_042-linkedin
|
||||
LinkedIn
|
||||
.small-12.medium-4.columns.text-left
|
||||
%h4 Getting around
|
||||
%ul.ofn-list
|
||||
%li
|
||||
%a{href: ""} Shop
|
||||
%a{href: "/shop"} Shop
|
||||
%li
|
||||
%a{href: ""} Map
|
||||
%a{href: "/map"} Map
|
||||
%li
|
||||
%a{href: ""} Producers
|
||||
%a{href: "/producers"} Producers
|
||||
%li
|
||||
%a{href: ""} Groups
|
||||
%a{href: "/groups"} Groups
|
||||
.small-12.medium-4.columns.text-left
|
||||
%h4 About us
|
||||
%p OFN is a network of independent online food stores that connect farmers and food hubs with individuals and local businesses. It gives farmers and food hubs an easier and fairer way to distribute their food.
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
%li#login-name
|
||||
%a{"ng-click" => "toggle('/account')"}
|
||||
= spree_current_user.email
|
||||
%li.divider
|
||||
%li#sign-out-link
|
||||
= link_to "Sign Out", "/logout"
|
||||
/ %li#login-name
|
||||
/ %a{"ng-click" => "toggle('/account')"}
|
||||
/ = spree_current_user.email
|
||||
/ %li#sign-out-link
|
||||
/ %a{title: 'Log Out', href:'/logout' }
|
||||
/ %i.ofn-i_018-unlocked
|
||||
/ LOG OUT
|
||||
/ = link_to "Sign Out", "/logout"
|
||||
/ %li.divider
|
||||
%li.has-dropdown.not-click
|
||||
%a{href: "#"}
|
||||
%i.ofn-i_022-cog
|
||||
%ul.dropdown
|
||||
%li
|
||||
%a{href: spree.account_path}
|
||||
%i.ofn-i_015-user
|
||||
= spree_current_user.email
|
||||
%li
|
||||
%a{title: 'Log Out', href:'/logout' }
|
||||
%i.ofn-i_018-unlocked
|
||||
LOG OUT
|
||||
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_path}
|
||||
%i.ofn-i_021-tools
|
||||
Admin
|
||||
14
app/views/shared/_signed_in_offcanvas.html.haml
Normal file
14
app/views/shared/_signed_in_offcanvas.html.haml
Normal file
@@ -0,0 +1,14 @@
|
||||
%li
|
||||
%a{href: spree.account_path}
|
||||
%i.ofn-i_015-user
|
||||
= spree_current_user.email
|
||||
%li
|
||||
%a{title: 'Log Out', href:'/logout' }
|
||||
%i.ofn-i_018-unlocked
|
||||
LOG OUT
|
||||
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_path}
|
||||
%i.ofn-i_021-tools
|
||||
Admin
|
||||
@@ -1,5 +1,5 @@
|
||||
%li#login-link{"ng-controller" => "AuthenticationCtrl"}
|
||||
%a{"ng-click" => "open()"}
|
||||
%i.fi-lock
|
||||
LOG IN
|
||||
%i.ofn-i_017-locked
|
||||
%span LOG IN
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
%a.icon{href: cart_url, "ng-controller" => "CartCtrl"}
|
||||
%i.fi-shopping-cart.nav-branded
|
||||
%span.nav-branded
|
||||
%i.ofn-i_027-shopping-cart
|
||||
%span
|
||||
{{ CurrentOrder.cart_count }}
|
||||
items
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%nav.top-bar.show-for-large-up{'data' => 'topbar'}
|
||||
%nav.top-bar.show-for-large-up{'data-topbar' => true}
|
||||
%section.top-bar-section
|
||||
%ul.left{}
|
||||
%li= link_to image_tag("ofn_logo_small.png"), root_path
|
||||
%li.ofn-logo= link_to image_tag("ofn_logo_small.png"), root_path
|
||||
%li.divider
|
||||
- if current_page? root_path
|
||||
%li
|
||||
@@ -13,7 +13,7 @@
|
||||
%span.nav-primary Hubs
|
||||
%li.divider
|
||||
%li
|
||||
%a{href: ""}
|
||||
%a{href: main_app.map_path}
|
||||
%span.nav-primary Map
|
||||
%li.divider
|
||||
%li
|
||||
@@ -24,11 +24,6 @@
|
||||
%a{href: main_app.groups_path}
|
||||
%span.nav-primary Groups
|
||||
%li.divider
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_path}
|
||||
%span.nav-primary Admin
|
||||
%li.divider
|
||||
%section.top-bar-section
|
||||
%ul.right
|
||||
%li.divider
|
||||
@@ -43,4 +38,4 @@
|
||||
%span.nav-primary.nav-branded {{ CurrentHub.name }}
|
||||
%li.divider
|
||||
%li.cart
|
||||
= render partial: "shared/menu/cart"
|
||||
= render partial: "shared/menu/cart"
|
||||
@@ -1,7 +1,7 @@
|
||||
%nav.tab-bar.show-for-medium-down
|
||||
%section.left
|
||||
%a.left-off-canvas-toggle.menu-icon
|
||||
%span
|
||||
%span
|
||||
%section.right
|
||||
= render partial: "shared/menu/cart"
|
||||
%a{href: main_app.shop_path}
|
||||
@@ -14,32 +14,41 @@
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_path}
|
||||
%span.nav-primary Admin
|
||||
%span.nav-primary
|
||||
%i.ofn-i_021-tools
|
||||
Admin
|
||||
%li
|
||||
- if spree_current_user.nil?
|
||||
= render 'shared/signed_out'
|
||||
- else
|
||||
= render 'shared/signed_in'
|
||||
|
||||
%li
|
||||
%a{href: main_app.producers_path} Producers
|
||||
= render 'shared/signed_in_offcanvas'
|
||||
|
||||
- if current_page? root_path
|
||||
%li
|
||||
%a{"ofn-scroll-to" => "hubs"}
|
||||
%span.nav-primary Hubs
|
||||
%span.nav-primary
|
||||
%i.ofn-i_040-hub
|
||||
Hubs
|
||||
- else
|
||||
%li
|
||||
%a{href: root_path + "#/#hubs"}
|
||||
%span.nav-primary Hubs
|
||||
%span.nav-primary
|
||||
%i.ofn-i_040-hub
|
||||
Hubs
|
||||
%li
|
||||
%a{href: ""}
|
||||
%span.nav-primary Map
|
||||
%a{href: main_app.map_path}
|
||||
%span.nav-primary
|
||||
%i.ofn-i_037-map
|
||||
Map
|
||||
%li
|
||||
%a{href: main_app.producers_path}
|
||||
%span.nav-primary Producers
|
||||
%span.nav-primary
|
||||
%i.ofn-i_036-producers
|
||||
Producers
|
||||
%li
|
||||
%a{href: main_app.groups_path}
|
||||
%span.nav-primary Groups
|
||||
%span.nav-primary
|
||||
%i.ofn-i_035-groups
|
||||
Groups
|
||||
|
||||
|
||||
|
||||
@@ -17,13 +17,18 @@
|
||||
"ng-repeat" => "product in data.products | filter:query | orderBy:ordering.order | limitTo: limit track by product.id"}
|
||||
%div
|
||||
= render partial: "shop/products/summary"
|
||||
|
||||
%div{"bo-if" => "hasVariants"}
|
||||
= render partial: "shop/products/variants"
|
||||
|
||||
.variants.row{"bo-if" => "!hasVariants"}
|
||||
= render partial: "shop/products/master"
|
||||
|
||||
%product{"ng-show" => "data.loading"}
|
||||
.row.summary
|
||||
.small-12.columns.text-center
|
||||
Loading products
|
||||
|
||||
|
||||
.row
|
||||
.small-12.columns
|
||||
%input.button.primary.right.add_to_cart{type: :submit, value: "Add to Cart"}
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
name: "{{product.primary_taxon.name}}"}
|
||||
= render partial: "modals/product"
|
||||
|
||||
.small-5.columns.summary-header
|
||||
.small-5.columns
|
||||
%i.ofn-i_036-producers
|
||||
= render partial: "modals/producer"
|
||||
|
||||
.small-2.columns.summary-price.text-right.price
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
.row
|
||||
.small-12.large-9.columns
|
||||
%p= current_distributor.long_description.andand.html_safe
|
||||
.small-12.large-3.columns
|
||||
/ Hide image until image styles are working correctly:
|
||||
/ %img.about.right{src: current_distributor.promo_image.url(:large)}
|
||||
|
||||
-#- if current_distributor.promo_image.exists?
|
||||
-#.small-12.large-3.columns
|
||||
-#%img.about.right{src: current_distributor.promo_image.url(:large)}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
%h4=current_distributor.name
|
||||
%p
|
||||
= current_distributor.address.address1
|
||||
- if current_distributor.address.address2
|
||||
- unless current_distributor.address.address2.blank?
|
||||
%br
|
||||
= current_distributor.address.address2
|
||||
%br
|
||||
@@ -19,37 +19,37 @@
|
||||
%ul.small-block-grid-1.large-block-grid-2{bindonce: true}
|
||||
- unless current_distributor.website.blank?
|
||||
%li
|
||||
%a{href: current_distributor.website, target: "_blank" }
|
||||
%i.fi-web
|
||||
%a{href: "http://#{current_distributor.website}", target: "_blank" }
|
||||
%i.ofn-i_049-web
|
||||
= current_distributor.website
|
||||
|
||||
- unless current_distributor.email.blank?
|
||||
%li
|
||||
%a{href: current_distributor.email.reverse, mailto: true }
|
||||
%i.fi-mail
|
||||
%i.ofn-i_050-mail-circle
|
||||
%span.email
|
||||
= current_distributor.email.reverse
|
||||
|
||||
- unless current_distributor.twitter.blank?
|
||||
%li
|
||||
%a{href: current_distributor.twitter, target: "_blank" }
|
||||
%i.fi-social-twitter
|
||||
%a{href: "http://twitter.com/#{current_distributor.twitter}", target: "_blank" }
|
||||
%i.ofn-i_041-twitter
|
||||
= current_distributor.twitter
|
||||
|
||||
- unless current_distributor.facebook.blank?
|
||||
%li
|
||||
%a{href: current_distributor.facebook, target: "_blank" }
|
||||
%i.fi-social-facebook
|
||||
%a{href: "http://#{current_distributor.facebook}", target: "_blank" }
|
||||
%i.ofn-i_044-facebook
|
||||
= current_distributor.facebook
|
||||
|
||||
- unless current_distributor.linkedin.blank?
|
||||
%li
|
||||
%a{href: current_distributor.linkedin, target: "_blank" }
|
||||
%i.fi-social-linkedin
|
||||
%a{href: "http://#{current_distributor.linkedin}", target: "_blank" }
|
||||
%i.ofn-i_042-linkedin
|
||||
= current_distributor.linkedin
|
||||
|
||||
- unless current_distributor.instagram.blank?
|
||||
%li
|
||||
%a{href: current_distributor.instagram, target: "_blank" }
|
||||
%i.fi-social-instagram
|
||||
%a{href: "http://instagram.com.#{current_distributor.instagram}", target: "_blank" }
|
||||
%i.ofn-i_043-instagram
|
||||
= current_distributor.instagram
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
%navigation
|
||||
%distributor.details.row
|
||||
#distributor_title
|
||||
%img.left{src: current_distributor.logo.url(:thumb)}
|
||||
- if current_distributor.logo.exists?
|
||||
%img.left{src: current_distributor.logo.url(:thumb)}
|
||||
%h3
|
||||
= current_distributor.name
|
||||
%location= current_distributor.address.city
|
||||
|
||||
@@ -1,33 +1,38 @@
|
||||
= form_for @search, :url => spree.orders_and_fulfillment_admin_reports_path do |f|
|
||||
= label_tag nil, t(:date_range)
|
||||
%br
|
||||
.date-range-filter
|
||||
.row.date-range-filter
|
||||
= label_tag nil, t(:date_range)
|
||||
%br
|
||||
= label_tag nil, t(:start), :class => 'inline'
|
||||
= f.text_field :completed_at_gt, :class => 'datetimepicker datepicker-from'
|
||||
%span.range-divider
|
||||
%i.icon-arrow-right
|
||||
= f.text_field :completed_at_lt, :class => 'datetimepicker datepicker-to'
|
||||
= label_tag nil, t(:end), :class => 'inline'
|
||||
%br
|
||||
= label_tag nil, "Distributor: "
|
||||
= f.collection_select(:distributor_id_eq, @distributors, :id, :name, :include_blank => @include_blank)
|
||||
%br
|
||||
= label_tag nil, "Supplier: "
|
||||
= select_tag(:supplier_id, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id]), :prompt => @include_blank)
|
||||
%br
|
||||
= label_tag nil, "Order Cycle: "
|
||||
- order_cycles_select = [['No Order Cycle', '-1']]
|
||||
- order_cycles_select += @order_cycles.collect {|oc| [ "#{oc.name} (#{oc.orders_open_at.to_s(:short)} - #{oc.orders_close_at.to_s(:short)})".html_safe, oc.id ] }
|
||||
= f.select(:order_cycle_id_eq, order_cycles_select, include_blank: @include_blank, selected: params[:q][:order_cycle_id_eq])
|
||||
%br
|
||||
= label_tag nil, "Report Type: "
|
||||
= select_tag(:report_type, options_for_select(@report_types, @report_type))
|
||||
%br
|
||||
%br
|
||||
= check_box_tag :csv
|
||||
= label_tag :csv, "Download as csv"
|
||||
%br
|
||||
|
||||
.row
|
||||
.alpha.two.columns= label_tag nil, "Hubs: "
|
||||
.omega.fourteen.columns= f.collection_select(:distributor_id_in, @distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true})
|
||||
|
||||
.row
|
||||
.alpha.two.columns= label_tag nil, "Producers: "
|
||||
.omega.fourteen.columns= select_tag(:supplier_id_in, options_from_collection_for_select(@suppliers, :id, :name, params[:supplier_id_in]), {class: "select2 fullwidth", multiple: true})
|
||||
|
||||
.row
|
||||
.alpha.two.columns= label_tag nil, "Order Cycles: "
|
||||
.omega.fourteen.columns
|
||||
= f.select(:order_cycle_id_in, report_order_cycle_options(@order_cycles), {selected: params[:q][:order_cycle_id_in]}, {class: "select2 fullwidth", multiple: true})
|
||||
|
||||
.row
|
||||
.alpha.two.columns= label_tag nil, "Report Type: "
|
||||
.omega.fourteen.columns= select_tag(:report_type, options_for_select(@report_types, @report_type))
|
||||
|
||||
.row
|
||||
= check_box_tag :csv
|
||||
= label_tag :csv, "Download as csv"
|
||||
|
||||
.row
|
||||
= button t(:search)
|
||||
|
||||
%br
|
||||
%br
|
||||
%table#listing_orders.index
|
||||
|
||||
25
app/views/spree/checkout/payment/_gateway.html.haml
Normal file
25
app/views/spree/checkout/payment/_gateway.html.haml
Normal file
@@ -0,0 +1,25 @@
|
||||
.row
|
||||
.small-6.columns
|
||||
%label
|
||||
First Name
|
||||
%input{type: :text, disabled: true, "ng-value" => "order.bill_address.firstname"}
|
||||
|
||||
.small-6.columns
|
||||
%label
|
||||
Last Name
|
||||
%input{type: :text, disabled: true, "ng-value" => "order.bill_address.lastname"}
|
||||
|
||||
.small-6.columns
|
||||
= validated_input "Card Number", "secrets.card_number", required: true, maxlength: 19, autocomplete: "off"
|
||||
.small-6.columns
|
||||
= validated_input "Security Code", "secrets.card_verification_value", required: true
|
||||
|
||||
.row
|
||||
.small-12.columns
|
||||
%label{for: "secrets.card_month"} Expiry Date
|
||||
|
||||
.row
|
||||
.small-6.columns
|
||||
%select{"ng-model" => "secrets.card_month", "ng-options" => "number as name for (number, name) in months", name: "secrets.card_month", required: true}
|
||||
.small-6.columns
|
||||
%select{"ng-model" => "secrets.card_year", "ng-options" => "year for year in years", name: "secrets.card_year", required: true}
|
||||
@@ -31,8 +31,8 @@
|
||||
%span.order-total.distribution-total= order_distribution_subtotal(@order)
|
||||
%td
|
||||
%td
|
||||
= button_tag :class => 'neutral-btn dark expand small', :id => 'update-button' do
|
||||
%i.fi-refresh
|
||||
= button_tag :class => 'secondary radius expand small', :id => 'update-button' do
|
||||
%i.ofn-i_023-refresh
|
||||
= t(:update)
|
||||
%td
|
||||
%h5.order-total.grand-total= @order.display_total
|
||||
|
||||
@@ -23,5 +23,5 @@
|
||||
|
||||
%td.cart-item-delete.text-center{"data-hook" => "cart_item_delete"}
|
||||
{{ quantity }}
|
||||
= link_to image_tag('icons/delete.png'), '#', :class => 'delete',
|
||||
:id => "delete_#{dom_id(line_item)}"
|
||||
%a.delete{href: "#", id: "delete_#{dom_id(line_item)}"}
|
||||
%i.delete.ofn-i_026-trash
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
.columns.large-8{"data-hook" => ""}
|
||||
|
||||
%a.button.large.secondary{href: main_app.shop_path}
|
||||
%i.fi-arrow-left
|
||||
%i.ofn-i_008-caret-left
|
||||
Continue shopping
|
||||
.columns.large-4.text-right
|
||||
%a#checkout-link.button.large.primary{href: main_app.checkout_path}
|
||||
Checkout
|
||||
%i.fi-arrow-right
|
||||
%i.ofn-i_007-caret-right
|
||||
|
||||
= render partial: "shared/footer"
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ ComfortableMexicanSofa.configure do |config|
|
||||
# filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/Filesystem
|
||||
config.upload_file_options = {
|
||||
:storage => 's3',
|
||||
:s3_protocol => :https,
|
||||
:s3_credentials => {
|
||||
:bucket => Spree::Config[:s3_bucket],
|
||||
:access_key_id => Spree::Config[:s3_access_key],
|
||||
|
||||
@@ -3,6 +3,13 @@ Openfoodnetwork::Application.routes.draw do
|
||||
|
||||
get "/#/login", to: "home#index", as: :spree_login
|
||||
|
||||
|
||||
if Rails.env.production?
|
||||
get "/map", to: "home#index", as: :map
|
||||
else
|
||||
get "/map", to: "map#index", as: :map
|
||||
end
|
||||
|
||||
resource :shop, controller: "shop" do
|
||||
get :products
|
||||
post :order_cycle
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user