mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
add selector for distributor in checkout. Not saving relation as yet.
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -15,6 +15,7 @@ gem 'simple_form'
|
||||
|
||||
gem 'unicorn'
|
||||
# gem 'spree_heroku'
|
||||
gem 'haml'
|
||||
|
||||
|
||||
# Gems used only for assets and not required
|
||||
|
||||
@@ -89,6 +89,7 @@ GEM
|
||||
ffi (1.0.11)
|
||||
gyoku (0.4.4)
|
||||
builder (>= 2.1.2)
|
||||
haml (3.1.4)
|
||||
highline (1.6.8)
|
||||
hike (1.2.1)
|
||||
httpi (0.9.6)
|
||||
@@ -273,6 +274,7 @@ PLATFORMS
|
||||
DEPENDENCIES
|
||||
capybara
|
||||
coffee-rails (~> 3.1.1)
|
||||
haml
|
||||
jquery-rails
|
||||
machinist
|
||||
pg
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
module Spree
|
||||
class Distributor < ActiveRecord::Base
|
||||
set_table_name 'distributors'
|
||||
|
||||
validates :name, :pickup_address, :presence => true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Deface::Override.new(:virtual_path => "spree/checkout/_delivery",
|
||||
:insert_before => "[data-hook='buttons']",
|
||||
:text => "<p>TODO: Select a drop off point.... </p>",
|
||||
Deface::Override.new(:virtual_path => "spree/checkout/_address",
|
||||
:replace => "[data-hook='shipping_fieldset_wrapper']",
|
||||
:partial => "spree/checkout/distributor",
|
||||
:name => "drop_off_point")
|
||||
4
app/views/spree/checkout/_distributor.html.haml
Normal file
4
app/views/spree/checkout/_distributor.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
.columns.omega.six
|
||||
%fieldset{:id => 'shipping'}
|
||||
%legend Collection Point
|
||||
=select("distributor", "distributor_id", Spree::Distributor.all.collect {|p| [ p.name , p.id] },)
|
||||
Reference in New Issue
Block a user