spree_backend 2.1.2 → 2.1.3

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: 1edfef75f84d807cf8c95f2859bc483117a9d906
4
- data.tar.gz: 0b68a358dfefe75da826cc499a6f452a4e15a46d
3
+ metadata.gz: 12021adfcb10f00a2b98a07f498f4edef06d5d24
4
+ data.tar.gz: 4d536e1bc06c6e6ad0920efa39c156a401b5a6a6
5
5
  SHA512:
6
- metadata.gz: 0899662385e5da0455968e7b1c39f5bae6e50fbaa78ed448231ecdca68cd083c3187ba7cf699e31efe2eb618daab65da2423148699324aebcbdce57558c5196d
7
- data.tar.gz: 0cf2af22c6bbcf29dde8eac4612a1f0aa0ed226b6a1d8c65e0d04f6e85e12b16aa508caca779ec539f39cc1e37a00515dcb9fc58c1a34f4b27d85b8ce9db9314
6
+ metadata.gz: e1e3f510b20c7c7243503752495bea80ce72982bd284c9e569cbe43f5a4539dc3864a4e279c92c84ce82c5a718870ff00db70bfa927eb25ecba4139acf4d3589
7
+ data.tar.gz: 50227ecf97ee5deb2ff786c43ea1190738882a39e3992e9a8f7a4feb2a5b0aad34313f7c5f4530399abc49ff0bbc2da2daa63f2e68883007ce4f66285b818bc8
@@ -25,10 +25,9 @@ $(document).ready(function() {
25
25
  });
26
26
 
27
27
  // Handle adding new styles
28
- var styles_hash_index = 1;
29
28
  $(document).on('click', '.add_new_style', function(e) {
30
29
  e.preventDefault();
31
- $('#new-styles').append(generate_html_for_hash("new_attachment_styles", styles_hash_index));
30
+ $('#new-styles').append(generate_html_for_hash("new_attachment_styles", new Date().getTime()));
32
31
  });
33
32
 
34
33
  // Handle adding new headers
@@ -1,22 +1,5 @@
1
1
  $(document).ready(function () {
2
2
  'use strict';
3
3
 
4
- $('#add_line_item_to_order').on('click', function () {
5
- if ($('#add_variant_id').val() === '') {
6
- return false;
7
- }
8
-
9
- var update_target = '#' + $(this).attr('data-update');
10
- $.post(this.href, {
11
- 'line_item[variant_id]': $('#add_variant_id').val(),
12
- 'line_item[quantity]': $('#add_quantity').val()
13
- },
14
-
15
- function (data) {
16
- $(update_target).html(data);
17
- });
18
- return false;
19
- });
20
-
21
4
  $('[data-hook="add_product_name"]').find('.variant_autocomplete').variantAutocomplete();
22
- });
5
+ });
@@ -27,7 +27,6 @@ $(document).ready(function () {
27
27
  },
28
28
  results: function (data, page) {
29
29
  var more = page < data.pages;
30
- console.log(more)
31
30
  return {
32
31
  results: data['taxons'],
33
32
  more: more
@@ -14,7 +14,7 @@ handle_move = (e, data) ->
14
14
  type: "POST",
15
15
  dataType: "json",
16
16
  url: url.toString(),
17
- data: ({_method: "put", "taxon[parent_id]": new_parent.attr("id"), "taxon[position]": position }),
17
+ data: ({_method: "put", "taxon[parent_id]": new_parent.attr("id"), "taxon[child_index]": position }),
18
18
  error: handle_ajax_error
19
19
 
20
20
  true
@@ -30,7 +30,7 @@ handle_create = (e, data) ->
30
30
  type: "POST",
31
31
  dataType: "json",
32
32
  url: base_url.toString(),
33
- data: ({"taxon[name]": name, "taxon[parent_id]": new_parent.attr("id"), "taxon[position]": position }),
33
+ data: ({"taxon[name]": name, "taxon[parent_id]": new_parent.attr("id"), "taxon[child_index]": position }),
34
34
  error: handle_ajax_error,
35
35
  success: (data,result) ->
36
36
  node.attr('id', data.id)
@@ -18,7 +18,6 @@ html.ie {
18
18
  }
19
19
  .select2-search {
20
20
  &:before {
21
- position: relative;
22
21
  z-index: 10000;
23
22
  content: '\f002' !important;
24
23
  }
@@ -70,4 +69,4 @@ html.ie8 {
70
69
  }
71
70
  }
72
71
 
73
- }
72
+ }
@@ -22,6 +22,7 @@ html.firefox {
22
22
 
23
23
  // Fix select2 search input left padding to not overlap search icon
24
24
  .select2-search input.select2-input {
25
+ padding-bottom: 12px !important;
25
26
  padding-left: 25px !important;
26
27
  }
27
28
 
@@ -29,4 +30,4 @@ html.firefox {
29
30
  input#image_attachment {
30
31
  width: 80%;
31
32
  }
32
- }
33
+ }
@@ -63,7 +63,7 @@
63
63
  @extend [class^="icon-"]:before;
