spree_delivery_options 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/assets/javascripts/store/delivery_time_options.js +6 -1
- data/app/assets/stylesheets/guides/responsive.scss +2 -0
- data/app/assets/stylesheets/store/delivery_checkout.scss +4 -0
- data/app/assets/stylesheets/store/delivery_options_homepage.scss +10 -0
- data/app/views/spree/checkout/_delivery_date.haml +3 -2
- data/app/views/spree/taxons/_delivery_options.haml +30 -29
- data/lib/spree_delivery_options/configuration.rb +1 -0
- data/lib/spree_delivery_options/engine.rb +0 -3
- data/spree_delivery_options.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 871fae6de43052706a38f68451b18932e6b387d9
|
4
|
+
data.tar.gz: 6e000b0a681393c7a9c724518f99a6bd12fe8ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0914c7916ae6e827a7754e345aeee590786aab72efa103812fc339e586167057f567b6c3c14e32c338a14b1b443998112fb78375b0f72b26550385a01cf7b12
|
7
|
+
data.tar.gz: 22339ae439aa6d1085c748798b40671203ba2b51d150c53e7a63b24ad2622ee3dcd9eff2ad9fffd562617cd34f1106128a949f519b54e8be32e53e8a8c3968ab
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ Features
|
|
18
18
|
* Allows admin to filter orders by delivery date and time (date range).
|
19
19
|
* Allows admin to sort orders by delivery date and time.
|
20
20
|
* Adds delivery date column to orders index page table.
|
21
|
+
* Adds delivery options banner to taxons page (configurable)
|
21
22
|
|
22
23
|
|
23
24
|
Installation
|
@@ -41,10 +41,15 @@ function SpreeDeliveryOptions() {
|
|
41
41
|
|
42
42
|
this.populate_delivery_time = function(options) {
|
43
43
|
if (options) {
|
44
|
+
var selected_delivery_time = $('.selected-delivery-time').attr("data");
|
44
45
|
var arLen = options.length;
|
45
46
|
var newList = "";
|
46
47
|
for ( var i=0, len=arLen; i<len; ++i ){
|
47
|
-
|
48
|
+
if (options[i] == selected_delivery_time) {
|
49
|
+
newList = newList + '<option selected=true value="' + options[i] + '">' + options[i]+'</option>';
|
50
|
+
} else {
|
51
|
+
newList = newList + "<option value='" + options[i] + "'>" + options[i]+'</option>';
|
52
|
+
}
|
48
53
|
}
|
49
54
|
$('#order_delivery_time').html(newList);
|
50
55
|
} else {
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@import 'guides/responsive';
|
2
|
+
|
1
3
|
#delivery-options-homepage {
|
2
4
|
background-color: #ccc;
|
3
5
|
padding: 10px;
|
@@ -38,3 +40,11 @@
|
|
38
40
|
|
39
41
|
}
|
40
42
|
}
|
43
|
+
|
44
|
+
@media screen and (max-width: $break-phone) {
|
45
|
+
|
46
|
+
#delivery-options-homepage {
|
47
|
+
display: none;
|
48
|
+
}
|
49
|
+
|
50
|
+
}
|
@@ -3,10 +3,11 @@
|
|
3
3
|
#delivery_date
|
4
4
|
.field
|
5
5
|
= form.label :delivery_date, "Delivery Date"
|
6
|
-
= form.text_field :delivery_date
|
6
|
+
= form.text_field :delivery_date, value: (l(@order.delivery_date) rescue l(Date.current))
|
7
7
|
.field
|
8
|
+
.selected-delivery-time{data: @order.delivery_time}
|
8
9
|
= form.label :delivery_time, "Delivery Time"
|
9
|
-
= form.select :delivery_time, JSON.parse(SpreeDeliveryOptions::Config.delivery_time_options)["monday"]
|
10
|
+
= form.select :delivery_time, JSON.parse(SpreeDeliveryOptions::Config.delivery_time_options)["monday"]
|
10
11
|
|
11
12
|
.delivery-time-options{data: SpreeDeliveryOptions::Config.delivery_time_options}
|
12
13
|
|
@@ -1,29 +1,30 @@
|
|
1
|
-
|
2
|
-
-
|
3
|
-
|
4
|
-
.
|
5
|
-
.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
=
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
.
|
1
|
+
- if SpreeDeliveryOptions::Config.show_homepage_form
|
2
|
+
#delivery-options-homepage
|
3
|
+
- order = current_order(true)
|
4
|
+
- if order.delivery_date? && order.delivery_time
|
5
|
+
.row.success
|
6
|
+
.columns.sixteen.alpha.omega
|
7
|
+
%h5
|
8
|
+
= "Thanks! Your order is scheduled for #{order.delivery_date.strftime('%A, %d %b')} from #{order.delivery_time}."
|
9
|
+
= " You just need to complete it by #{current_order_cutoff_time}"
|
10
|
+
%p
|
11
|
+
You can still change it at the checkout if needed.
|
12
|
+
- else
|
13
|
+
.row.form
|
14
|
+
.columns.seven.alpha
|
15
|
+
%h3 Want to know when you're getting your groceries?
|
16
|
+
%h5 Choose your delivery time and get it sorted now
|
17
|
+
.columns.four
|
18
|
+
= form_for order, {url: api_order_url(order), html: {id: 'delivery-options-form'}} do |form|
|
19
|
+
= hidden_field_tag 'order_token', order.token
|
20
|
+
.field
|
21
|
+
= form.label :delivery_date, "Delivery Date"
|
22
|
+
= form.text_field :delivery_date, value: (l(order.delivery_date) rescue l(Date.current))
|
23
|
+
.field
|
24
|
+
= form.label :delivery_time, "Delivery Time"
|
25
|
+
= form.select :delivery_time, JSON.parse(SpreeDeliveryOptions::Config.delivery_time_options)["monday"]
|
26
|
+
.field
|
27
|
+
= form.submit "Set Delivery Time"
|
28
|
+
.delivery-time-options{data: SpreeDeliveryOptions::Config.delivery_time_options}
|
29
|
+
.columns.four.omega
|
30
|
+
.error.hide
|
@@ -2,5 +2,6 @@ module SpreeDeliveryOptions
|
|
2
2
|
class Configuration < Spree::Preferences::Configuration
|
3
3
|
preference :delivery_cut_off_hour, :integer, default: 12
|
4
4
|
preference :delivery_time_options, :string, default: {monday: ['Between 6am-8am']}.to_json
|
5
|
+
preference :show_homepage_form, :boolean, default: true
|
5
6
|
end
|
6
7
|
end
|
@@ -18,9 +18,6 @@ module SpreeDeliveryOptions
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.activate
|
21
|
-
Dir.glob(File.join(File.dirname(__FILE__), '../../app/controllers/**/*.rb')) do |c|
|
22
|
-
Rails.configuration.cache_classes ? require(c) : load(c)
|
23
|
-
end
|
24
21
|
Dir.glob(File.join(File.dirname(__FILE__), '../../app/helpers/**.rb')) do |c|
|
25
22
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
26
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_delivery_options
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francisco Trindade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -228,6 +228,7 @@ files:
|
|
228
228
|
- app/assets/stylesheets/admin/delivery_options_form.scss
|
229
229
|
- app/assets/stylesheets/admin/order_details.scss
|
230
230
|
- app/assets/stylesheets/admin/spree_delivery_options.css
|
231
|
+
- app/assets/stylesheets/guides/responsive.scss
|
231
232
|
- app/assets/stylesheets/store/delivery_checkout.scss
|
232
233
|
- app/assets/stylesheets/store/delivery_options_homepage.scss
|
233
234
|
- app/assets/stylesheets/store/jquery-ui-1.10.4.custom.css
|