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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b19936a62b8807116a557c91212c3d2b0ec4cdc2
4
- data.tar.gz: 5bc39846c2a6cdd32fe656807b1752ed6f3cd479
3
+ metadata.gz: 871fae6de43052706a38f68451b18932e6b387d9
4
+ data.tar.gz: 6e000b0a681393c7a9c724518f99a6bd12fe8ae6
5
5
  SHA512:
6
- metadata.gz: af672b3f1e226c927e773dfc2c01c063102ab080e0072149c97ee2f482ce1d4e35027336f886d16e681e76c52f7dc735a7739407bc7458e08f29815521016e13
7
- data.tar.gz: e4ea617a6d6e621577cf8bf2d01068f8e314cc616df90491a09835f504178a8f8e7327d478125b816843d70214fae0104a211a60605f3aec03b690dde2d7d145
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
- newList = newList + "<option value='" + options[i] + "'>" + options[i]+'</option>';
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 {
@@ -0,0 +1,2 @@
1
+ $break-phone: 768px;
2
+ $break-tablet: 992px;
@@ -17,6 +17,10 @@
17
17
  label {
18
18
  margin-right: 20px;
19
19
  }
20
+
21
+ input[type='text'], select {
22
+ width: 130px;
23
+ }
20
24
  }
21
25
 
22
26
  .delivery-time-options {
@@ -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
- #delivery-options-homepage
2
- - order = current_order(true)
3
- - if order.delivery_date? && order.delivery_time
4
- .row.success
5
- .columns.sixteen.alpha.omega
6
- %h5
7
- = "Thanks! Your order is scheduled for #{order.delivery_date.strftime('%A, %d %b')} from #{order.delivery_time}."
8
- = " You just need to complete it by #{current_order_cutoff_time}"
9
- %p
10
- You can still change it at the checkout if needed.
11
- - else
12
- .row.form
13
- .columns.seven.alpha
14
- %h3 Want to know when you're getting your groceries?
15
- %h5 Choose your delivery time and get it sorted now
16
- .columns.four
17
- = form_for order, {url: api_order_url(order), html: {id: 'delivery-options-form'}} do |form|
18
- = hidden_field_tag 'order_token', order.token
19
- .field
20
- = form.label :delivery_date, "Delivery Date"
21
- = form.text_field :delivery_date, value: (l(order.delivery_date) rescue l(Date.current))
22
- .field
23
- = form.label :delivery_time, "Delivery Time"
24
- = form.select :delivery_time, JSON.parse(SpreeDeliveryOptions::Config.delivery_time_options)["monday"]
25
- .field
26
- = form.submit "Set Delivery Time"
27
- .delivery-time-options{data: SpreeDeliveryOptions::Config.delivery_time_options}
28
- .columns.four.omega
29
- .error.hide
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
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_delivery_options'
5
- s.version = '2.2.0'
5
+ s.version = '2.2.1'
6
6
  s.summary = 'Adds delivery date and time during checkout'
7
7
  s.description = ''
8
8
  s.required_ruby_version = '>= 2.0.0'
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.0
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-26 00:00:00.000000000 Z
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