64
64
 
65
65
  position: absolute;
66
- top: 13px;
66
+ top: 16px;
67
67
  left: 13px;
68
68
  }
69
69
 
@@ -39,39 +39,22 @@ module Spree
39
39
  parent_id = params[:taxon][:parent_id]
40
40
  new_position = params[:taxon][:position]
41
41
 
42
- if parent_id || new_position #taxon is being moved
43
- new_parent = parent_id.nil? ? @taxon.parent : Taxon.find(parent_id.to_i)
44
- new_position = new_position.nil? ? -1 : new_position.to_i
45
-
46
- # Bellow is a very complicated way of finding where in nested set we
47
- # should actually move the taxon to achieve sane results,
48
- # JS is giving us the desired position, which was awesome for previous setup,
49
- # but now it's quite complicated to find where we should put it as we have
50
- # to differenciate between moving to the same branch, up down and into
51
- # first position.
52
- new_siblings = new_parent.children
53
- if new_position <= 0 && new_siblings.empty?
54
- @taxon.move_to_child_of(new_parent)
55
- elsif new_parent.id != @taxon.parent_id
56
- if new_position == 0
57
- @taxon.move_to_left_of(new_siblings.first)
58
- else
59
- @taxon.move_to_right_of(new_siblings[new_position-1])
60
- end
61
- elsif new_position < new_siblings.index(@taxon)
62
- @taxon.move_to_left_of(new_siblings[new_position]) # we move up
63
- else
64
- @taxon.move_to_right_of(new_siblings[new_position-1]) # we move down
65
- end
66
- # Reset legacy position, if any extensions still rely on it
67
- new_parent.children.reload.each{|t| t.update_column(:position, t.position)}
68
-
69
- if parent_id
70
- @taxon.reload
71
- @taxon.set_permalink
72
- @taxon.save!
73
- @update_children = true
74
- end
42
+ if parent_id
43
+ @taxon.parent = Taxon.find(parent_id.to_i)
44
+ end
45
+
46
+ if new_position
47
+ @taxon.child_index = new_position.to_i
48
+ end
49
+
50
+ @taxon.save!
51
+
52
+ # regenerate permalink
53
+ if parent_id
54
+ @taxon.reload
55
+ @taxon.set_permalink
56
+ @taxon.save!
57
+ @update_children = true
75
58
  end
76
59
 
77
60
  if params.key? "permalink_part"
@@ -53,14 +53,14 @@
53
53
  <div class="field">
54
54
  <%= label_tag :mail_port, Spree.t(:smtp_port) %><br />
55
55
  <%= text_field_tag :mail_port, Spree::Config[:mail_port], :class => 'fullwidth' %>
56
- </div>
56
+ </div>
57
57
  <div class="field">
58
58
  <%= label_tag :secure_connection_type, Spree.t(:secure_connection_type) %><br />
59
- <%= select_tag(:secure_connection_type, options_from_collection_for_select(Spree::Core::MailSettings::SECURE_CONNECTION_TYPES.map{|w| Spree.t(w.downcase.to_sym, :default => w)}, :to_s, :to_s, Spree::Config[:secure_connection_type]), :class => 'select2 fullwidth') %>
59
+ <%= select_tag(:secure_connection_type, options_from_collection_for_select(Spree::Core::MailSettings::SECURE_CONNECTION_TYPES.map{|w| Spree.t(w.downcase.to_sym, :default => w, :scope => 'mail_settings.security')}, :to_s, :to_s, Spree::Config[:secure_connection_type]), :class => 'select2 fullwidth') %>
60
60
  </div>
61
61
  <div class="field">
62
62
  <%= label_tag :mail_auth_type, Spree.t(:smtp_authentication_type) %><br />
63
- <%= select_tag(:mail_auth_type, options_from_collection_for_select(Spree::Core::MailSettings::MAIL_AUTH.map{|w| Spree.t(w.downcase.to_sym, :default => w)}, :to_s, :to_s, Spree::Config[:mail_auth_type]), :class => 'select2 fullwidth') %>
63
+ <%= select_tag(:mail_auth_type, options_from_collection_for_select(Spree::Core::MailSettings::MAIL_AUTH.map{|w| Spree.t(w.downcase.to_sym, :default => w, :scope => 'mail_settings.auth')}, :to_s, :to_s, Spree::Config[:mail_auth_type]), :class => 'select2 fullwidth') %>
64
64
  </div>
