spree_core 1.1.6 → 1.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/{creditcards → credit_cards}/amex_cid.gif +0 -0
- data/app/assets/images/{creditcards/creditcard.gif → credit_cards/credit_card.gif} +0 -0
- data/app/assets/images/{creditcards → credit_cards}/discover_cid.gif +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/american_express.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/cirrus.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/delta.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/dinersclub.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/directdebit.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/discover.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/egold.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/maestro.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/master.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/paypal.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/solo.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/switch.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/visa.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/visaelectron.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/westernunion.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/wirecard.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/icons/worldpay.png +0 -0
- data/app/assets/images/{creditcards → credit_cards}/master_cid.jpg +0 -0
- data/app/assets/images/{creditcards → credit_cards}/visa_cid.gif +0 -0
- data/app/assets/javascripts/admin/admin.js.erb +12 -136
- data/app/assets/javascripts/admin/checkouts/edit.js +18 -35
- data/app/assets/javascripts/admin/gateway.js +2 -2
- data/app/assets/javascripts/admin/images/index.js.coffee +12 -0
- data/app/assets/javascripts/admin/images/new.js.coffee +4 -0
- data/app/assets/javascripts/admin/orders/edit.js +1 -1
- data/app/assets/javascripts/admin/orders/edit_form.js +0 -2
- data/app/assets/javascripts/admin/product_autocomplete.js.erb +116 -0
- data/app/assets/javascripts/store/cart.js.coffee +7 -0
- data/app/assets/javascripts/store/checkout.js.coffee +57 -0
- data/app/assets/javascripts/store/product.js.coffee +36 -0
- data/app/assets/stylesheets/admin/admin.css.erb +5 -0
- data/app/assets/stylesheets/admin/spree_core.css +1 -0
- data/app/assets/stylesheets/store/screen.css.scss +15 -1
- data/app/assets/stylesheets/store/variables.css.scss +29 -29
- data/app/controllers/spree/admin/banners_controller.rb +14 -0
- data/app/controllers/spree/admin/base_controller.rb +11 -0
- data/app/controllers/spree/admin/images_controller.rb +13 -5
- data/app/controllers/spree/admin/line_items_controller.rb +16 -25
- data/app/controllers/spree/admin/mail_methods_controller.rb +1 -8
- data/app/controllers/spree/admin/option_types_controller.rb +0 -25
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +3 -3
- data/app/controllers/spree/admin/orders_controller.rb +23 -14
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -7
- data/app/controllers/spree/admin/payments_controller.rb +5 -5
- data/app/controllers/spree/admin/products_controller.rb +15 -5
- data/app/controllers/spree/admin/prototypes_controller.rb +2 -2
- data/app/controllers/spree/admin/reports_controller.rb +1 -7
- data/app/controllers/spree/admin/resource_controller.rb +130 -130
- data/app/controllers/spree/admin/search_controller.rb +47 -0
- data/app/controllers/spree/admin/taxons_controller.rb +0 -43
- data/app/controllers/spree/base_controller.rb +2 -1
- data/app/controllers/spree/checkout_controller.rb +29 -10
- data/app/controllers/spree/orders_controller.rb +7 -11
- data/app/controllers/spree/products_controller.rb +5 -1
- data/app/helpers/spree/account_helper.rb +4 -0
- data/app/helpers/spree/admin/base_helper.rb +2 -44
- data/app/helpers/spree/admin/navigation_helper.rb +1 -3
- data/app/helpers/spree/admin/orders_helper.rb +3 -2
- data/app/helpers/spree/admin/products_helper.rb +21 -0
- data/app/helpers/spree/base_helper.rb +14 -11
- data/app/helpers/spree/checkout_helper.rb +5 -1
- data/app/helpers/spree/orders_helper.rb +5 -0
- data/app/helpers/spree/products_helper.rb +4 -0
- data/app/helpers/spree/trackers_helper.rb +4 -0
- data/app/models/spree/ability.rb +70 -0
- data/app/models/spree/address.rb +4 -12
- data/app/models/spree/adjustment.rb +30 -8
- data/app/models/spree/app_configuration.rb +1 -1
- data/app/models/spree/calculator/price_sack.rb +3 -5
- data/app/models/spree/country.rb +1 -4
- data/app/models/spree/{creditcard.rb → credit_card.rb} +4 -4
- data/app/models/spree/gateway.rb +2 -2
- data/app/models/spree/gateway/bogus.rb +10 -10
- data/app/models/spree/gateway/bogus_simple.rb +4 -4
- data/app/models/spree/image.rb +3 -12
- data/app/models/spree/inventory_unit.rb +4 -6
- data/app/models/spree/{user.rb → legacy_user.rb} +7 -6
- data/app/models/spree/line_item.rb +4 -5
- data/app/models/spree/option_type.rb +4 -6
- data/app/models/spree/option_value.rb +1 -1
- data/app/models/spree/order.rb +90 -132
- data/app/models/spree/order/checkout.rb +124 -0
- data/app/models/spree/payment.rb +6 -6
- data/app/models/spree/payment/processing.rb +34 -38
- data/app/models/spree/payment_method.rb +2 -2
- data/app/models/spree/preference.rb +2 -0
- data/app/models/spree/preferences/preferable_class_methods.rb +0 -2
- data/app/models/spree/preferences/store.rb +3 -21
- data/app/models/spree/product.rb +41 -43
- data/app/models/spree/product/scopes.rb +9 -25
- data/app/models/spree/product_option_type.rb +2 -2
- data/app/models/spree/product_property.rb +9 -4
- data/app/models/spree/property.rb +1 -1
- data/app/models/spree/prototype.rb +2 -2
- data/app/models/spree/return_authorization.rb +2 -2
- data/app/models/spree/role.rb +1 -1
- data/app/models/spree/shipment.rb +6 -5
- data/app/models/spree/shipping_method.rb +19 -13
- data/app/models/spree/state.rb +2 -5
- data/app/models/spree/state_change.rb +1 -1
- data/app/models/spree/tax_rate.rb +8 -1
- data/app/models/spree/taxon.rb +5 -1
- data/app/models/spree/taxonomy.rb +1 -1
- data/app/models/spree/tokenized_permission.rb +6 -0
- data/app/models/spree/tracker.rb +1 -1
- data/app/models/spree/variant.rb +13 -40
- data/app/models/spree/zone.rb +15 -14
- data/app/models/spree/zone_member.rb +1 -1
- data/app/views/spree/admin/image_settings/edit.html.erb +2 -2
- data/app/views/spree/admin/images/_form.html.erb +8 -4
- data/app/views/spree/admin/images/index.html.erb +1 -1
- data/app/views/spree/admin/line_items/create.js.erb +1 -1
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
- data/app/views/spree/admin/option_types/index.html.erb +1 -1
- data/app/views/spree/admin/orders/_add_product.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +4 -4
- data/app/views/spree/admin/orders/show.html.erb +1 -1
- data/app/views/spree/admin/payments/_form.html.erb +1 -1
- data/app/views/spree/admin/payments/new.html.erb +0 -4
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +1 -1
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +2 -2
- data/app/views/spree/admin/products/_form.html.erb +21 -5
- data/app/views/spree/admin/products/index.html.erb +2 -2
- data/app/views/spree/admin/properties/_form.html.erb +1 -1
- data/app/views/spree/admin/properties/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +33 -17
- data/app/views/spree/admin/return_authorizations/edit.html.erb +2 -2
- data/app/views/spree/admin/shared/_address_form.html.erb +1 -1
- data/app/views/spree/admin/shared/_head.html.erb +12 -2
- data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -4
- data/app/views/spree/admin/shared/_product_tabs.html.erb +0 -6
- data/app/views/spree/admin/shared/_show_resource_links.html.erb +3 -3
- data/app/views/spree/admin/shared/_tabs.html.erb +1 -2
- data/app/views/spree/admin/shipments/edit.html.erb +2 -2
- data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/states/_state_list.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +2 -2
- data/app/views/spree/admin/variants/_form.html.erb +13 -13
- data/app/views/spree/admin/variants/index.html.erb +1 -7
- data/app/views/spree/checkout/_address.html.erb +10 -4
- data/app/views/spree/checkout/edit.html.erb +0 -1
- data/app/views/spree/checkout/payment/_gateway.html.erb +5 -5
- data/app/views/spree/checkout/registration.html.erb +2 -2
- data/app/views/spree/content/cvv.html.erb +6 -6
- data/app/views/spree/layouts/spree_application.html.erb +4 -48
- data/app/views/spree/order_mailer/cancel_email.text.erb +5 -5
- data/app/views/spree/order_mailer/confirm_email.text.erb +6 -7
- data/app/views/spree/orders/_adjustments.html.erb +14 -0
- data/app/views/spree/orders/_form.html.erb +1 -0
- data/app/views/spree/orders/show.html.erb +3 -3
- data/app/views/spree/products/_thumbnails.html.erb +1 -1
- data/app/views/spree/products/index.html.erb +1 -1
- data/app/views/spree/shared/_footer.html.erb +6 -0
- data/app/views/spree/shared/_google_analytics.html.erb +15 -16
- data/app/views/spree/shared/_head.html.erb +3 -9
- data/app/views/spree/shared/_header.html.erb +5 -0
- data/app/views/spree/shared/_main_nav_bar.html.erb +6 -0
- data/app/views/spree/shared/_nav_bar.html.erb +7 -3
- data/app/views/spree/shared/_order_details.html.erb +14 -11
- data/app/views/spree/shared/_sidebar.html.erb +3 -0
- data/app/views/spree/shared/unauthorized.html.erb +0 -0
- data/app/views/spree/shipment_mailer/shipped_email.text.erb +7 -7
- data/app/views/spree/taxons/show.html.erb +1 -1
- data/config/initializers/check_for_orphaned_preferences.rb +1 -1
- data/config/initializers/spree.rb +0 -12
- data/config/initializers/user_class_extensions.rb +25 -0
- data/config/initializers/workarounds_for_ruby19.rb +72 -0
- data/config/locales/en.yml +11 -24
- data/config/routes.rb +7 -37
- data/db/migrate/20090823005402_spree_zero_nine_zero.rb +14 -12
- data/db/migrate/20091015153048_add_openid_field_to_users.rb +9 -7
- data/db/migrate/20100209144531_polymorphic_payments.rb +5 -5
- data/db/migrate/20100214212536_assign_creditcard_txns_to_payment.rb +4 -4
- data/db/migrate/20100528185820_add_index_on_users_persistence_token.rb +3 -1
- data/db/migrate/20100811163637_add_guest_flag.rb +3 -1
- data/db/migrate/20100901171814_change_guest_flag_to_anonymous.rb +3 -1
- data/db/migrate/20101026184959_generate_anonymous_users.rb +3 -3
- data/db/migrate/20101103212716_drop_anonymous_field_for_user.rb +3 -1
- data/db/migrate/20111007143030_namespace_top_level_models.rb +18 -1
- data/db/migrate/20120315064358_migrate_images_from_products_to_variants.rb +6 -4
- data/db/migrate/20120509055454_create_tokenized_permissions_table.rb +16 -0
- data/db/migrate/20120530012000_rename_creditcards_to_credit_cards.rb +11 -0
- data/db/migrate/20120604203654_remove_credit_total_from_orders.rb +5 -0
- data/lib/generators/spree/custom_user/custom_user_generator.rb +53 -0
- data/lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt +28 -0
- data/lib/generators/spree/custom_user/templates/initializer.rb.tt +1 -0
- data/lib/generators/spree/custom_user/templates/migration.rb.tt +7 -0
- data/lib/generators/spree/dummy/dummy_generator.rb +3 -0
- data/lib/generators/spree/dummy/templates/initializers/custom_user.rb +1 -0
- data/lib/generators/spree/install/templates/app/assets/javascripts/admin/all.js +0 -1
- data/lib/generators/spree/install/templates/app/assets/javascripts/store/all.js +0 -1
- data/lib/generators/spree/install/templates/app/assets/stylesheets/admin/all.css +0 -1
- data/lib/generators/spree/install/templates/app/assets/stylesheets/store/all.css +0 -1
- data/lib/generators/spree/install/templates/config/initializers/spree.rb +2 -0
- data/lib/spree/core.rb +15 -2
- data/lib/spree/core/controller_helpers.rb +123 -62
- data/lib/spree/core/current_order.rb +5 -0
- data/lib/spree/core/engine.rb +1 -1
- data/lib/spree/core/mail_settings.rb +1 -2
- data/lib/spree/core/permalinks.rb +1 -5
- data/lib/spree/core/preference_rescue.rb +8 -4
- data/lib/spree/core/relation_serialization.rb +9 -0
- data/lib/spree/core/respond_with.rb +1 -1
- data/lib/spree/core/s3_support.rb +25 -0
- data/lib/spree/core/search/base.rb +2 -5
- data/lib/spree/core/ssl_requirement.rb +2 -2
- data/lib/spree/core/store_helpers.rb +1 -2
- data/lib/spree/core/testing_support/controller_requests.rb +1 -0
- data/lib/spree/core/testing_support/env.rb +2 -0
- data/lib/spree/core/testing_support/factories/{creditcard_factory.rb → credit_card_factory.rb} +3 -3
- data/lib/spree/core/testing_support/factories/payment_factory.rb +1 -1
- data/lib/spree/core/testing_support/factories/product_factory.rb +4 -4
- data/lib/spree/core/testing_support/factories/user_factory.rb +3 -3
- data/lib/spree/core/testing_support/factories/zone_factory.rb +2 -3
- data/lib/spree/core/token_resource.rb +27 -0
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/product_filters.rb +12 -13
- data/lib/tasks/core.rake +1 -1
- metadata +146 -154
- data/app/assets/images/noimage/large.png +0 -0
- data/app/assets/javascripts/admin/images/index.js +0 -10
- data/app/assets/javascripts/admin/images/new.js +0 -5
- data/app/assets/javascripts/admin/products.js +0 -2
- data/app/assets/javascripts/store/cart.js +0 -11
- data/app/assets/javascripts/store/checkout.js +0 -78
- data/app/assets/javascripts/store/product.js +0 -49
- data/app/controllers/spree/admin/users_controller.rb +0 -68
- data/app/views/spree/admin/option_types/_available.html.erb +0 -28
- data/app/views/spree/admin/option_types/_selected.html.erb +0 -26
- data/app/views/spree/admin/option_types/available.js.erb +0 -2
- data/app/views/spree/admin/option_types/select.js.erb +0 -3
- data/app/views/spree/admin/option_types/selected.html.erb +0 -6
- data/app/views/spree/admin/orders/history.html.erb +0 -29
- data/app/views/spree/admin/products/_option_types.html.erb +0 -40
- data/app/views/spree/admin/shared/_additional_field.html.erb +0 -5
- data/app/views/spree/admin/shared/_routes.html.erb +0 -8
- data/app/views/spree/admin/shared/_translations.html.erb +0 -17
- data/app/views/spree/admin/taxons/available.js.erb +0 -26
- data/app/views/spree/admin/taxons/remove.html.erb +0 -1
- data/app/views/spree/admin/taxons/select.js.erb +0 -2
- data/app/views/spree/admin/taxons/selected.html.erb +0 -42
- data/app/views/spree/admin/users/_form.html.erb +0 -19
- data/app/views/spree/admin/users/edit.html.erb +0 -14
- data/app/views/spree/admin/users/index.html.erb +0 -48
- data/app/views/spree/admin/users/new.html.erb +0 -14
- data/app/views/spree/admin/users/show.html.erb +0 -21
- data/app/views/spree/shared/_store_menu.html.erb +0 -2
- data/config/initializers/rails_5868.rb +0 -8
- data/db/migrate/20120605211305_make_users_email_index_unique.rb +0 -10
- data/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb +0 -11
- data/db/sample/users.rb +0 -61
- data/lib/generators/spree/sandbox/sandbox_generator.rb +0 -36
- data/lib/generators/spree/sandbox/templates/rails/routes.rb +0 -7
- data/lib/spree/core/ext/array.rb +0 -14
- data/lib/spree/core/ext/hash.rb +0 -75
- data/lib/spree/core/ext/string.rb +0 -10
- data/lib/tasks/install.rake +0 -18
data/app/models/spree/zone.rb
CHANGED
@@ -53,30 +53,29 @@ module Spree
|
|
53
53
|
|
54
54
|
# convenience method for returning the countries contained within a zone
|
55
55
|
def country_list
|
56
|
-
@countries ||=
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
}.flatten.compact.uniq
|
56
|
+
@countries ||=
|
57
|
+
case kind
|
58
|
+
when 'country'
|
59
|
+
zoneables
|
60
|
+
when 'state'
|
61
|
+
zoneables.collect(&:country)
|
62
|
+
else
|
63
|
+
nil
|
64
|
+
end.flatten.compact.uniq
|
66
65
|
end
|
67
66
|
|
68
67
|
def <=>(other)
|
69
68
|
name <=> other.name
|
70
69
|
end
|
71
70
|
|
72
|
-
# All zoneables belonging to the zone members. Will be a
|
71
|
+
# All zoneables belonging to the zone members. Will be a collection of either
|
73
72
|
# countries or states depending on the zone type.
|
74
73
|
def zoneables
|
75
|
-
members.collect
|
74
|
+
members.collect(&:zoneable)
|
76
75
|
end
|
77
76
|
|
78
77
|
def self.default_tax
|
79
|
-
|
78
|
+
where(:default_tax => true).first
|
80
79
|
end
|
81
80
|
|
82
81
|
# Indicates whether the specified zone falls entirely within the zone performing
|
@@ -98,6 +97,7 @@ module Spree
|
|
98
97
|
end
|
99
98
|
|
100
99
|
private
|
100
|
+
|
101
101
|
def remove_defunct_members
|
102
102
|
zone_members.each do |zone_member|
|
103
103
|
zone_member.destroy if zone_member.zoneable_id.nil? || zone_member.zoneable_type != "Spree::#{kind.capitalize}"
|
@@ -106,7 +106,8 @@ module Spree
|
|
106
106
|
|
107
107
|
def remove_previous_default
|
108
108
|
return unless default_tax
|
109
|
-
|
109
|
+
|
110
|
+
self.class.all.each do |zone|
|
110
111
|
zone.update_column 'default_tax', false unless zone == self
|
111
112
|
end
|
112
113
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Spree
|
2
2
|
class ZoneMember < ActiveRecord::Base
|
3
|
-
belongs_to :zone, :
|
3
|
+
belongs_to :zone, :counter_cache => true
|
4
4
|
belongs_to :zoneable, :polymorphic => true
|
5
5
|
|
6
6
|
attr_accessible :zone, :zone_id, :zoneable, :zoneable_id, :zoneable_type
|
@@ -9,14 +9,14 @@
|
|
9
9
|
<p data-hook="attachment_path">
|
10
10
|
<label>
|
11
11
|
<%= label_tag 'preferences[attachment_path]', t(:attachment_path) %>
|
12
|
-
<%= preference_field_tag 'preferences[attachment_path]', Spree::Config[:attachment_path], :type => :string %>
|
12
|
+
<%= preference_field_tag 'preferences[attachment_path]', Spree::Config[:attachment_path], :type => :string, :size => 70 %>
|
13
13
|
</label>
|
14
14
|
</p>
|
15
15
|
|
16
16
|
<p data-hook="attachment_default_url">
|
17
17
|
<label>
|
18
18
|
<%= label_tag 'preferences[attachment_default_url]', t(:attachment_default_url) %>
|
19
|
-
<%= preference_field_tag 'preferences[attachment_default_url]', Spree::Config[:attachment_default_url], :type => :string %>
|
19
|
+
<%= preference_field_tag 'preferences[attachment_default_url]', Spree::Config[:attachment_default_url], :type => :string, :size => 60 %>
|
20
20
|
</label>
|
21
21
|
</p>
|
22
22
|
|
@@ -3,10 +3,14 @@
|
|
3
3
|
<td><%= t(:filename) %>:</td>
|
4
4
|
<td><%= f.file_field :attachment %></td>
|
5
5
|
</tr>
|
6
|
-
|
7
|
-
<
|
8
|
-
|
9
|
-
|
6
|
+
<% if @product.has_variants? %>
|
7
|
+
<tr data-hook="variant">
|
8
|
+
<td><%= Spree::Variant.model_name.human %>:</td>
|
9
|
+
<td><%= f.select :viewable_id, @variants %></td>
|
10
|
+
</tr>
|
11
|
+
<% else %>
|
12
|
+
<%= hidden_field_tag :product_id, @product.id %>
|
13
|
+
<% end %>
|
10
14
|
<tr data-hook="alt_text">
|
11
15
|
<td><%= t(:alt_text) %>:</td>
|
12
16
|
<td><%= f.text_area :alt %></td>
|
@@ -53,5 +53,5 @@
|
|
53
53
|
<div id="images" data-hook></div>
|
54
54
|
<br />
|
55
55
|
<p data-hook="links">
|
56
|
-
|
56
|
+
<%= link_to icon('add') + ' ' + t(:new_image), new_admin_product_image_url(@product), :id => 'new_image_link' %>
|
57
57
|
</p>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<tr class="option_value fields" id="<%=
|
1
|
+
<tr class="option_value fields" id="spree_<%= dom_id(f.object) %>" data-hook="option_value">
|
2
2
|
<td class="name"><span class="handle"></span> </span><%= f.text_field :name %></td>
|
3
3
|
<td class="presentation"><%= f.text_field :presentation %></td>
|
4
4
|
<td class="actions"><%= link_to_remove_fields t(:remove), f %></td>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="toolbar" data-hook="toolbar">
|
4
4
|
<ul class="actions">
|
5
5
|
<li id="new_ot_link">
|
6
|
-
<%= button_link_to t(:new_option_type), new_admin_option_type_url, {:remote => true, :icon => 'add', :id => 'new_option_type_link'} %>
|
6
|
+
<%= button_link_to t(:new_option_type), new_admin_option_type_url, { :remote => true, :icon => 'add', :id => 'new_option_type_link' } %>
|
7
7
|
</li>
|
8
8
|
</ul>
|
9
9
|
<br class="clear" />
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<legend><%= t(:add_product) %></legend>
|
4
4
|
<div style="float:left; width:65%; margin-right:5%;" data-hook="add_product_name">
|
5
5
|
<%= label_tag :add_product_name, t(:name_or_sku) %>
|
6
|
-
<%= text_field_tag :add_product_name, nil, :class => 'fullwidth title' %>
|
6
|
+
<%= text_field_tag :add_product_name, nil, :class => 'fullwidth title product_autocomplete' %>
|
7
7
|
<%= hidden_field_tag :add_variant_id %>
|
8
8
|
</div>
|
9
9
|
<div style="float:left; width:10%; margin-right:5%;" data-hook="add_quantity">
|
@@ -50,11 +50,11 @@
|
|
50
50
|
<%= label_tag nil, t(:date_range) %><br />
|
51
51
|
<div class="date-range-filter">
|
52
52
|
<div class="left sub-field">
|
53
|
-
<%= f.text_field :created_at_gt, :class => 'datepicker' %><br />
|
53
|
+
<%= f.text_field :created_at_gt, :class => 'datepicker', :value => params[:q][:created_at_gt] %><br />
|
54
54
|
<%= label_tag nil, t(:start), :class => 'sub' %>
|
55
55
|
</div>
|
56
56
|
<div class="right sub-field">
|
57
|
-
<%= f.text_field :created_at_lt, :class => 'datepicker' %><br />
|
57
|
+
<%= f.text_field :created_at_lt, :class => 'datepicker', :value => params[:q][:created_at_lt] %><br />
|
58
58
|
<%= label_tag nil, t(:stop), :class => 'sub' %>
|
59
59
|
</div>
|
60
60
|
</div>
|
@@ -71,11 +71,11 @@
|
|
71
71
|
<%= f.text_field :email_cont, :size => 25 %>
|
72
72
|
</p>
|
73
73
|
<p>
|
74
|
-
<%= label_tag nil, t(:
|
74
|
+
<%= label_tag nil, t(:first_name_begins_with) %><br />
|
75
75
|
<%= f.text_field :bill_address_firstname_start, :size => 25 %>
|
76
76
|
</p>
|
77
77
|
<p>
|
78
|
-
<%= label_tag nil, t(:
|
78
|
+
<%= label_tag nil, t(:last_name_begins_with) %><br />
|
79
79
|
<%= f.text_field :bill_address_lastname_start, :size => 25 %>
|
80
80
|
</p>
|
81
81
|
<p>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="toolbar order-links" data-hook="admin_order_show_buttons">
|
2
|
-
<%= button_link_to t(:cancel), fire_admin_order_url(@order.number, {:e =>
|
2
|
+
<%= button_link_to t(:cancel), fire_admin_order_url(@order.number, { :e => 'cancel' }), :icon => 'delete', :data => { :confirm => t(:are_you_sure) } if @order.can_cancel? %>
|
3
3
|
<%= button_link_to t(:edit), edit_admin_order_url(@order.number), :icon => 'edit' %>
|
4
4
|
</div>
|
5
5
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<% @payment_methods.each do |method| %>
|
8
8
|
|
9
|
-
<label data-hook="
|
9
|
+
<label data-hook="payment_method_field">
|
10
10
|
<%= radio_button_tag 'payment[payment_method_id]', method.id, method == @payment_method %>
|
11
11
|
<%= t(method.name, :scope => :payment_methods, :default => method.name) %>
|
12
12
|
</label>
|
@@ -18,7 +18,3 @@
|
|
18
18
|
<%= t(:cannot_create_payment_without_payment_methods) %>
|
19
19
|
<%= link_to t(:please_define_payment_methods), admin_payment_methods_url %>
|
20
20
|
<% end %>
|
21
|
-
|
22
|
-
<% content_for :head do %>
|
23
|
-
<%= javascript_include_tag '/admin/javascripts/payments/new.js' %>
|
24
|
-
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<label><%= radio_button_tag :card, 'new', @previous_cards.none? %> <%= t(:use_new_cc) %></label>
|
7
7
|
</p>
|
8
8
|
<div id="card_form" data-hook>
|
9
|
-
<%= image_tag '
|
9
|
+
<%= image_tag 'credit_cards/credit_card.gif', :id => 'credit-card-image' %>
|
10
10
|
<% param_prefix = "payment_source[#{payment_method.id}]" %>
|
11
11
|
|
12
12
|
<div data-hook="card_number">
|
@@ -85,6 +85,17 @@
|
|
85
85
|
</div>
|
86
86
|
</div>
|
87
87
|
|
88
|
+
|
89
|
+
<%= f.field_container :taxons do %>
|
90
|
+
<%= f.label :taxon_ids, t(:taxons) %><br />
|
91
|
+
<%= f.select :taxon_ids, taxon_options_for(@product), {}, :class => "select2", :multiple => true %>
|
92
|
+
<% end %>
|
93
|
+
|
94
|
+
<%= f.field_container :option_types do %>
|
95
|
+
<%= f.label :option_type_ids, t(:option_types) %><br />
|
96
|
+
<%= f.select :option_type_ids, option_types_options_for(@product), {}, :class => "select2", :multiple => true %>
|
97
|
+
<% end %>
|
98
|
+
|
88
99
|
<h2><%= t(:metadata) %></h2>
|
89
100
|
<div data-hook="admin_product_form_meta">
|
90
101
|
<%= f.field_container :meta_keywords do %>
|
@@ -98,9 +109,14 @@
|
|
98
109
|
<% end %>
|
99
110
|
</div>
|
100
111
|
|
101
|
-
<div data-hook="admin_product_form_additional_fields">
|
102
|
-
<% Spree::Variant.additional_fields.select { |af| af[:only].nil? || af[:only].include?(:product) }.each do |field| %>
|
103
|
-
<%= render :partial => 'spree/admin/shared/additional_field', :locals => { :field => field, :f => f } %>
|
104
|
-
<% end %>
|
105
|
-
</div>
|
112
|
+
<div data-hook="admin_product_form_additional_fields"></div>
|
106
113
|
</div>
|
114
|
+
|
115
|
+
<script>
|
116
|
+
|
117
|
+
$("#product_taxon_ids").select2({
|
118
|
+
formatSelection: function(item) { return item.text.split(' -> ').slice(-1)[0] },
|
119
|
+
});
|
120
|
+
|
121
|
+
$("#product_option_type_ids").select2();
|
122
|
+
</script>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="toolbar" data-hook="toolbar">
|
4
4
|
<ul class="actions">
|
5
5
|
<li id="new_product_link">
|
6
|
-
<%= button_link_to t(:new_product), new_object_url, {:remote => true, :icon => 'add', :id => 'admin_new_product'} %>
|
6
|
+
<%= button_link_to t(:new_product), new_object_url, { :remote => true, :icon => 'add', :id => 'admin_new_product' } %>
|
7
7
|
</li>
|
8
8
|
</ul>
|
9
9
|
<br class="clear" />
|
@@ -35,7 +35,7 @@
|
|
35
35
|
</tr>
|
36
36
|
<% end %>
|
37
37
|
</table>
|
38
|
-
<%= paginate @
|
38
|
+
<%= paginate @collection %>
|
39
39
|
|
40
40
|
<% content_for :sidebar do %>
|
41
41
|
<div data-hook="admin_products_sidebar">
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="toolbar" data-hook="toolbar">
|
4
4
|
<ul class="actions">
|
5
5
|
<li id="new_property_link">
|
6
|
-
<%= button_link_to t(:new_property), new_admin_property_url, {:remote => true, :icon => 'add', 'data-update' => 'new_property', :id => 'new_property_link'} %>
|
6
|
+
<%= button_link_to t(:new_property), new_admin_property_url, { :remote => true, :icon => 'add', 'data-update' => 'new_property', :id => 'new_property_link' } %>
|
7
7
|
</li>
|
8
8
|
</ul>
|
9
9
|
<br class="clear" />
|
@@ -20,8 +20,8 @@
|
|
20
20
|
<% elsif units.select(&:shipped?).empty? %>
|
21
21
|
0
|
22
22
|
<% else %>
|
23
|
-
<%=
|
24
|
-
@return_authorization.inventory_units.group_by(&:variant)[variant].try(:size) || 0, {:style => 'width:
|
23
|
+
<%= text_field_tag "return_quantity[#{variant.id}]",
|
24
|
+
@return_authorization.inventory_units.group_by(&:variant)[variant].try(:size) || 0, {:style => 'width:30px;'} %>
|
25
25
|
<% end %>
|
26
26
|
</td>
|
27
27
|
</tr>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<% if @return_authorization.received? %>
|
34
34
|
<%= number_to_currency @return_authorization.amount %>
|
35
35
|
<% else %>
|
36
|
-
<%= f.text_field :amount, {:style => 'width:80px;'} %> <%= t(:rma_value) %>: <span id="rma_value"
|
36
|
+
<%= f.text_field :amount, {:style => 'width:80px;'} %> <%= t(:rma_value) %>: <span id="rma_value"></span>
|
37
37
|
<%= f.error_message_on :amount %>
|
38
38
|
<% end %>
|
39
39
|
<% end %>
|
@@ -45,19 +45,35 @@
|
|
45
45
|
<% end %>
|
46
46
|
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
48
|
+
<% content_for :head do %>
|
49
|
+
<%= javascript_tag do -%>
|
50
|
+
var variant_prices = new Array();
|
51
|
+
<% @return_authorization.order.inventory_units.group_by(&:variant).each do | variant, units| %>
|
52
|
+
variant_prices[<%= variant.id.to_s %>] = <%= variant.price %>;
|
53
|
+
<% end %>
|
54
|
+
|
55
|
+
function calculate_rma_price(object, value){
|
56
|
+
var rma_amount = 0;
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
$.each($("td.return_quantity input"), function(i, inpt){
|
59
|
+
var variant_id = $(inpt).attr('id').replace("return_quantity_", "");
|
60
|
+
rma_amount += variant_prices[variant_id] * $(inpt).val()
|
61
|
+
});
|
62
|
+
|
63
|
+
if(!isNaN(rma_amount)){
|
64
|
+
$("span#rma_value").html(rma_amount.toFixed(2));
|
65
|
+
}
|
60
66
|
}
|
61
|
-
|
62
|
-
|
63
|
-
|
67
|
+
|
68
|
+
$(document).ready(function(){
|
69
|
+
$.each($("td.return_quantity input"), function(i, inpt){
|
70
|
+
$(inpt).delayedObserver(function() {
|
71
|
+
calculate_rma_price();
|
72
|
+
}, 0.5);
|
73
|
+
});
|
74
|
+
|
75
|
+
calculate_rma_price();
|
76
|
+
});
|
77
|
+
<% end -%>
|
78
|
+
<% end %>
|
79
|
+
</div>
|
@@ -2,10 +2,10 @@
|
|
2
2
|
<ul class="actions">
|
3
3
|
<li>
|
4
4
|
<% if @return_authorization.can_receive? %>
|
5
|
-
<%= button_link_to t(:receive), fire_admin_order_return_authorization_url(@order, @return_authorization, :e => 'receive'), :method => :put, :confirm => t(:are_you_sure) %>
|
5
|
+
<%= button_link_to t(:receive), fire_admin_order_return_authorization_url(@order, @return_authorization, :e => 'receive'), :method => :put, :data => { :confirm => t(:are_you_sure) } %>
|
6
6
|
<% end %>
|
7
7
|
<% if @return_authorization.can_cancel? %>
|
8
|
-
<%= button_link_to t(:cancel), fire_admin_order_return_authorization_url(@order, @return_authorization, :e => 'cancel'), :method => :put, :confirm => t(:are_you_sure) %>
|
8
|
+
<%= button_link_to t(:cancel), fire_admin_order_return_authorization_url(@order, @return_authorization, :e => 'cancel'), :method => :put, :data => { :confirm => t(:are_you_sure) } %>
|
9
9
|
<% end %>
|
10
10
|
</li>
|
11
11
|
</ul>
|
@@ -6,8 +6,18 @@
|
|
6
6
|
<%= stylesheet_link_tag 'admin/all' %>
|
7
7
|
<%= javascript_include_tag 'admin/all' %>
|
8
8
|
|
9
|
-
<%=
|
10
|
-
|
9
|
+
<%= javascript_tag do %>
|
10
|
+
Spree.routes = <%== {
|
11
|
+
:product_search => spree.admin_products_path(:format => 'json'),
|
12
|
+
:product_search_basic => spree.admin_products_path(:format => 'json', :json_format => 'basic', :limit => 10),
|
13
|
+
:user_search => spree.admin_search_users_path(:format => 'json', :limit => 10)
|
14
|
+
}.to_json %>;
|
15
|
+
|
16
|
+
strings = <%==
|
17
|
+
[:no_results, :type_to_search, :searching].
|
18
|
+
inject({}){|memo, item| {item => t(item) }}.to_json
|
19
|
+
%>
|
20
|
+
<% end %>
|
11
21
|
|
12
22
|
<%= javascript_tag do -%>
|
13
23
|
jQuery.alerts.dialogClass = 'spree';
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<h5 id="order_status" data-hook><%= t(:status) %>: <%= t(@order.state, :scope => :order_state) %></h5>
|
7
7
|
<h5 id="order_total" data-hook><%= t(:total) %>: <%= number_to_currency @order.total %></h5>
|
8
8
|
<% if @order.completed? %>
|
9
|
-
<h5 id="shipment_status"><%= t(:shipment) %>: <%= t(@order.shipment_state, :scope => :
|
9
|
+
<h5 id="shipment_status"><%= t(:shipment) %>: <%= t(@order.shipment_state, :scope => :shipment_state, :default => [:missing, "none"]) %></h5>
|
10
10
|
<h5 id="payment_status"><%= t(:payment) %>: <%= t(@order.payment_state, :scope => :payment_states, :default => [:missing, "none"]) %></h5>
|
11
11
|
<% end %>
|
12
12
|
<br class="clear" />
|
@@ -50,9 +50,6 @@
|
|
50
50
|
<li<%== ' class="active"' if current == 'Return Authorizations' %>>
|
51
51
|
<%= link_to t(:return_authorizations), admin_order_return_authorizations_url(@order) %>
|
52
52
|
</li>
|
53
|
-
<li<%== ' class="active"' if current == 'History' %>>
|
54
|
-
<%= link_to t(:history), history_admin_order_url(@order) %>
|
55
|
-
</li>
|
56
53
|
<% end %>
|
57
54
|
</ul>
|
58
55
|
|