spree_core 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/creditcards/icons/american_express.png +0 -0
- data/app/assets/images/creditcards/icons/cirrus.png +0 -0
- data/app/assets/images/creditcards/icons/delta.png +0 -0
- data/app/assets/images/creditcards/icons/dinersclub.png +0 -0
- data/app/assets/images/creditcards/icons/directdebit.png +0 -0
- data/app/assets/images/creditcards/icons/discover.png +0 -0
- data/app/assets/images/creditcards/icons/egold.png +0 -0
- data/app/assets/images/creditcards/icons/maestro.png +0 -0
- data/app/assets/images/creditcards/icons/master.png +0 -0
- data/app/assets/images/creditcards/icons/paypal.png +0 -0
- data/app/assets/images/creditcards/icons/solo.png +0 -0
- data/app/assets/images/creditcards/icons/switch.png +0 -0
- data/app/assets/images/creditcards/icons/visa.png +0 -0
- data/app/assets/images/creditcards/icons/visaelectron.png +0 -0
- data/app/assets/images/creditcards/icons/westernunion.png +0 -0
- data/app/assets/images/creditcards/icons/wirecard.png +0 -0
- data/app/assets/images/creditcards/icons/worldpay.png +0 -0
- data/app/assets/images/store/cart.png +0 -0
- data/app/assets/images/store/select_arrow.gif +0 -0
- data/app/assets/javascripts/admin/admin.js.erb +42 -40
- data/app/assets/javascripts/admin/orders/edit.js +1 -6
- data/app/assets/javascripts/admin/spree_core.js +1 -0
- data/app/assets/javascripts/store/cart.js +2 -2
- data/app/assets/javascripts/store/helpers.js.erb +2 -0
- data/app/assets/javascripts/store/spree_core.js +2 -0
- data/app/assets/stylesheets/store/base.css +387 -0
- data/app/assets/stylesheets/store/screen.css.scss +988 -0
- data/app/assets/stylesheets/store/spree_core.css +3 -2
- data/app/controllers/spree/admin/general_settings_controller.rb +2 -1
- data/app/controllers/spree/admin/orders_controller.rb +1 -1
- data/app/helpers/spree/base_helper.rb +9 -6
- data/app/models/spree/activator.rb +0 -1
- data/app/models/spree/adjustment.rb +7 -3
- data/app/models/spree/app_configuration.rb +34 -33
- data/app/models/spree/calculator/flexi_rate.rb +4 -4
- data/app/models/spree/order.rb +6 -1
- data/app/models/spree/payment.rb +7 -4
- data/app/models/spree/preferences/store.rb +3 -0
- data/app/models/spree/product.rb +8 -2
- data/app/views/spree/admin/general_settings/edit.html.erb +1 -1
- data/app/views/spree/admin/option_types/index.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_details.html.erb +50 -2
- data/app/views/spree/admin/shared/_product_tabs.html.erb +1 -1
- data/app/views/spree/checkout/_address.html.erb +15 -13
- data/app/views/spree/checkout/_confirm.html.erb +1 -1
- data/app/views/spree/checkout/_delivery.html.erb +3 -1
- data/app/views/spree/checkout/_payment.html.erb +2 -1
- data/app/views/spree/checkout/_summary.html.erb +1 -0
- data/app/views/spree/checkout/edit.html.erb +22 -12
- data/app/views/spree/checkout/payment/_gateway.html.erb +1 -3
- data/app/views/spree/checkout/registration.html.erb +2 -2
- data/app/views/spree/layouts/spree_application.html.erb +57 -26
- data/app/views/spree/orders/_line_item.html.erb +1 -1
- data/app/views/spree/orders/edit.html.erb +8 -8
- data/app/views/spree/orders/show.html.erb +11 -3
- data/app/views/spree/products/_cart_form.html.erb +27 -22
- data/app/views/spree/products/_image.html.erb +2 -2
- data/app/views/spree/products/_properties.html.erb +13 -8
- data/app/views/spree/products/_taxons.html.erb +2 -2
- data/app/views/spree/products/_thumbnails.html.erb +1 -1
- data/app/views/spree/products/index.html.erb +1 -1
- data/app/views/spree/products/show.html.erb +38 -17
- data/app/views/spree/shared/_head.html.erb +17 -1
- data/app/views/spree/shared/_nav_bar.html.erb +1 -4
- data/app/views/spree/shared/_order_details.html.erb +85 -26
- data/app/views/spree/shared/_products.html.erb +10 -9
- data/app/views/spree/shared/_store_menu.html.erb +1 -2
- data/app/views/spree/shared/_taxonomies.html.erb +3 -3
- data/app/views/spree/taxons/_taxon.html.erb +1 -1
- data/app/views/spree/taxons/show.html.erb +1 -1
- data/config/locales/en.yml +2 -0
- data/config/routes.rb +2 -1
- data/db/migrate/{20111128153359_new_preferences.rb → 20120119024710_new_preferences.rb} +11 -9
- data/lib/generators/spree/install/install_generator.rb +13 -3
- data/lib/generators/spree/install/templates/config/initializers/spree.rb +5 -2
- data/lib/spree/core/controller_helpers.rb +3 -2
- data/lib/spree/core/engine.rb +1 -0
- data/lib/spree/core/permalinks.rb +4 -1
- data/lib/spree/core/testing_support/common_rake.rb +1 -1
- data/lib/spree/core/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.formalize.min.js +1 -0
- data/vendor/assets/stylesheets/jquery.formalize.css +364 -0
- metadata +54 -32
- data/app/assets/stylesheets/store/reset.css +0 -175
- data/app/assets/stylesheets/store/screen.css +0 -127
@@ -1,8 +1,24 @@
|
|
1
|
+
<meta charset="utf-8">
|
2
|
+
|
3
|
+
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
|
4
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
5
|
+
|
1
6
|
<title><%= title %></title>
|
7
|
+
|
2
8
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
9
|
+
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1" name="viewport">
|
10
|
+
|
3
11
|
<%== meta_data_tags %>
|
12
|
+
|
4
13
|
<%= favicon_link_tag image_path('favicon.ico') %>
|
14
|
+
|
5
15
|
<%= stylesheet_link_tag 'store/all', :media => 'screen' %>
|
16
|
+
|
6
17
|
<%= csrf_meta_tags %>
|
7
18
|
<%= javascript_include_tag 'store/all' %>
|
8
|
-
|
19
|
+
|
20
|
+
<!--[if lt IE 9]>
|
21
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
22
|
+
<![endif]-->
|
23
|
+
|
24
|
+
<%= yield :head %>
|
@@ -1,50 +1,109 @@
|
|
1
|
-
<
|
2
|
-
|
1
|
+
<div class="row steps-data">
|
2
|
+
|
3
|
+
<div class="columns alpha four">
|
4
|
+
<h6><%= t(:shipping_address) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
|
5
|
+
<div class="address">
|
6
|
+
<%= order.ship_address %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="columns alpha four">
|
11
|
+
<h6><%= t(:billing_address) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %></h6>
|
12
|
+
<div class="address">
|
13
|
+
<%= order.bill_address %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="columns alpha four">
|
18
|
+
<h6><%= t(:shipping_method) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:delivery) unless @order.completed? %></h6>
|
19
|
+
<div class="delivery">
|
20
|
+
<%= order.shipping_method.name %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="columns omega four">
|
25
|
+
<h6><%= t(:payment_information) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:payment) unless @order.completed? %></h6>
|
26
|
+
<div class="payment-info">
|
27
|
+
<% unless order.creditcards.empty? %>
|
28
|
+
<span class="cc-type">
|
29
|
+
<%= image_tag "creditcards/icons/#{order.creditcards.first.cc_type}.png" %>
|
30
|
+
<%= t(:ending_in)%> <%= order.creditcards.first.last_digits %>
|
31
|
+
</span>
|
32
|
+
<br />
|
33
|
+
<span class="full-name">
|
34
|
+
<%= order.creditcards.first.first_name %>
|
35
|
+
<%= order.creditcards.first.last_name %>
|
36
|
+
</span>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<hr />
|
44
|
+
|
45
|
+
<table class="index columns alpha omega sixteen" data-hook="order_details">
|
46
|
+
|
47
|
+
<thead id="line-items" data-hook>
|
3
48
|
<tr data-hook="order_details_line_items_headers">
|
49
|
+
<th> </th>
|
4
50
|
<th><%= t(:item_description) %></th>
|
5
51
|
<th class="price"><%= t(:price) %></th>
|
6
52
|
<th class="qty"><%= t(:qty) %></th>
|
7
53
|
<th class="total"><span><%= t(:total) %></span></th>
|
8
54
|
</tr>
|
55
|
+
</thead>
|
9
56
|
|
57
|
+
<tbody id="line-items" data-hook>
|
10
58
|
<% @order.line_items.each do |item| %>
|
11
59
|
<tr data-hook="order_details_line_item_row">
|
12
|
-
<td
|
13
|
-
|
60
|
+
<td data-hook="order_item_image" width="20%">
|
61
|
+
<% if item.variant.images.length == 0 %>
|
62
|
+
<%= small_image(item.variant.product) %>
|
63
|
+
<% else %>
|
64
|
+
<%= image_tag item.variant.images.first.attachment.url(:small) %>
|
65
|
+
<% end %>
|
66
|
+
</td>
|
67
|
+
<td width="80%">
|
68
|
+
<h6><%= item.variant.product.name %></h6>
|
69
|
+
<%= truncate(item.variant.product.description, :length => 100, :omission => "...") %>
|
70
|
+
<%= "(" + variant_options(item.variant) + ")" unless item.variant .option_values.empty? %>
|
71
|
+
</td>
|
72
|
+
<td class="price"><span><%= number_to_currency item.price %></span></td>
|
14
73
|
<td class="qty"><%= item.quantity %></td>
|
15
74
|
<td class="total"><span><%= number_to_currency (item.price * item.quantity) %></span></td>
|
16
75
|
</tr>
|
17
76
|
<% end %>
|
18
77
|
</tbody>
|
19
|
-
<
|
20
|
-
<tr class="total" id="subtotal-row">
|
21
|
-
<td colspan="3"><b><%= t(:subtotal) %>:</b></td>
|
22
|
-
<td class="total"><span><%= number_to_currency @order.item_total %></span></td>
|
23
|
-
</tr>
|
24
|
-
</tbody>
|
25
|
-
<tbody id="order-charges" data-hook="order_details_adjustments">
|
26
|
-
<% @order.adjustments.eligible.each do |adjustment| %>
|
27
|
-
<% next if (adjustment.originator_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
|
28
|
-
<tr class="total">
|
29
|
-
<td colspan="3"><strong><%= adjustment.label %></strong></td>
|
30
|
-
<td class="total"><span><%= number_to_currency adjustment.amount %></span></td>
|
31
|
-
</tr>
|
32
|
-
<% end %>
|
33
|
-
</tbody>
|
34
|
-
<tbody id="order-total" data-hook="order_details_total">
|
78
|
+
<tfoot id="order-total" data-hook="order_details_total">
|
35
79
|
<tr class="total">
|
36
|
-
<td colspan="
|
80
|
+
<td colspan="4"><b><%= t(:order_total) %>:</b></td>
|
37
81
|
<td class="total"><span id="order_total"><%= number_to_currency @order.total %></span></td>
|
38
82
|
</tr>
|
39
|
-
</
|
83
|
+
</tfoot>
|
40
84
|
<% if order.price_adjustment_totals.present? %>
|
41
|
-
<
|
85
|
+
<tfoot id="price-adjustments" data-hook="order_details_price_adjustments">
|
42
86
|
<% @order.price_adjustment_totals.keys.each do |key| %>
|
43
87
|
<tr class="total">
|
44
|
-
<td colspan="
|
88
|
+
<td colspan="4"><strong><%= key %></strong></td>
|
45
89
|
<td class="total"><span><%= number_to_currency @order.price_adjustment_totals[key] %></span></td>
|
46
90
|
</tr>
|
47
91
|
<% end %>
|
48
|
-
</
|
92
|
+
</tfoot>
|
49
93
|
<% end %>
|
50
|
-
|
94
|
+
<tfoot id="subtotal" data-hook="order_details_subtotal">
|
95
|
+
<tr class="total" id="subtotal-row">
|
96
|
+
<td colspan="4"><b><%= t(:subtotal) %>:</b></td>
|
97
|
+
<td class="total"><span><%= number_to_currency @order.item_total %></span></td>
|
98
|
+
</tr>
|
99
|
+
</tfoot>
|
100
|
+
<tfoot id="order-charges" data-hook="order_details_adjustments">
|
101
|
+
<% @order.adjustments.eligible.each do |adjustment| %>
|
102
|
+
<% next if (adjustment.originator_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
|
103
|
+
<tr class="total">
|
104
|
+
<td colspan="4"><strong><%= adjustment.label %></strong></td>
|
105
|
+
<td class="total"><span><%= number_to_currency adjustment.amount %></span></td>
|
106
|
+
</tr>
|
107
|
+
<% end %>
|
108
|
+
</tfoot>
|
109
|
+
</table>
|
@@ -5,27 +5,28 @@
|
|
5
5
|
<% if products.empty? %>
|
6
6
|
<%= t(:no_products_found) %>
|
7
7
|
<% elsif params.key?(:keywords) %>
|
8
|
-
<
|
8
|
+
<h6 class="search-results-title"><%= t(:search_results, :keywords => h(params[:keywords])) %></h6>
|
9
9
|
<% end %>
|
10
10
|
|
11
11
|
<% if products.any? %>
|
12
|
-
<ul id="products" class="product-listing" data-hook>
|
12
|
+
<ul id="products" class="inline product-listing" data-hook>
|
13
13
|
<% products.each do |product| %>
|
14
14
|
<% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
|
15
|
-
<li id="product_<%= product.id %>" data-hook="products_list_item">
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
<li id="product_<%= product.id %>" class="columns three" data-hook="products_list_item" itemscope itemtype="http://schema.org/Product">
|
16
|
+
<div class="product-image">
|
17
|
+
<%= link_to small_image(product, :itemprop => "name"), product %>
|
18
|
+
</div>
|
19
|
+
<%= link_to product.name, product, :class => 'info', :itemprop => "name" %>
|
20
|
+
<span class="price selling" itemprop="price"><%= number_to_currency product.price %></span>
|
19
21
|
</li>
|
20
22
|
<% end %>
|
21
23
|
<% end %>
|
22
24
|
</ul>
|
23
25
|
<% end %>
|
24
26
|
|
25
|
-
|
27
|
+
|
26
28
|
|
27
29
|
<% if paginated_products.respond_to?(:num_pages)
|
28
30
|
params.delete(:search)
|
29
31
|
params.delete(:taxon)
|
30
|
-
%><%= paginate paginated_products %><% end %>
|
31
|
-
<hr class="space" />
|
32
|
+
%><%= paginate paginated_products %><% end %>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<
|
1
|
+
<nav id="taxonomies" class="sidebar-item" data-hook>
|
2
2
|
<% get_taxonomies.each do |taxonomy| %>
|
3
|
-
<
|
3
|
+
<h6 class='taxonomy-root'><%= t(:shop_by_taxonomy, :taxonomy => taxonomy.name.singularize) %></h6>
|
4
4
|
<%= taxons_tree(taxonomy.root, @taxon, Spree::Config[:max_level_in_taxons_menu] || 1) %>
|
5
5
|
<% end %>
|
6
|
-
</
|
6
|
+
</nav>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<div class="taxon" data-hook="taxon">
|
2
|
-
<
|
2
|
+
<h5 class="subtaxon-title"><%= link_to taxon.name, seo_url(taxon), :class => 'breadcrumbs' %></h5>
|
3
3
|
<%= render :partial => 'spree/shared/products', :locals => { :products => taxon_preview(taxon), :taxon => taxon } %>
|
4
4
|
</div>
|
data/config/locales/en.yml
CHANGED
@@ -385,6 +385,7 @@ en:
|
|
385
385
|
enable_login_via_login_password: "Use standard email/password"
|
386
386
|
enable_login_via_openid: "Use OpenID instead"
|
387
387
|
enable_mail_delivery: Enable Mail Delivery
|
388
|
+
ending_in: "Ending in"
|
388
389
|
enter_exactly_as_shown_on_card: Please enter exactly as shown on the card
|
389
390
|
enter_at_least_five_letters: Enter at least five letters of customer name
|
390
391
|
enter_password_to_confirm: "(we need your current password to confirm your changes)"
|
@@ -616,6 +617,7 @@ en:
|
|
616
617
|
payment: payment
|
617
618
|
resumed: resumed
|
618
619
|
returned: returned
|
620
|
+
skrill: skrill
|
619
621
|
order_summary: Order Summary
|
620
622
|
order_sure_want_to: "Are you sure you want to %{event} this order?"
|
621
623
|
order_total: "Order Total"
|
data/config/routes.rb
CHANGED
@@ -89,6 +89,7 @@ Spree::Core::Engine.routes.draw do
|
|
89
89
|
collection do
|
90
90
|
get :available
|
91
91
|
get :selected
|
92
|
+
post :update_positions
|
92
93
|
end
|
93
94
|
end
|
94
95
|
resources :taxons do
|
@@ -200,5 +201,5 @@ Spree::Core::Engine.routes.draw do
|
|
200
201
|
match '/admin', :to => 'admin/orders#index', :as => :admin
|
201
202
|
|
202
203
|
match '/content/cvv', :to => 'content#cvv'
|
203
|
-
match '/content/*path', :to => 'content#show', :via => :get
|
204
|
+
match '/content/*path', :to => 'content#show', :via => :get, :as => :content
|
204
205
|
end
|
@@ -27,18 +27,22 @@ class NewPreferences < ActiveRecord::Migration
|
|
27
27
|
owner_class = old_pref.owner_type.constantize
|
28
28
|
owner = OldPrefs.connection.select_value("SELECT #{owner_class.inheritance_column} FROM #{owner_class.table_name} WHERE id = #{old_pref.owner_id}").constantize.new
|
29
29
|
end
|
30
|
-
|
31
|
-
|
30
|
+
|
31
|
+
unless old_pref.owner_type.nil?
|
32
|
+
end
|
33
|
+
|
34
|
+
unless old_pref.owner_type == "Spree::Activator" || old_pref.owner_type == "Spree::PromotionRule"
|
35
|
+
say "Migrating preference #{old_pref.name}"
|
36
|
+
owner.set_preference old_pref.name, old_pref.value
|
37
|
+
end
|
32
38
|
rescue => e
|
33
39
|
say "Skipping setting preference #{old_pref.owner_type}::#{old_pref.name}"
|
34
40
|
end
|
35
41
|
end
|
36
42
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
remove_column :spree_preferences, :group_id
|
41
|
-
remove_column :spree_preferences, :group_type
|
43
|
+
# Remove old promotion prefs
|
44
|
+
Spree::Preference.where(:key => nil).delete_all
|
45
|
+
|
42
46
|
end
|
43
47
|
|
44
48
|
def down
|
@@ -51,6 +55,4 @@ class NewPreferences < ActiveRecord::Migration
|
|
51
55
|
add_column :spree_preferences, :group_id, :integer
|
52
56
|
add_column :spree_preferences, :group_type, :string
|
53
57
|
end
|
54
|
-
|
55
58
|
end
|
56
|
-
|
@@ -9,6 +9,8 @@ module Spree
|
|
9
9
|
class_option :seed, :type => :boolean, :default => true, :banner => 'load seed data (migrations must be run)'
|
10
10
|
class_option :sample, :type => :boolean, :default => true, :banner => 'load sample data (migrations must be run)'
|
11
11
|
class_option :auto_accept, :type => :boolean
|
12
|
+
class_option :admin_email, :type => :string
|
13
|
+
class_option :admin_password, :type => :string
|
12
14
|
class_option :lib_name, :type => :string, :default => 'spree'
|
13
15
|
|
14
16
|
def self.source_paths
|
@@ -115,7 +117,7 @@ Spree::Auth::Engine.load_seed if defined?(Spree::Auth)
|
|
115
117
|
def run_migrations
|
116
118
|
if @run_migrations
|
117
119
|
say_status :running, "migrations"
|
118
|
-
rake
|
120
|
+
quietly { rake 'db:migrate' }
|
119
121
|
else
|
120
122
|
say_status :skipping, "migrations (don't forget to run rake db:migrate)"
|
121
123
|
end
|
@@ -126,7 +128,15 @@ Spree::Auth::Engine.load_seed if defined?(Spree::Auth)
|
|
126
128
|
say_status :loading, "seed data"
|
127
129
|
rake_options=[]
|
128
130
|
rake_options << "AUTO_ACCEPT=1" if options[:auto_accept]
|
129
|
-
|
131
|
+
rake_options << "ADMIN_EMAIL=#{options[:admin_email]}" if options[:admin_email]
|
132
|
+
rake_options << "ADMIN_PASSWORD=#{options[:admin_password]}" if options[:admin_password]
|
133
|
+
|
134
|
+
cmd = lambda { rake("db:seed #{rake_options.join(' ')}") }
|
135
|
+
if options[:auto_accept] || (options[:admin_email] && options[:admin_password])
|
136
|
+
quietly &cmd
|
137
|
+
else
|
138
|
+
cmd.call
|
139
|
+
end
|
130
140
|
else
|
131
141
|
say_status :skipping, "seed data (you can always run rake db:seed)"
|
132
142
|
end
|
@@ -135,7 +145,7 @@ Spree::Auth::Engine.load_seed if defined?(Spree::Auth)
|
|
135
145
|
def load_sample_data
|
136
146
|
if @load_sample_data
|
137
147
|
say_status :loading, "sample data"
|
138
|
-
rake
|
148
|
+
quietly { rake 'spree_sample:load' }
|
139
149
|
else
|
140
150
|
say_status :skipping, "sample data (you can always run rake spree_sample:load)"
|
141
151
|
end
|
@@ -1,7 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# Configure Spree Preferences
|
2
2
|
#
|
3
|
-
#
|
3
|
+
# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart.
|
4
|
+
# If you would like users to be able to update a setting with the Admin it should NOT be set here.
|
4
5
|
#
|
6
|
+
# In order to initialize a setting do:
|
7
|
+
# config.setting_name = 'new value'
|
5
8
|
Spree.config do |config|
|
6
9
|
# Example:
|
7
10
|
# Uncomment to override the default site name.
|
@@ -88,7 +88,8 @@ module Spree
|
|
88
88
|
# add additional keys as appropriate. Override this method if you need additional data when
|
89
89
|
# responding to a notification
|
90
90
|
def default_notification_payload
|
91
|
-
{:user => (respond_to?(:current_user) && current_user),
|
91
|
+
{ :user => (respond_to?(:current_user) && current_user),
|
92
|
+
:order => current_order(true) }
|
92
93
|
end
|
93
94
|
|
94
95
|
private
|
@@ -111,7 +112,7 @@ module Spree
|
|
111
112
|
ActiveSupport::Deprecation.warn "current_gateway is deprecated and will be removed in Spree > 1.0"
|
112
113
|
@current_gateway ||= Gateway.current
|
113
114
|
end
|
114
|
-
|
115
|
+
|
115
116
|
def associate_user
|
116
117
|
return unless current_user and current_order
|
117
118
|
current_order.associate_user!(current_user)
|
data/lib/spree/core/engine.rb
CHANGED
@@ -18,6 +18,7 @@ module Spree
|
|
18
18
|
ActiveSupport::Notifications.subscribe(/^spree\./) do |*args|
|
19
19
|
event_name, start_time, end_time, id, payload = args
|
20
20
|
Activator.active.event_name_starts_with(event_name).each do |activator|
|
21
|
+
payload[:event_name] = event_name
|
21
22
|
activator.activate(payload)
|
22
23
|
end
|
23
24
|
end
|
@@ -40,7 +40,10 @@ module Spree
|
|
40
40
|
permalink_value = self.to_param
|
41
41
|
field = self.class.permalink_field
|
42
42
|
# Do other links exist with this permalink?
|
43
|
-
other = self.class.first(
|
43
|
+
other = self.class.first(
|
44
|
+
:conditions => "#{field} LIKE '#{permalink_value}%'",
|
45
|
+
:order => "LENGTH(#{field}) DESC, #{field} DESC"
|
46
|
+
)
|
44
47
|
if other
|
45
48
|
# Find the number of that permalink and add one.
|
46
49
|
if /-(\d+)$/.match(other.send(field))
|
@@ -8,7 +8,7 @@ namespace :common do
|
|
8
8
|
require "#{ENV['LIB_NAME']}"
|
9
9
|
|
10
10
|
Spree::DummyGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", "--database=#{ENV['DB_NAME']}", "--quiet"]
|
11
|
-
Spree::InstallGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", "--auto-accept", "--migrate=false", "--seed=false", "--sample=false"]
|
11
|
+
Spree::InstallGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", "--auto-accept", "--migrate=false", "--seed=false", "--sample=false", "--quiet"]
|
12
12
|
|
13
13
|
puts "Setting up dummy database..."
|
14
14
|
cmd = "bundle exec rake db:drop db:create db:migrate RAILS_ENV=test AUTO_ACCEPT=true"
|
data/lib/spree/core/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
var FORMALIZE=function(a,b,c){function d(a){var b=c.createElement("b");return b.innerHTML="<!--[if IE "+a+"]><br><![endif]-->",!!b.getElementsByTagName("br").length}var e="placeholder"in c.createElement("input"),f="autofocus"in c.createElement("input"),g=d(6),h=d(7);return{go:function(){var a,b=this.init;for(a in b)b.hasOwnProperty(a)&&b[a]()},init:{full_input_size:function(){h&&a("textarea, input.input_full").length&&a("textarea, input.input_full").wrap('<span class="input_full_wrap"></span>')},ie6_skin_inputs:function(){if(g&&a("input, select, textarea").length){var b=/button|submit|reset/,c=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;a("input").each(function(){var d=a(this);this.getAttribute("type").match(b)?(d.addClass("ie6_button"),this.disabled&&d.addClass("ie6_button_disabled")):this.getAttribute("type").match(c)&&(d.addClass("ie6_input"),this.disabled&&d.addClass("ie6_input_disabled"))}),a("textarea, select").each(function(){this.disabled&&a(this).addClass("ie6_input_disabled")})}},autofocus:function(){f||!a(":input[autofocus]").length||a(":input[autofocus]:visible:first").focus()},placeholder:function(){!e&&!!a(":input[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),a(":input[placeholder]").each(function(){if(this.type!=="password"){var b=a(this),c=b.attr("placeholder");b.focus(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).blur(function(){FORMALIZE.misc.add_placeholder()}),b.closest("form").submit(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).bind("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}}))}},misc:{add_placeholder:function(){e||!a(":input[placeholder]").length||a(":input[placeholder]").each(function(){if(this.type!=="password"){var b=a(this),c=b.attr("placeholder");(!b.val()||b.val()===c)&&b.val(c).addClass("placeholder_text")}})}}}}(jQuery,this,this.document);jQuery(document).ready(function(){FORMALIZE.go()})
|
@@ -0,0 +1,364 @@
|
|
1
|
+
.input_tiny {
|
2
|
+
width: 50px;
|
3
|
+
}
|
4
|
+
|
5
|
+
.input_small {
|
6
|
+
width: 100px;
|
7
|
+
}
|
8
|
+
|
9
|
+
.input_medium {
|
10
|
+
width: 150px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.input_large {
|
14
|
+
width: 200px;
|
15
|
+
}
|
16
|
+
|
17
|
+
.input_xlarge {
|
18
|
+
width: 250px;
|
19
|
+
}
|
20
|
+
|
21
|
+
.input_xxlarge {
|
22
|
+
width: 300px;
|
23
|
+
}
|
24
|
+
|
25
|
+
.input_full {
|
26
|
+
width: 100%;
|
27
|
+
}
|
28
|
+
|
29
|
+
.input_full_wrap {
|
30
|
+
display: block;
|
31
|
+
padding-right: 8px;
|
32
|
+
}
|
33
|
+
|
34
|
+
input[type="search"]::-webkit-search-decoration {
|
35
|
+
display: none;
|
36
|
+
}
|
37
|
+
|
38
|
+
button:focus,
|
39
|
+
input:focus,
|
40
|
+
select:focus,
|
41
|
+
textarea:focus {
|
42
|
+
-webkit-box-shadow: #0066ff 0 0 7px 0;
|
43
|
+
-moz-box-shadow: #0066ff 0 0 7px 0;
|
44
|
+
-o-box-shadow: #0066ff 0 0 7px 0;
|
45
|
+
box-shadow: #0066ff 0 0 7px 0;
|
46
|
+
z-index: 1;
|
47
|
+
}
|
48
|
+
|
49
|
+
input[type="file"]:focus, input[type="file"]:active,
|
50
|
+
input[type="radio"]:focus,
|
51
|
+
input[type="radio"]:active,
|
52
|
+
input[type="checkbox"]:focus,
|
53
|
+
input[type="checkbox"]:active {
|
54
|
+
-webkit-box-shadow: none;
|
55
|
+
-moz-box-shadow: none;
|
56
|
+
-o-box-shadow: none;
|
57
|
+
box-shadow: none;
|
58
|
+
}
|
59
|
+
button,
|
60
|
+
input[type="reset"],
|
61
|
+
input[type="submit"],
|
62
|
+
input[type="button"],
|
63
|
+
a.button {
|
64
|
+
-webkit-appearance: none;
|
65
|
+
-webkit-border-radius: 4px;
|
66
|
+
-moz-border-radius: 4px;
|
67
|
+
-ms-border-radius: 4px;
|
68
|
+
-o-border-radius: 4px;
|
69
|
+
border-radius: 4px;
|
70
|
+
-webkit-background-clip: padding;
|
71
|
+
-moz-background-clip: padding;
|
72
|
+
-ms-background-clip: padding-box;
|
73
|
+
-o-background-clip: padding-box;
|
74
|
+
background-clip: padding-box;
|
75
|
+
background: #dddddd url('../images/button.png?1298351022') repeat-x;
|
76
|
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #dddddd));
|
77
|
+
background-image: -webkit-linear-gradient(#ffffff, #dddddd);
|
78
|
+
background-image: -moz-linear-gradient(#ffffff, #dddddd);
|
79
|
+
background-image: -o-linear-gradient(#ffffff, #dddddd);
|
80
|
+
background-image: -ms-linear-gradient(#ffffff, #dddddd);
|
81
|
+
background-image: linear-gradient(#ffffff, #dddddd);
|
82
|
+
border: 1px solid;
|
83
|
+
border-color: #dddddd #bbbbbb #999999;
|
84
|
+
cursor: pointer;
|
85
|
+
color: #333333;
|
86
|
+
font: bold 12px/1.3 "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif;
|
87
|
+
outline: 0;
|
88
|
+
overflow: visible;
|
89
|
+
margin: 0;
|
90
|
+
padding: 3px 10px;
|
91
|
+
text-shadow: white 0 1px 1px;
|
92
|
+
vertical-align: top;
|
93
|
+
width: auto;
|
94
|
+
*padding-top: 2px;
|
95
|
+
*padding-bottom: 0;
|
96
|
+
}
|
97
|
+
button:hover,
|
98
|
+
input[type="reset"]:hover,
|
99
|
+
input[type="submit"]:hover,
|
100
|
+
input[type="button"]:hover,
|
101
|
+
a.button:hover {
|
102
|
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(1px, #eeeeee), color-stop(100%, #cccccc));
|
103
|
+
background-image: -webkit-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
104
|
+
background-image: -moz-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
105
|
+
background-image: -o-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
106
|
+
background-image: -ms-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
107
|
+
background-image: linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
108
|
+
}
|
109
|
+
button:active,
|
110
|
+
input[type="reset"]:active,
|
111
|
+
input[type="submit"]:active,
|
112
|
+
input[type="button"]:active,
|
113
|
+
a.button:active {
|
114
|
+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(1px, #dddddd), color-stop(100%, #eeeeee));
|
115
|
+
background-image: -webkit-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
|
116
|
+
background-image: -moz-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
|
117
|
+
background-image: -o-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
|
118
|
+
background-image: -ms-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
|
119
|
+
background-image: linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
|
120
|
+
-webkit-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
|
121
|
+
-moz-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
|
122
|
+
-o-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
|
123
|
+
box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
|
124
|
+
border-color: #999999 #bbbbbb #dddddd;
|
125
|
+
}
|
126
|
+
a.button::-moz-focus-inner,
|
127
|
+
button::-moz-focus-inner,
|
128
|
+
input[type="reset"]::-moz-focus-inner,
|
129
|
+
input[type="submit"]::-moz-focus-inner,
|
130
|
+
input[type="button"]::-moz-focus-inner {
|
131
|
+
border: 0;
|
132
|
+
padding: 0;
|
133
|
+
}
|
134
|
+
|
135
|
+
button, a.button {
|
136
|
+
*padding-top: 1px;
|
137
|
+
*padding-bottom: 1px;
|
138
|
+
}
|
139
|
+
|
140
|
+
textarea,
|
141
|
+
select,
|
142
|
+
input[type="date"],
|
143
|
+
input[type="datetime"],
|
144
|
+
input[type="datetime-local"],
|
145
|
+
input[type="email"],
|
146
|
+
input[type="month"],
|
147
|
+
input[type="number"],
|
148
|
+
input[type="password"],
|
149
|
+
input[type="search"],
|
150
|
+
input[type="tel"],
|
151
|
+
input[type="text"],
|
152
|
+
input[type="time"],
|
153
|
+
input[type="url"],
|
154
|
+
input[type="week"] {
|
155
|
+
-webkit-box-sizing: border-box;
|
156
|
+
-moz-box-sizing: border-box;
|
157
|
+
-ms-box-sizing: border-box;
|
158
|
+
box-sizing: border-box;
|
159
|
+
-webkit-background-clip: padding;
|
160
|
+
-moz-background-clip: padding;
|
161
|
+
-ms-background-clip: padding-box;
|
162
|
+
-o-background-clip: padding-box;
|
163
|
+
background-clip: padding-box;
|
164
|
+
-webkit-border-radius: 0;
|
165
|
+
-moz-border-radius: 0;
|
166
|
+
-ms-border-radius: 0;
|
167
|
+
-o-border-radius: 0;
|
168
|
+
border-radius: 0;
|
169
|
+
-webkit-appearance: none;
|
170
|
+
background-color: white;
|
171
|
+
border: 1px solid;
|
172
|
+
border-color: #848484 #c1c1c1 #e1e1e1;
|
173
|
+
color: black;
|
174
|
+
outline: 0;
|
175
|
+
margin: 0;
|
176
|
+
padding: 2px 3px;
|
177
|
+
text-align: left;
|
178
|
+
font-size: 13px;
|
179
|
+
font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
|
180
|
+
height: 1.8em;
|
181
|
+
vertical-align: top;
|
182
|
+
*padding-top: 2px;
|
183
|
+
*padding-bottom: 1px;
|
184
|
+
*height: auto;
|
185
|
+
}
|
186
|
+
textarea[disabled],
|
187
|
+
select[disabled],
|
188
|
+
input[type="date"][disabled],
|
189
|
+
input[type="datetime"][disabled],
|
190
|
+
input[type="datetime-local"][disabled],
|
191
|
+
input[type="email"][disabled],
|
192
|
+
input[type="month"][disabled],
|
193
|
+
input[type="number"][disabled],
|
194
|
+
input[type="password"][disabled],
|
195
|
+
input[type="search"][disabled],
|
196
|
+
input[type="tel"][disabled],
|
197
|
+
input[type="text"][disabled],
|
198
|
+
input[type="time"][disabled],
|
199
|
+
input[type="url"][disabled],
|
200
|
+
input[type="week"][disabled] {
|
201
|
+
background-color: #eeeeee;
|
202
|
+
}
|
203
|
+
a.button[disabled],
|
204
|
+
button[disabled],
|
205
|
+
input[disabled],
|
206
|
+
select[disabled],
|
207
|
+
select[disabled] option,
|
208
|
+
select[disabled] optgroup,
|
209
|
+
textarea[disabled] {
|
210
|
+
-webkit-box-shadow: none;
|
211
|
+
-moz-box-shadow: none;
|
212
|
+
-o-box-shadow: none;
|
213
|
+
box-shadow: none;
|
214
|
+
-moz-user-select: -moz-none;
|
215
|
+
-webkit-user-select: none;
|
216
|
+
-khtml-user-select: none;
|
217
|
+
user-select: none;
|
218
|
+
color: #888888;
|
219
|
+
cursor: default;
|
220
|
+
}
|
221
|
+
|
222
|
+
input::-webkit-input-placeholder,
|
223
|
+
textarea::-webkit-input-placeholder {
|
224
|
+
color: #888888;
|
225
|
+
}
|
226
|
+
|
227
|
+
input:-moz-placeholder,
|
228
|
+
textarea:-moz-placeholder {
|
229
|
+
color: #888888;
|
230
|
+
}
|
231
|
+
|
232
|
+
input.placeholder_text,
|
233
|
+
textarea.placeholder_text {
|
234
|
+
color: #888888;
|
235
|
+
}
|
236
|
+
|
237
|
+
textarea,
|
238
|
+
select[size],
|
239
|
+
select[multiple] {
|
240
|
+
height: auto;
|
241
|
+
}
|
242
|
+
|
243
|
+
select[size="0"],
|
244
|
+
select[size="1"] {
|
245
|
+
height: 1.8em;
|
246
|
+
*height: auto;
|
247
|
+
}
|
248
|
+
|
249
|
+
@media (-webkit-min-device-pixel-ratio: 0) {
|
250
|
+
select[size],
|
251
|
+
select[multiple],
|
252
|
+
select[multiple][size] {
|
253
|
+
background-image: none;
|
254
|
+
padding-right: 3px;
|
255
|
+
}
|
256
|
+
|
257
|
+
select,
|
258
|
+
select[size="0"],
|
259
|
+
select[size="1"] {
|
260
|
+
background-image: url('../images/select_arrow.gif?1298351050');
|
261
|
+
background-repeat: no-repeat;
|
262
|
+
background-position: right center;
|
263
|
+
padding-right: 20px;
|
264
|
+
}
|
265
|
+
|
266
|
+
::-webkit-validation-bubble-message {
|
267
|
+
-webkit-box-shadow: none;
|
268
|
+
box-shadow: none;
|
269
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666666), color-stop(1, black));
|
270
|
+
border: 1px solid;
|
271
|
+
border-color: #747474 #5e5e5e #4f4f4f;
|
272
|
+
color: white;
|
273
|
+
font: 13px/17px "Lucida Grande", Arial, "Liberation Sans", FreeSans, sans-serif;
|
274
|
+
overflow: hidden;
|
275
|
+
padding: 15px 15px 17px;
|
276
|
+
text-shadow: black 0 0 1px;
|
277
|
+
height: 16px;
|
278
|
+
}
|
279
|
+
|
280
|
+
::-webkit-validation-bubble-arrow,
|
281
|
+
::-webkit-validation-bubble-top-outer-arrow,
|
282
|
+
::-webkit-validation-bubble-top-inner-arrow {
|
283
|
+
-webkit-box-shadow: none;
|
284
|
+
box-shadow: none;
|
285
|
+
background: #666666;
|
286
|
+
border: 0;
|
287
|
+
}
|
288
|
+
}
|
289
|
+
textarea {
|
290
|
+
min-height: 40px;
|
291
|
+
overflow: auto;
|
292
|
+
resize: vertical;
|
293
|
+
width: 100%;
|
294
|
+
}
|
295
|
+
|
296
|
+
optgroup {
|
297
|
+
color: black;
|
298
|
+
font-style: normal;
|
299
|
+
font-weight: normal;
|
300
|
+
font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
|
301
|
+
}
|
302
|
+
|
303
|
+
input:invalid,
|
304
|
+
button:invalid,
|
305
|
+
select:invalid,
|
306
|
+
textarea:invalid {
|
307
|
+
-webkit-box-shadow: none;
|
308
|
+
-moz-box-shadow: none;
|
309
|
+
-o-box-shadow: none;
|
310
|
+
box-shadow: none;
|
311
|
+
}
|
312
|
+
input::-moz-focus-inner,
|
313
|
+
button::-moz-focus-inner,
|
314
|
+
a.button::-moz-focus-inner,
|
315
|
+
select::-moz-focus-inner,
|
316
|
+
textarea::-moz-focus-inner {
|
317
|
+
border: 0;
|
318
|
+
padding: 0;
|
319
|
+
}
|
320
|
+
|
321
|
+
.ie6_button,
|
322
|
+
* html button {
|
323
|
+
background: #dddddd url('../images/button.png?1298351022') repeat-x;
|
324
|
+
border: 1px solid;
|
325
|
+
border-color: #dddddd #bbbbbb #999999;
|
326
|
+
cursor: pointer;
|
327
|
+
color: #333333;
|
328
|
+
font: bold 12px/1.2 Arial, sans-serif;
|
329
|
+
padding: 2px 10px 0px;
|
330
|
+
overflow: visible;
|
331
|
+
width: auto;
|
332
|
+
}
|
333
|
+
|
334
|
+
* html button {
|
335
|
+
padding-top: 1px;
|
336
|
+
padding-bottom: 1px;
|
337
|
+
}
|
338
|
+
|
339
|
+
.ie6_input,
|
340
|
+
* html textarea,
|
341
|
+
* html select {
|
342
|
+
background: white;
|
343
|
+
border: 1px solid;
|
344
|
+
border-color: #848484 #c1c1c1 #e1e1e1;
|
345
|
+
color: black;
|
346
|
+
padding: 2px 3px 1px;
|
347
|
+
font-size: 13px;
|
348
|
+
font-family: Arial, sans-serif;
|
349
|
+
vertical-align: top;
|
350
|
+
}
|
351
|
+
|
352
|
+
* html select {
|
353
|
+
margin-top: 1px;
|
354
|
+
}
|
355
|
+
|
356
|
+
.placeholder_text,
|
357
|
+
.ie6_input_disabled,
|
358
|
+
.ie6_button_disabled {
|
359
|
+
color: #888888;
|
360
|
+
}
|
361
|
+
|
362
|
+
.ie6_input_disabled {
|
363
|
+
background: #eeeeee;
|
364
|
+
}
|