65
65
  <div class="field">
66
66
  <%= label_tag :smtp_username, Spree.t(:smtp_username) %><br />
@@ -2,7 +2,7 @@
2
2
 
3
3
  <% content_for :page_title do %>
4
4
  <i class="icon-arrow-right"></i>
5
- <%= Spree.t("activerecord.models.#{@payment.class.to_s.underscore}.one") %>
5
+ <%= I18n.t(:one, scope: "activerecord.models.spree/payment") %>
6
6
  <i class="icon-arrow-right"></i>
7
7
  <%= payment_method_name(@payment) %>
8
8
  <% end %>
@@ -1,13 +1,13 @@
1
1
  <%= search_form_for @search, :url => spree.sales_total_admin_reports_path do |s| %>
2
2
  <div class="date-range-filter field align-center">
3
3
  <%= label_tag nil, Spree.t(:start), :class => 'inline' %>
4
- <%= s.text_field :created_at_gt, :class => 'datepicker datepicker-from' %>
4
+ <%= s.text_field :created_at_gt, :class => 'datepicker datepicker-from', :value => datepicker_field_value(params[:q][:created_at_gt]) %>
5
5
 
6
6
  <span class="range-divider">
7
7
  <i class="icon-arrow-right"></i>
8
8
  </span>
9
9
 
10
- <%= s.text_field :created_at_lt, :class => 'datepicker datepicker-to' %>
10
+ <%= s.text_field :created_at_lt, :class => 'datepicker datepicker-to', :value => datepicker_field_value(params[:q][:created_at_lt]) %>
11
11
  <%= label_tag nil, Spree.t(:end), :class => 'inline' %>
12
12
  </div>
13
13
 
data/config/routes.rb CHANGED
@@ -11,11 +11,7 @@ Spree::Core::Engine.add_routes do
11
11
 
12
12
  resources :adjustments
13
13
  resources :zones
14
- resources :banners do
15
- member do
16
- post :dismiss
17
- end
18
- end
14
+
19
15
  resources :countries do
20
16
  resources :states
21
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-15 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,42 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.2
19
+ version: 2.1.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.2
26
+ version: 2.1.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.2
33
+ version: 2.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.1.2
41
- - !ruby/object:Gem::Dependency
42
- name: deface
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: 0.9.0
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: 0.9.0
40
+ version: 2.1.3
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: jquery-rails
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +180,6 @@ files:
194
180
  - app/assets/stylesheets/admin/spree_backend.css
195
181
  - app/assets/stylesheets/store/backend.css
196
182
  - app/controllers/spree/admin/adjustments_controller.rb
197
- - app/controllers/spree/admin/banners_controller.rb
198
183
  - app/controllers/spree/admin/base_controller.rb
199
184
  - app/controllers/spree/admin/countries_controller.rb
200
185
  - app/controllers/spree/admin/general_settings_controller.rb
@@ -254,7 +239,6 @@ files:
254
239
  - app/views/spree/admin/adjustments/edit.html.erb
255
240
  - app/views/spree/admin/adjustments/index.html.erb
256
241
  - app/views/spree/admin/adjustments/new.html.erb
257
- - app/views/spree/admin/banners/_gateway.html.erb
258
242
  - app/views/spree/admin/countries/_form.html.erb
259
243
  - app/views/spree/admin/countries/edit.html.erb
260
244
  - app/views/spree/admin/countries/index.html.erb
@@ -1,14 +0,0 @@
1
- module Spree
2
- module Admin
3
- class BannersController < Spree::Admin::BaseController
4
- def dismiss
5
- if params[:id]
6
- if user = try_spree_current_user
7
- user.dismiss_banner(params[:id])
8
- end
9
- end
10
- render :nothing => true
11
- end
12
- end
13
- end
14
- end
@@ -1,16 +0,0 @@
1
- <% if !try_spree_current_user.try(:dismissed_banner?, :gateway) &&
2
- Spree::PaymentMethod.production.where("type != 'Spree::Gateway::Bogus'").empty? %>
3
-
4
- <div class="banner payment_banner">
5
- <p class="message">
6
- <%= Spree.t(:payment_processor_choose_banner_text)%>
7
- <%= link_to Spree.t(:payment_processor_choose_link), "http://spreecommerce.com/products/payment_processing", :target => '_blank' %>
8
- </p>
9
-
10
- <%= link_to Spree.t(:dismiss_banner), dismiss_admin_banner_path(:gateway),
11
- :remote => true, :method => :post, :class => 'dismiss', :id => "dismiss-banner" %>
12
- </div>
13
-
14
-
15
-
16
- <% end %>